From: torvalds@transmeta.com (Linus Torvalds)
To: linux-kernel@vger.kernel.org
Subject: Re: hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }
Date: Thu, 27 Dec 2001 17:46:43 +0000 (UTC) [thread overview]
Message-ID: <a0fmq3$ujs$1@penguin.transmeta.com> (raw)
In-Reply-To: <20011227155403.A1730@suse.de> <E16JdbY-00061d-00@the-village.bc.nu> <20011227175105.E1730@suse.de>
In article <20011227175105.E1730@suse.de>, Jens Axboe <axboe@suse.de> wrote:
>On Thu, Dec 27 2001, Alan Cox wrote:
>> > retries belong at the low level, once you pass up info of failure to the
>> > upper layers it's fatal. time for FS to shut down.
>>
>> Thats definitely not the case. Just because your file system is too dumb to
>> use the information please don't assume everyone elses isnt - in fact one
>> of the side properties of Daniel Phillips stuff is that it should be able
>> to sanely handle a bad block problem.
>
>That's ok too, the fs can do whatever it wants in case of I/O failure.
>It's not up to the fs to reissue failed requests, _that's_ stupid.
Actually, I really think we should move the failure recovery up to the
filesystem: we can fairly easily do it already today, as basically very
few of the filesystems actually do the requests directly, but instead
rely on helper functions like "bread()" and "generic_file_read()".
Moving error handling up has a lot of advantages:
- it simplifies the (often fragile) lower layers, and moves common
problems to common code instead of putting it at a low level and
duplicating it across different drivers.
- it allows "context-sensitive" handling of errors, ie if there is a
read error on a read-ahead request the upper layers can comfortably
just say "f*ck it, I don't need it yet", which can _seriously_ help
interactive feel on bad mediums (right now we often try to re-read
a failing sector tens of times, because we re-read it during
read-ahead several times, and the lower layers re-read it _too_).
In fact, it would even be mostly _simple_ to do it at a higher level, at
least for reads.
Writes are somewhat harder, mainly because the upper layers have never
had to handle re-issuing of requests, and don't really have the state
information.
For reads, sufficient state information is already there ("uptodate" bit
- just add a counter for retries), but for writes we only have the dirty
bit that gets cleared when the request gets sent off. So for writes
we'd need to add a new bit ("write in progress", and then clear it on
successful completion, and set the "dirty" bit again on error).
So I'd actually _like_ for all IO requests to be clearly "try just
once", and it being up to th eupper layers to retry on error.
(The notion of timeouts are much harder - the upper layers can retry on
errors, but I really don't think that the upper layers want to handle
timeouts and the associated "cancel this request" issues. So low layers
would still have to do _that_ part of error recovery, but at least they
wouldn't have to worry about keeping the request around until it is
successful).
Does anybody see any really fundamental problems with moving retrying to
_above_ ll_rw_block.c instead of below it?
(And once it is above, you can much more easily support filesystems that
can automatically remap blocks on IO failure etc, and even have
interruptible block filesystem mounts for those pesky bad media problems
- allowing user level to tell the kernel to not screw around too much
with errors and just return them early to user space).
Linus
next prev parent reply other threads:[~2001-12-27 17:49 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-06 6:13 hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error } Daniel Stodden
2001-12-06 6:55 ` Sven.Riedel
2001-12-06 15:04 ` Matthias Andree
2001-12-23 7:24 ` Andre Hedrick
2001-12-23 7:53 ` Andrew Morton
2001-12-22 20:25 ` T. A.
2001-12-23 11:18 ` Peter Osterlund
2001-12-23 13:31 ` Alan Cox
2001-12-23 22:08 ` Andre Hedrick
2001-12-27 14:54 ` Jens Axboe
2001-12-27 16:42 ` Alan Cox
2001-12-27 16:51 ` Jens Axboe
2001-12-27 17:46 ` Linus Torvalds [this message]
2001-12-27 18:32 ` Andre Hedrick
2001-12-27 21:15 ` Legacy Fishtank
2001-12-27 17:50 ` Alan Cox
2001-12-28 2:05 ` Andre Hedrick
2001-12-28 10:59 ` Jens Axboe
2001-12-28 12:29 ` Rik van Riel
2001-12-28 12:33 ` Jens Axboe
2001-12-28 13:00 ` Jens Axboe
2001-12-28 19:30 ` Peter Osterlund
2001-12-29 15:07 ` Jens Axboe
2001-12-28 20:23 ` Andre Hedrick
2001-12-29 14:15 ` Jens Axboe
2001-12-29 20:58 ` You WIN Andre Hedrick
2001-12-31 12:58 ` Jens Axboe
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='a0fmq3$ujs$1@penguin.transmeta.com' \
--to=torvalds@transmeta.com \
--cc=linux-kernel@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