scsi_sysfs: Fix queue_ramp_up_period return code
authorPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Tue, 27 Oct 2015 09:49:54 +0000 (10:49 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 9 Nov 2015 17:26:31 +0000 (12:26 -0500)
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>
Cc: stable@vger.kernel.org
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>
drivers/scsi/scsi_sysfs.c

index fdcf0abe613f985675e2473f1e651288925419fc..8b7fa8aece661226d72a5706b3ede694a08fb325 100644 (file)
@@ -921,7 +921,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 DEVICE_ATTR(queue_ramp_up_period, S_IRUGO | S_IWUSR,