|
@@ -290,6 +290,7 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev,
|
|
struct zfcp_unit *unit;
|
|
struct zfcp_unit *unit;
|
|
u64 fcp_lun;
|
|
u64 fcp_lun;
|
|
int retval = -EINVAL;
|
|
int retval = -EINVAL;
|
|
|
|
+ struct scsi_device *sdev;
|
|
|
|
|
|
if (!(port && get_device(&port->dev)))
|
|
if (!(port && get_device(&port->dev)))
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
@@ -303,8 +304,13 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev,
|
|
else
|
|
else
|
|
retval = 0;
|
|
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);
|
|
write_lock_irq(&port->unit_list_lock);
|
|
list_del(&unit->list);
|
|
list_del(&unit->list);
|