1 Prevent endless loop in SCSI error handling.
2 Author: Borzenkov Andrey <Andrej.Borsenkow@mow.siemens.ru>
4 --- linux-2.4.18-18mdk/drivers/scsi/scsi_error.c.scsi-eh-timeout Thu May 30 16:22:37 2002
5 +++ linux-2.4.18-18mdk/drivers/scsi/scsi_error.c Sun Jun 9 19:18:11 2002
8 STATIC int scsi_eh_completed_normally(Scsi_Cmnd * SCpnt)
13 * First check the host byte, to see if there is anything in there
14 * that would indicate what we need to do.
15 @@ -1116,14 +1118,18 @@
16 * otherwise we just flag it as success.
18 SCpnt->flags &= ~IS_RESETTING;
23 * Rats. We are already in the error handler, so we now get to try
24 * and figure out what to do next. If the sense is valid, we have
25 * a pretty good idea of what to do. If not, we mark it as failed.
27 - return scsi_check_sense(SCpnt);
28 + rtn = scsi_check_sense(SCpnt);
29 + if (rtn == NEEDS_RETRY) {
34 if (host_byte(SCpnt->result) != DID_OK) {
36 @@ -1142,7 +1148,11 @@
37 case COMMAND_TERMINATED:
40 - return scsi_check_sense(SCpnt);
41 + rtn = scsi_check_sense(SCpnt);
42 + if (rtn == NEEDS_RETRY) {
47 case INTERMEDIATE_GOOD:
48 case INTERMEDIATE_C_GOOD:
49 @@ -1157,6 +1167,17 @@
56 + if ((++SCpnt->retries) < SCpnt->allowed) {
60 + * No more retries - report this one back to upper level.