Bart Van Assche wrote:
On 12/18/12 00:26, David Milburn wrote:
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index ce5224c..6d72abb 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -596,7 +596,7 @@ static ssize_t
store_state_field(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
- int i;
+ int i, rc;
struct scsi_device *sdev = to_scsi_device(dev);
enum scsi_device_state state = 0;
@@ -611,7 +611,11 @@ store_state_field(struct device *dev, struct
device_attribute *attr,
if (!state)
return -EINVAL;
- if (scsi_device_set_state(sdev, state))
+ if (state == SDEV_DEL) {
+ rc = device_schedule_callback(dev, sdev_store_delete_callback);
+ if (rc)
+ count = rc;
+ } else if (scsi_device_set_state(sdev, state))
return -EINVAL;
return count;
}
Hello David,
And what about the "cancel" state ? I guess this means that you have
missed patch http://marc.info/?l=linux-scsi&m=135480941801843 ?
Hi Bart,
Sorry, I did miss that patch.
Adding SDEV_CANCEL to the above check would result in __scsi_remove_device()
not completing since it wouldn't be able to set the device state from
SDEV_CANCEL
to SDEV_CANCEL. Your patch to not allow this state change makes sense.
Thanks,
David
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html