diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2010-07-16 17:37:35 +0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 18:48:46 +0400 |
commit | 1bf3ff02ca6247b2d7c9ebda93002392bf60a61d (patch) | |
tree | 569683190acd2ac3da8489bdcbd0f25f80c73b3e /drivers/s390/scsi/zfcp_sysfs.c | |
parent | 674c3a993c278b7469e1cf12bfc13e6838dfd877 (diff) | |
download | linux-1bf3ff02ca6247b2d7c9ebda93002392bf60a61d.tar.xz |
[SCSI] zfcp: Remove SCSI device when removing unit
Configuring a LUN in zfcp, also creates a SCSI device. For
consistency, it makes sense to remove the SCSI device when the LUN is
deconfigured. Replace the flush_work with the call to
scsi_remove_device: scsi_remove_device also takes the scan_mutex that
synchronizes itself with any long running device discovery.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_sysfs.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c index 205b9f8056e2..b4561c86e230 100644 --- a/drivers/s390/scsi/zfcp_sysfs.c +++ b/drivers/s390/scsi/zfcp_sysfs.c @@ -290,6 +290,7 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev, struct zfcp_unit *unit; u64 fcp_lun; int retval = -EINVAL; + struct scsi_device *sdev; if (!(port && get_device(&port->dev))) return -EBUSY; @@ -303,8 +304,13 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev, else retval = 0; - /* wait for possible timeout during SCSI probe */ - flush_work(&unit->scsi_work); + sdev = scsi_device_lookup(port->adapter->scsi_host, 0, + port->starget_id, + scsilun_to_int((struct scsi_lun *)&fcp_lun)); + if (sdev) { + scsi_remove_device(sdev); + scsi_device_put(sdev); + } write_lock_irq(&port->unit_list_lock); list_del(&unit->list); |