Skip to contentSkip to conversation

scsi_debug: Do not respond to certain commands with CHECK CONDITION when sense pending

PATCH In review Ewan D. Milne 2 participants 2 messages Feb 15, 2013 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scsi_debug: Do not respond to certain commands with CHECK CONDITION when sense pending

From: "Ewan D. Milne" <[email protected]>

According to SPC, certain commands are not supposed to respond with a CHECK CONDITION due to a pending UNIT ATTENTION. This was causing failures when re-scanning a scsi_debug target. The commands in this category are INQUIRY and REPORT LUNS.

---
 drivers/scsi/scsi_debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/scsi_debug.c +2 -1
index 8a6bf31..48fd5a7 100644
@@ -4060,7 +4060,8 @@ write:
 		errsts = check_condition_result;
 		break;
 	}
-	if (!errsts && devip->sense_pending) {
+	if (!errsts && devip->sense_pending && (*cmd != INQUIRY) &&
+	    (*cmd != REPORT_LUNS)) {
 		devip->sense_pending = 0;
 		errsts = check_condition_result;
 	}
Signature · 1 line
1.7.11.7