Skip to contentSkip to conversation

fix return value of scsi_device rescan attribute

PATCH New Patrick Mansfield 1 participant 1 message Jun 25, 2003 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix return value of scsi_device rescan attribute

When writing to the rescan attribute, return count as result, otherwise some user apps might retry the write forever.

And remove the read capability of the attribute.

drivers/scsi/scsi_sysfs.c +2 -8
diff -purN -X /home/patman/dontdiff bleed-2.5/drivers/scsi/scsi_sysfs.c rescan-cleanup-bl-2.5/drivers/scsi/scsi_sysfs.c
@@ -195,19 +195,13 @@ sdev_rd_attr (rev, "%.4s\n");
 sdev_rw_attr_bit (online);
 
 static ssize_t
-show_rescan_field (struct device *dev, char *buf)
-{
-	return 0; 
-}
-
-static ssize_t
 store_rescan_field (struct device *dev, const char *buf, size_t count) 
 {
 	scsi_rescan_device(dev);
-	return 0;
+	return count;
 }
 
-static DEVICE_ATTR(rescan, S_IRUGO | S_IWUSR, show_rescan_field, store_rescan_field)
+static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field)
 
 /* Default template for device attributes.  May NOT be modified */
 struct device_attribute *scsi_sysfs_sdev_attrs[] = {

-- Patrick Mansfield