From: FUJITA Tomonori Date: Thu, 16 Sep 2010 15:46:42 +0000 (+0900) Subject: bsg: fix incorrect device_status value X-Git-Tag: v2.6.33.8~443 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95e6f3cf39fc0d337c0f792af92a3347ceba3a3d;p=thirdparty%2Fkernel%2Fstable.git bsg: fix incorrect device_status value commit 478971600e47cb83ff2d3c63c5c24f2b04b0d6a1 upstream. bsg incorrectly returns sg's masked_status value for device_status. [jejb: fix up expression logic] Reported-by: Douglas Gilbert Signed-off-by: FUJITA Tomonori Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- diff --git a/block/bsg.c b/block/bsg.c index a9fd2d84b53a0..ae14805451a7b 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -425,7 +425,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr, /* * fill in all the output members */ - hdr->device_status = status_byte(rq->errors); + hdr->device_status = rq->errors & 0xff; hdr->transport_status = host_byte(rq->errors); hdr->driver_status = driver_byte(rq->errors); hdr->info = 0;