From: Jens Axboe Date: Mon, 13 Nov 2006 17:04:59 +0000 (+0100) Subject: [PATCH] Fix bad data direction in SG_IO X-Git-Tag: v2.6.19-rc6~27 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=616e8a091a035c0bd9b871695f4af191df123caa;p=linux-2.6 [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 Signed-off-by: Linus Torvalds --- diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 2dc326421a..a19338e621 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, 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; }