diff options
author | Peter Oberparleiter <oberpar@linux.vnet.ibm.com> | 2015-10-27 10:49:54 +0100 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2016-02-24 10:23:24 +0100 |
commit | 54c4a58c53228f430a01bd75bf78a9d167c428f3 (patch) | |
tree | 29d19f5160575212b7977b48f4b634848d5e15da | |
parent | 259d9d2f2725b1a8ca4d70f10c860259aef1d1a5 (diff) | |
download | lwn-54c4a58c53228f430a01bd75bf78a9d167c428f3.tar.gz lwn-54c4a58c53228f430a01bd75bf78a9d167c428f3.zip |
scsi_sysfs: Fix queue_ramp_up_period return code
commit 863e02d0e173bb9d8cea6861be22820b25c076cc upstream.
Writing a number to /sys/bus/scsi/devices/<sdev>/queue_ramp_up_period
returns the value of that number instead of the number of bytes written.
This behavior can confuse programs expecting POSIX write() semantics.
Fix this by returning the number of bytes written instead.
Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 678a9f96588a..9394675a87ae 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -829,7 +829,7 @@ sdev_store_queue_ramp_up_period(struct device *dev, return -EINVAL; sdev->queue_ramp_up_period = msecs_to_jiffies(period); - return period; + return count; } static struct device_attribute sdev_attr_queue_ramp_up_period = |