From: Mark Lord <lkml@rtr.ca>
To: akpm@osdl.org
Cc: James.Bottomley@steeleye.com, linux-scsi@vger.kernel.org
Subject: Re: [patch 02/25] drivers/scsi/sd.c: fix uninitialized variable in handling medium errors
Date: Fri, 02 Jun 2006 18:21:08 -0400 [thread overview]
Message-ID: <4480B9D4.60006@rtr.ca> (raw)
In-Reply-To: <200606020338.k523cAbw029209@shell0.pdx.osdl.net>
akpm@osdl.org wrote:
> From: Mark Lord <lkml@rtr.ca>
>
> When scsi_get_sense_info_fld() fails (returns 0), it does NOT update the
> value of first_err_block. But sd_rw_intr() merrily continues to use that
> variable regardless, possibly making incorrect decisions about retries and
> the like.
>
> This patch removes the randomness there, by using the first sector of the
> request (SCpnt->request->sector) in such cases, instead of first_err_block.
>
> Signed-off-by: Mark Lord <lkml@rtr.ca>
> Cc: James Bottomley <James.Bottomley@steeleye.com>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
By the way. I have a more complete fix for the root issue here now,
for an older SUSE-9 kernel (prepared for a client).
The problem with the current implementation, is that when a libata drive
(possibly also a USB2 or Firewire drive) hits a bad sector at block 50 of a 100
block request, SCSI will fail the first 50 blocks of that request,
in a very painfully slow fashion (it literally can take *hours* to complete).
Correct behaviour is to just fail the actual bad block. One method for doing this
is to walk over the failed request, issuing each block one at a time to the LLD,
and passing/failing them one at a time. This avoids failing "good" blocks,
while giving near-instant recovery from errors.
My patch for SUSE-9 does exactly that, with a minimum of fuss.
It would be good to see something like that implemented ASAP upstream,
and I'm sure that James (or Christoph) could code something like this
in their sleep. Or use my patch as a starting point if they're too busy.
Cheers
Mark Lord
prev parent reply other threads:[~2006-06-02 22:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-02 3:42 [patch 02/25] drivers/scsi/sd.c: fix uninitialized variable in handling medium errors akpm
2006-06-02 22:21 ` Mark Lord [this message]
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=4480B9D4.60006@rtr.ca \
--to=lkml@rtr.ca \
--cc=James.Bottomley@steeleye.com \
--cc=akpm@osdl.org \
--cc=linux-scsi@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).