Re: [PATCH] scsi: remove device when state is changed to deleted thru sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ?

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux