aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2006-11-13 12:04:59 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-11-13 12:47:00 -0500
commit616e8a091a035c0bd9b871695f4af191df123caa (patch)
tree9b9c97c6b55a9a097bafb453085375497b916fdc
parentbf2b3de2a8e66e5f554c2113fac688bcaaca77fb (diff)
[PATCH] Fix bad data direction in SG_IO
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>
-rw-r--r--block/scsi_ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 2dc326421a24..a19338e6215d 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -246,10 +246,10 @@ static int sg_io(struct file *file, request_queue_t *q,
246 switch (hdr->dxfer_direction) { 246 switch (hdr->dxfer_direction) {
247 default: 247 default:
248 return -EINVAL; 248 return -EINVAL;
249 case SG_DXFER_TO_FROM_DEV:
250 case SG_DXFER_TO_DEV: 249 case SG_DXFER_TO_DEV:
251 writing = 1; 250 writing = 1;
252 break; 251 break;
252 case SG_DXFER_TO_FROM_DEV:
253 case SG_DXFER_FROM_DEV: 253 case SG_DXFER_FROM_DEV:
254 break; 254 break;
255 } 255 }