Commit 8fc658bb authored by Peter Oberparleiter's avatar Peter Oberparleiter Committed by Luis Henriques

scsi_sysfs: Fix queue_ramp_up_period return code

commit 863e02d0 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: default avatarPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: default avatarEwan D. Milne <emilne@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent f7fc5a0c
...@@ -891,7 +891,7 @@ sdev_store_queue_ramp_up_period(struct device *dev, ...@@ -891,7 +891,7 @@ sdev_store_queue_ramp_up_period(struct device *dev,
return -EINVAL; return -EINVAL;
sdev->queue_ramp_up_period = msecs_to_jiffies(period); sdev->queue_ramp_up_period = msecs_to_jiffies(period);
return period; return count;
} }
static DEVICE_ATTR(queue_ramp_up_period, S_IRUGO | S_IWUSR, static DEVICE_ATTR(queue_ramp_up_period, S_IRUGO | S_IWUSR,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment