blob: 4b4ae84c438dc258038f05274cc6fbe48785f7fc [file] [log] [blame]
From stable-bounces@linux.kernel.org Tue Nov 14 01:24:00 2006
From: maks@sternwelten.at
Date: Mon, 13 Nov 2006 17:59:01 GMT
Message-Id: <200611131759.kADHx1kX004578@hera.kernel.org>
To: stable@kernel.org
Subject: block: Fix bad data direction in SG_IO
From: Jens Axboe <jens.axboe@oracle.com>
Contrary to what the name misleads you to believe, SG_DXFER_TO_FROM_DEV
is really just a normal read seen from the device side.
This patch fixes http://lkml.org/lkml/2006/10/13/100
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
block/scsi_ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-2.6.18.2.orig/block/scsi_ioctl.c
+++ linux-2.6.18.2/block/scsi_ioctl.c
@@ -246,10 +246,10 @@ static int sg_io(struct file *file, requ
switch (hdr->dxfer_direction) {
default:
return -EINVAL;
- case SG_DXFER_TO_FROM_DEV:
case SG_DXFER_TO_DEV:
writing = 1;
break;
+ case SG_DXFER_TO_FROM_DEV:
case SG_DXFER_FROM_DEV:
break;
}