Skip to contentSkip to conversation

bsg: return SAM device status code

PATCH Superseded Pete Wyckoff 2 participants 2 messages Feb 23, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bsg: return SAM device status code

Use the status codes from the standard, not the shifted-by-one codes that are marked deprecated in scsi.h. This makes bsg v4 status report the same value as sg v3 status too.

---
 block/bsg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block/bsg.c +1 -1
index c85d961..e39a321 100644
@@ -438,7 +438,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;
Signature · 1 line
1.4.4.2
#1 lore raw
Quoted 3 lines · Pete Wyckoff

Use the status codes from the standard, not the shifted-by-one codes that are marked deprecated in scsi.h. This makes bsg v4 status report the same value as sg v3 status too.

Pete,
Good pick up. We certainly don't want to re-introduce the SCSI status byte shift from the old days.

Doug Gilbert

Quoted 18 lines
---
 block/bsg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block/bsg.c +1 -1
index c85d961..e39a321 100644
@@ -438,7 +438,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;