From: Mark Lord <lkml@rtr.ca>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Mark Lord <liml@rtr.ca>, Norman Diamond <n0diamond@yahoo.co.jp>,
linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org
Subject: Re: Overagressive failing of disk reads, both LIBATA and IDE
Date: Sat, 21 Mar 2009 10:55:55 -0400 [thread overview]
Message-ID: <49C4FFFB.5000601@rtr.ca> (raw)
In-Reply-To: <1237645333.4600.9.camel@localhost.localdomain>
James Bottomley wrote:
> On Thu, 2009-03-19 at 23:32 -0400, Mark Lord wrote:
..
>> Allow SCSI to continue with the remaining blocks of a request
>> after encountering a media error. Otherwise, it may just fail
>> the entire request, even though some blocks were fine and needed
>> by a completely different process than the one that wanted the bad block(s).
>>
>> Signed-off-by: Mark Lord <mlord@pobox.com>
>>
>> --- linux-2.6.16.60-0.6/drivers/scsi/scsi_lib.c 2008-03-10 13:46:03.000000000 -0400
>> +++ linux/drivers/scsi/scsi_lib.c 2008-03-21 11:54:09.000000000 -0400
>> @@ -888,6 +888,12 @@
>> */
>> if (sense_valid && !sense_deferred) {
>> switch (sshdr.sense_key) {
>> + case MEDIUM_ERROR:
>> + /* Bad sector. Fail it, and then continue the rest of the request. */
>> + if (scsi_end_request(cmd, 0, cmd->device->sector_size, 1) == NULL) {
>> + cmd->retries = 0; // go around again..
>> + return;
>> + }
>
> But we've been over this. You can't apply something like this because
> it ignores retries and chunks up the request a sector at a time. For
> the enterprise that can increase failure time from a few seconds to
> hours for 512k transfers.
>
> Using the disk supplied data about where the error occurred (provided
> the disk returns it) eliminates all the readahead problems like the one
> above. Perhaps just turning of readahead for disks that don't supply
> error location information would be a reasonable workaround?
..
The patch *does* use the disk supplied data about the error,
and returns success for sectors up to that point. Where it differs
from mainline SCSI, is that it then continues attempting the remaining
2000 sectors (or whatever) of the request, hoping that not all of
them are bad.
It's not perfect, and likely no longer applies/works cleanly on the
latest kernels. And perhaps it really ought to fail a "block" rather
than a "sector" at a time as it seeks clean media after the fault.
I think it could be even more clever, using a binary search or something
on the remaining chunks, so that it takes less time to skip over a huge
stretch of sequential bad sectors (scratch on media). That would probably
be best all around.
Cheers
next prev parent reply other threads:[~2009-03-21 14:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-20 2:12 Overagressive failing of disk reads, both LIBATA and IDE Norman Diamond
2009-03-20 3:32 ` Mark Lord
2009-03-20 10:00 ` Andrew Morton
2009-03-20 13:09 ` Mark Lord
2009-03-21 14:22 ` James Bottomley
2009-03-21 14:55 ` Mark Lord [this message]
2009-03-21 15:01 ` Mark Lord
2009-03-21 15:08 ` James Bottomley
2009-03-21 15:20 ` Mark Lord
2009-03-21 15:10 ` Alan Cox
2009-03-21 15:18 ` James Bottomley
2009-03-22 2:15 ` Norman Diamond
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=49C4FFFB.5000601@rtr.ca \
--to=lkml@rtr.ca \
--cc=James.Bottomley@HansenPartnership.com \
--cc=liml@rtr.ca \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=n0diamond@yahoo.co.jp \
/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).