From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>,
sct@redhat.com, adilger@sun.com, linux-kernel@vger.kernel.org,
linux-ext4@vger.kernel.org, jack@suse.cz,
sugita <yumiko.sugita.yf@hitachi.com>,
Satoshi OSHIMA <satoshi.oshima.fk@hitachi.com>
Subject: Re: [RFC][PATCH] ext3: don't read inode block if the buffer has a write error
Date: Tue, 24 Jun 2008 13:17:22 +1000 [thread overview]
Message-ID: <200806241317.22470.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <alpine.LFD.1.10.0806231958010.2926@woody.linux-foundation.org>
On Tuesday 24 June 2008 13:01, Linus Torvalds wrote:
> On Mon, 23 Jun 2008, Andrew Morton wrote:
> > > I don't know why it was done like this, or if anybody actually tested
> > > any of it, but AFAIKS the best way to fix this is to simply not
> > > clear any uptodate bits upon write errors.
> >
> > There's a plausible-sounding reason for this behaviour which I forgot
> > about three years ago. Maybe Linus remembers?
>
> We have to drop the data at _some_ point. Maybe some errors are transient,
> but a whole lot aren't. Jank out your USB memory stick, and those writes
> will continue fail. So you can't just keep things dirty - and that also
> implies that the buffer sure as heck isn't up-to-date either.
Depends what semantics you want, I guess. I have the newest copy of the
data... yes you do unless you want to try to say that a write error to
the media somehow invalidates that fact.
> Yes, we could haev a "retry once or twice", but quite frankly, that has
> always been left to the low-level driver. By the time the buffer cache or
> page cache sees the error, it should be considered more than "transient",
> and the data in memory is simply not _useful_ any more.
It could be useful. For example if you have it mmapped (or even just
reading it back from pagecache) and working on it, then you really may
not want to lose all your program just because of the write error.
Keeping it around longer may allow you eg. to "save as something else".
Yes, we have to discard the page at some point, but I don't know if
this is the right place. Maybe a sysctl thing?
> So clearing the uptodate bit seems to be the logical thing to do. But on
> the other hand, it's probably not helping much either, so I don't
> personally care if we keep it "uptodate" - as long as the dirty bit
> doesn't get set, and as long as there is *some* way to get rid of the bad
> buffer later.
What you want to do is not insane, but the way it is currently being
done is. As I said, just clearing the uptodate bit might blow up your
kernel pretty quickly from assertions in the vm. It should be going
through the whole truncate or invalidate page machinery in order to
do that.
next prev parent reply other threads:[~2008-06-24 3:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-23 11:25 [RFC][PATCH] ext3: don't read inode block if the buffer has a write error Hidehiro Kawai
2008-06-23 11:46 ` Nick Piggin
2008-06-23 12:31 ` Jan Kara
2008-06-23 12:36 ` Nick Piggin
2008-06-24 2:17 ` Andrew Morton
2008-06-24 3:01 ` Linus Torvalds
2008-06-24 3:17 ` Nick Piggin [this message]
2008-06-24 3:42 ` Linus Torvalds
2008-06-24 13:03 ` Hidehiro Kawai
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=200806241317.22470.nickpiggin@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=adilger@sun.com \
--cc=akpm@linux-foundation.org \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=satoshi.oshima.fk@hitachi.com \
--cc=sct@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=yumiko.sugita.yf@hitachi.com \
/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