]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[PATCH] block: Fix bad data direction in SG_IO
authorJens Axboe <jens.axboe@oracle.com>
Mon, 13 Nov 2006 17:59:01 +0000 (17:59 +0000)
committerChris Wright <chrisw@sous-sol.org>
Sun, 19 Nov 2006 03:28:05 +0000 (19:28 -0800)
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

index b33eda26e2053e84f85473a13cd657cf920e3fe0..ed3d3aec7e9ad3850dd07c737718884c9ae0452e 100644 (file)
@@ -246,10 +246,10 @@ static int sg_io(struct file *file, request_queue_t *q,
                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;
                }