The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] SCSI: Fix BLKSECTGET ioctl of sg device caculation mistake.
@ 2012-06-27  7:29 Cong Meng
  2012-06-27  7:49 ` James Bottomley
  0 siblings, 1 reply; 2+ messages in thread
From: Cong Meng @ 2012-06-27  7:29 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: stefanha, linuxram, linux-kernel, linux-scsi, Cong Meng

Fix BLKSECTGET ioctl of sg device caculation mistake.

Signed-off-by: Cong Meng <mc@linux.vnet.ibm.com>
---
 drivers/scsi/sg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index eacd46b..c424602 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -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,
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] SCSI: Fix BLKSECTGET ioctl of sg device caculation mistake.
  2012-06-27  7:29 [PATCH] SCSI: Fix BLKSECTGET ioctl of sg device caculation mistake Cong Meng
@ 2012-06-27  7:49 ` James Bottomley
  0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2012-06-27  7:49 UTC (permalink / raw)
  To: Cong Meng; +Cc: stefanha, linuxram, linux-kernel, linux-scsi

On Wed, 2012-06-27 at 15:29 +0800, Cong Meng wrote:
> Fix BLKSECTGET ioctl of sg device caculation mistake.
> 
> Signed-off-by: Cong Meng <mc@linux.vnet.ibm.com>
> ---
>  drivers/scsi/sg.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index eacd46b..c424602 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-27  7:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-27  7:29 [PATCH] SCSI: Fix BLKSECTGET ioctl of sg device caculation mistake Cong Meng
2012-06-27  7:49 ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox