]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
block: Fix bad data direction in SG_IO
authorJens Axboe <jens.axboe@oracle.com>
Wed, 29 Nov 2006 13:01:40 +0000 (14:01 +0100)
committerAdrian Bunk <bunk@stusta.de>
Wed, 29 Nov 2006 13:01:40 +0000 (14:01 +0100)
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: Adrian Bunk <bunk@stusta.de>
block/scsi_ioctl.c

index 24f7af9d0abc226b2630f8e227ce05ffa8f1ff0e..f84f269b005caddd38eb7849356c3f3a7f292d77 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;
                }