LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: ltuikov@yahoo.com
Cc: mdr@sgi.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Infinite retries reading the partition table
Date: Tue, 5 Dec 2006 21:08:53 -0800	[thread overview]
Message-ID: <20061205210853.e2661207.akpm@osdl.org> (raw)
In-Reply-To: <794609.32071.qm@web31811.mail.mud.yahoo.com>

> On Tue, 5 Dec 2006 21:00:20 -0800 (PST) Luben Tuikov <ltuikov@yahoo.com> wrote:
> --- Michael Reed <mdr@sgi.com> wrote:
> > Luben Tuikov wrote:
> > ...snip...
> > > This statement in scsi_io_completion() causes the infinite retry loop:
> > >    if (scsi_end_request(cmd, 1, good_bytes, !!result) == NULL)
> > >          return;
> > 
> > The code in 2.6.19 is "result==0", not "!!result", which is logically
> > the same as "result!=0".  Did you mean to change the logic here?
> > Am I missing something?
> 
> Hmm, I think my trees have !!result from an earlier patch I posted.
> 
> In this case it would appear that the second chunk of the patch
> wouldn't be necessary, since result==0 would be false, and it
> wouldn't retry.
> 

I fixed things up.  The below is as-intended, yes?


diff -puN drivers/scsi/scsi_error.c~fix-sense-key-medium-error-processing-and-retry drivers/scsi/scsi_error.c
--- a/drivers/scsi/scsi_error.c~fix-sense-key-medium-error-processing-and-retry
+++ a/drivers/scsi/scsi_error.c
@@ -359,6 +359,11 @@ static int scsi_check_sense(struct scsi_
 		return SUCCESS;
 
 	case MEDIUM_ERROR:
+		if (sshdr.asc == 0x11 || /* UNRECOVERED READ ERR */
+		    sshdr.asc == 0x13 || /* AMNF DATA FIELD */
+		    sshdr.asc == 0x14) { /* RECORD NOT FOUND */
+			return SUCCESS;
+		}
 		return NEEDS_RETRY;
 
 	case HARDWARE_ERROR:
diff -puN drivers/scsi/scsi_lib.c~fix-sense-key-medium-error-processing-and-retry drivers/scsi/scsi_lib.c
--- a/drivers/scsi/scsi_lib.c~fix-sense-key-medium-error-processing-and-retry
+++ a/drivers/scsi/scsi_lib.c
@@ -871,7 +871,8 @@ void scsi_io_completion(struct scsi_cmnd
 	 * are leftovers and there is some kind of error
 	 * (result != 0), retry the rest.
 	 */
-	if (scsi_end_request(cmd, 1, good_bytes, result == 0) == NULL)
+	if (good_bytes &&
+	    scsi_end_request(cmd, 1, good_bytes, result == 0) == NULL)
 		return;
 
 	/* good_bytes = 0, or (inclusive) there were leftovers and
_


  reply	other threads:[~2006-12-06  5:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-30  1:22 Luben Tuikov
2006-12-01  5:47 ` Andrew Morton
2006-12-01  6:34   ` Luben Tuikov
2006-12-01  7:29     ` Andrew Morton
2006-12-01  8:32       ` Luben Tuikov
2006-12-05 20:40         ` Michael Reed
2006-12-06  5:00           ` Luben Tuikov
2006-12-06  5:08             ` Andrew Morton [this message]
2006-12-06  6:10               ` Luben Tuikov
2006-12-06 15:59               ` James Bottomley
2006-12-06 20:24                 ` Luben Tuikov
2006-12-07 18:16                   ` James Bottomley
2006-12-07 19:14                     ` Luben Tuikov
2006-12-07 21:15                       ` James Bottomley
2006-12-06 10:48       ` Etienne.Vogt
2006-11-30  1:53 Luben Tuikov

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=20061205210853.e2661207.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ltuikov@yahoo.com \
    --cc=mdr@sgi.com \
    --subject='Re: Infinite retries reading the partition table' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).