From: Brian King Date: Mon, 19 Oct 2009 20:07:48 +0000 (-0500) Subject: [SCSI] ibmvfc: Fix locking in ibmvfc_remove X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~27942^2~167 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=7043110550f19c1556ad18dc4d63b1c9eaf9e4fd;p=mirror_ubuntu-focal-kernel.git [SCSI] ibmvfc: Fix locking in ibmvfc_remove Need to grab the host lock around the call to ibmvfc_link_down. Signed-off-by: Brian King Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index c35d8054dbbb..d37230faf086 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -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);