aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-03-30 15:05:45 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2005-09-06 18:19:23 -0400
commite47373ec1c9aab9ee134f4e2b8249957e9f4c7ef (patch)
treee6f630c08223f71d1cbb502213503404ec65d86f /drivers/scsi/scsi_error.c
parent4dddbc26c3895ecdab1f4b16435685b47f96f599 (diff)
[SCSI] return success after retries in scsi_eh_tur
The problem lies in the way the error handler uses TEST UNIT READY to tell whether error recovery has succeeded. The scsi_eh_tur function gives up after one round of retrying; after that it decides that more error recovery is needed. However TUR is liable to report sense data indicating a retry is needed when in fact error recovery has succeeded. A typical example might be SK=2, ASC=4, ASCQ=1 (Logical unit in process of becoming ready). The mere fact that we were able to get a sensible reply to the TUR should indicate that the device is working well enough to stop error recovery. I ran across a case back in January where this happened. A CD-ROM drive timed out the INQUIRY command, and a device reset fixed the blockage. But then the drive kept responding with 2/4/1 -- because it was spinning up I suppose -- until the error handler gave up and placed it offline. If the initial INQUIRY had received the 2/4/1 instead, everything would have worked okay. It doesn't seem reasonable for things to fail just because the error handler had started running. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index e9c451ba71fc..688bce740786 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -776,9 +776,11 @@ retry_tur:
776 __FUNCTION__, scmd, rtn)); 776 __FUNCTION__, scmd, rtn));
777 if (rtn == SUCCESS) 777 if (rtn == SUCCESS)
778 return 0; 778 return 0;
779 else if (rtn == NEEDS_RETRY) 779 else if (rtn == NEEDS_RETRY) {
780 if (retry_cnt--) 780 if (retry_cnt--)
781 goto retry_tur; 781 goto retry_tur;
782 return 0;
783 }
782 return 1; 784 return 1;
783} 785}
784 786