Skip to contentSkip to conversation

fix for scsi_unjam_host: Miscount of number of failed commands

PATCH In review Tony Battersby 2 participants 2 messages Nov 1, 2004 – Nov 7, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix for scsi_unjam_host: Miscount of number of failed commands

This is a resend of http://marc.theaimsgroup.com/?l=linux-scsi&m=108438814301446&w=2

This patch fixes a panic "scsi_unjam_host: Miscount of number of failed commands". This panic happens only under very specific circumstances:

1) A command fails with check condition
2) The low-level driver doesn't auto-retrieve the sense data
3) The sense key is "not ready" and ASC/ASCQ indicate the unit is becoming ready
4) A retry of the command fails in the same way

Please apply.

drivers/scsi/scsi_error.c +3 -1
diff -urN linux-2.4.28-pre3-vanilla/drivers/scsi/scsi_error.c linux-2.4.28-pre3-asp/drivers/scsi/scsi_error.c
@@ -1366,6 +1366,7 @@
 
 	for (SDpnt = host->host_queue; SDpnt; SDpnt = SDpnt->next) {
 		for (SCpnt = SDpnt->device_queue; SCpnt; SCpnt = SCpnt->next) {
+		      recheck_sense_valid:
 			if (SCpnt->state != SCSI_STATE_FAILED || scsi_sense_valid(SCpnt)) {
 				continue;
 			}
@@ -1402,7 +1403,8 @@
 			SCpnt->state = NEEDS_RETRY;
 			rtn = scsi_eh_retry_command(SCpnt);
 			if (rtn != SUCCESS) {
-				continue;
+				SCpnt->state = SCSI_STATE_FAILED;
+				goto recheck_sense_valid;
 			}
 			/*
 			 * We eventually hand this one back to the top level.

Anthony J. Battersby
Cybernetics

#1 lore raw
Quoted 10 lines · Tony Battersby

This is a resend of http://marc.theaimsgroup.com/?l=linux-scsi&m=108438814301446&w=2

This patch fixes a panic "scsi_unjam_host: Miscount of number of failed commands". This panic happens only under very specific circumstances:

1) A command fails with check condition
2) The low-level driver doesn't auto-retrieve the sense data
3) The sense key is "not ready" and ASC/ASCQ indicate the unit is becoming ready
4) A retry of the command fails in the same way

Tony,

I'm about to release 2.4.28-rc2 which should become final, I've queued your patches for 2.4.29-pre.

Thanks