virtio_blk: ioctl return value fix
authorChristoph Hellwig <hch@lst.de>
Sat, 20 Jun 2009 19:29:41 +0000 (21:29 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 17 Jul 2009 12:17:46 +0000 (21:47 +0930)
Block driver ioctl methods must return ENOTTY and not -ENOIOCTLCMD if
they expect the block layer to handle generic ioctls.

This triggered a BLKROSET failure in xfsqa #200.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/block/virtio_blk.c

index 4c47859ad8b11955cbfd35013d6fddf503046e37..fbeefb68a31fc6f9d65509a9552b9d7003af3489 100644 (file)
@@ -213,7 +213,7 @@ static int virtblk_ioctl(struct block_device *bdev, fmode_t mode,
         * Only allow the generic SCSI ioctls if the host can support it.
         */
        if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI))
-               return -ENOIOCTLCMD;
+               return -ENOTTY;
 
        return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp);
 }