SCSI: Fix BLKSECTGET ioctl of sg device caculation mistake.
Subsystems (2)
PATCH 1/1 SCSI: Fix BLKSECTGET ioctl of sg device caculation mistake.
Fix BLKSECTGET ioctl of sg device caculation mistake.
Signed-off-by Cong Meng <[email protected]>
--- drivers/scsi/sg.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/sg.c +1 -1
@@ -1070,7 +1070,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)return -ENODEV ;return scsi_ioctl (sdp->device, cmd_in, p);case BLKSECTGET : -return put_user (queue_max_sectors (sdp->device->request_queue) *512 , +return put_user (queue_max_sectors (sdp->device->request_queue), ip);case BLKTRACESETUP : return blk_trace_setup(sdp->device->request_queue,
Signature · 1 line
1.7.7.6
James Bottomley
maintainerQuoted 12 lines · Cong Meng
Fix BLKSECTGET ioctl of sg device caculation mistake.
Signed-off-by Cong Meng <[email protected]>--- drivers/scsi/sg.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/scsi/sg.c +0
-0
drivers/scsi/sg.c sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) · line 1073
Quoted 5 lines
drivers/scsi/sg.c +1
-1@@ -1070,7 +1070,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)return -ENODEV ;return scsi_ioctl (sdp->device, cmd_in, p);case BLKSECTGET : - return put_user(queue_max_sectors(sdp->device->request_queue) * 512, + return put_user(queue_max_sectors(sdp->device->request_queue),
Really, no. This would break all existing user of the ioctl.
Even if you can find a document somewhere that says BLKSECTGET should return sectors instead of bytes, we have to go with the ABI we've been exporting for decades and fix up the document.
James