public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "J.A. Magallon" <jamagallon@able.es>
To: linas@austin.ibm.com
Cc: lnz@dandelion.com, mike@i-connect.net, eric@andante.org,
	linux-kernel@vger.kernel.org, olh@suse.de, groudier@free.fr,
	axboe@suse.de, acme@conectiva.com.br, linas@linas.org
Subject: Re: Patches for SCSI timeout bug
Date: Wed, 4 Jun 2003 23:44:43 +0200	[thread overview]
Message-ID: <20030604214442.GI4939@werewolf.able.es> (raw)
In-Reply-To: <20030604163415.A41236@forte.austin.ibm.com>; from linas@austin.ibm.com on Wed, Jun 04, 2003 at 23:34:16 +0200


On 06.04, linas@austin.ibm.com wrote:
> 
> 
> Hi,
> 
> I've got a SCSI timeout bug in kernels 2.4 and 2.5, and several 
> different patches (appended) that fix it.  I'm not sure which way 
> of fixing it is best.
> 
[...]

Can you try with this:

--- linux-2.4.18-18mdk/drivers/scsi/scsi_error.c.scsi-eh-timeout	Thu May 30 16:22:37 2002
+++ linux-2.4.18-18mdk/drivers/scsi/scsi_error.c	Sun Jun  9 19:18:11 2002
@@ -1103,6 +1103,8 @@
  */
 STATIC int scsi_eh_completed_normally(Scsi_Cmnd * SCpnt)
 {
+	int rtn;
+
 	/*
 	 * First check the host byte, to see if there is anything in there
 	 * that would indicate what we need to do.
@@ -1116,14 +1118,18 @@
 			 * otherwise we just flag it as success.
 			 */
 			SCpnt->flags &= ~IS_RESETTING;
-			return NEEDS_RETRY;
+			goto maybe_retry;
 		}
 		/*
 		 * Rats.  We are already in the error handler, so we now get to try
 		 * and figure out what to do next.  If the sense is valid, we have
 		 * a pretty good idea of what to do.  If not, we mark it as failed.
 		 */
-		return scsi_check_sense(SCpnt);
+		rtn = scsi_check_sense(SCpnt);
+		if (rtn == NEEDS_RETRY) {
+			goto maybe_retry;
+		}
+		return rtn;
 	}
 	if (host_byte(SCpnt->result) != DID_OK) {
 		return FAILED;
@@ -1142,7 +1148,11 @@
 	case COMMAND_TERMINATED:
 		return SUCCESS;
 	case CHECK_CONDITION:
-		return scsi_check_sense(SCpnt);
+		rtn = scsi_check_sense(SCpnt);
+		if (rtn == NEEDS_RETRY) {
+			goto maybe_retry;
+		}
+		return rtn;
 	case CONDITION_GOOD:
 	case INTERMEDIATE_GOOD:
 	case INTERMEDIATE_C_GOOD:
@@ -1157,6 +1167,17 @@
 		return FAILED;
 	}
 	return FAILED;
+
+      maybe_retry:
+
+	if ((++SCpnt->retries) < SCpnt->allowed) {
+		return NEEDS_RETRY;
+	} else {
+                /*
+                 * No more retries - report this one back to upper level.
+                 */
+		return SUCCESS;
+	}
 }
 
 /*


-- 
J.A. Magallon <jamagallon@able.es>      \                 Software is like sex:
werewolf.able.es                         \           It's better when it's free
Mandrake Linux release 9.2 (Cooker) for i586
Linux 2.4.21-rc7-jam1 (gcc 3.3 (Mandrake Linux 9.2 3.3-1mdk))

  reply	other threads:[~2003-06-04 21:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-04 21:34 Patches for SCSI timeout bug linas
2003-06-04 21:44 ` J.A. Magallon [this message]
2003-06-04 22:20   ` linas
2003-06-05 16:58   ` linas
2003-06-06 18:41 ` Anton Blanchard
  -- strict thread matches above, loose matches on Subject: below --
2003-06-09 19:31 Perez-Gonzalez, Inaky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030604214442.GI4939@werewolf.able.es \
    --to=jamagallon@able.es \
    --cc=acme@conectiva.com.br \
    --cc=axboe@suse.de \
    --cc=eric@andante.org \
    --cc=groudier@free.fr \
    --cc=linas@austin.ibm.com \
    --cc=linas@linas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lnz@dandelion.com \
    --cc=mike@i-connect.net \
    --cc=olh@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox