Skip to content

Commit

Permalink
virtio_blk: ioctl return value fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Rusty Russell committed Jul 17, 2009
1 parent 4eff3ca commit d9ecdea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d9ecdea

Please sign in to comment.