OSDN Git Service

[SCSI] ibmvfc: Fix locking in ibmvfc_remove
authorBrian King <brking@linux.vnet.ibm.com>
Mon, 19 Oct 2009 20:07:48 +0000 (15:07 -0500)
committerJames Bottomley <James.Bottomley@suse.de>
Fri, 4 Dec 2009 18:00:19 +0000 (12:00 -0600)
Need to grab the host lock around the call to ibmvfc_link_down.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/ibmvscsi/ibmvfc.c

index c35d805..d37230f 100644 (file)
@@ -4420,7 +4420,11 @@ static int ibmvfc_remove(struct vio_dev *vdev)
 
        ENTER;
        ibmvfc_remove_trace_file(&vhost->host->shost_dev.kobj, &ibmvfc_trace_attr);
+
+       spin_lock_irqsave(vhost->host->host_lock, flags);
        ibmvfc_link_down(vhost, IBMVFC_HOST_OFFLINE);
+       spin_unlock_irqrestore(vhost->host->host_lock, flags);
+
        ibmvfc_wait_while_resetting(vhost);
        ibmvfc_release_crq_queue(vhost);
        kthread_stop(vhost->work_thread);