[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <18933.25293.145925.707478@notabene.brown>
Date: Mon, 27 Apr 2009 17:46:21 +1000
From: Neil Brown <neilb@...e.de>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Nick Piggin <npiggin@...e.de>,
David Woodhouse <dwmw2@...radead.org>
Subject: Re: [PATCH] Fix race between callers of read_cache_page_async and
invalidate_inode_pages.
On Sunday April 26, akpm@...ux-foundation.org wrote:
> On Mon, 27 Apr 2009 15:20:22 +1000 Neil Brown <neilb@...e.de> wrote:
>
> hrm. And where is it written that PageError() will remain inviolable
> after it has been set?
...it follows as night the day....
What use would PageError be if it can just disappear when you most
want to test it?
Then again, what use is PageUptodate if it can just disappear? My
other thought for fixing this was to change truncate_complete_page to
not clear PageUptodate.....
Oh. That's already been done in 2.6.27-rc2.
So I guess this isn't a bug in mainline anymore... sorry for the noise :-)
(I'll just go quietly fix some enterprise kernels).
>
> A safer and more formal (albeit somewhat slower) fix would be to lock
> the page and check its state under the lock.
>
> y:/usr/src/linux-2.6.30-rc3> grep -r ClearPageError . | wc -l
> 21
I think each of these do one of:
- clear the error after a successful read
- clear the error before a read attempt
- clear the error before a write
all (I think) while the page is locked. None of these would
invalidate the change I made. (and I still think that it would read
better to say
if (PageError(page))
goto error;
than
if (!PageUptodate(page))
goto error;
but no matter).
Thanks anyway.
NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists