From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: jamie@shareable.org, torvalds@linux-foundation.org,
jens.axboe@oracle.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
akpm@linux-foundation.org, hugh@veritas.com
Subject: Re: [patch 1/2] mm: dont clear PG_uptodate in invalidate_complete_page2()
Date: Mon, 7 Jul 2008 21:01:58 +1000 [thread overview]
Message-ID: <200807072101.58963.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <E1KFniG-0001cS-Rb@pomaz-ex.szeredi.hu>
On Monday 07 July 2008 20:12, Miklos Szeredi wrote:
> On Mon, 07 Jul 2008, Miklos Szeredi wrote:
> > On Mon, 7 Jul 2008, Nick Piggin wrote:
> > > I don't know what became of this thread, but I agree with everyone else
> > > you should not skip clearing PG_uptodate here. If nothing else, it
> > > weakens some important assertions in the VM. But I agree that splice
> > > should really try harder to work with it and we should be a little
> > > careful about just changing things like this.
> >
> > Sure, that's why I rfc'ed.
> >
> > But I'd still like to know, what *are* those assumptions in the VM
> > that would be weakened by this?
>
> For one, currently some of the generic VM code assumes that after
> synchronously reading in a page (i.e. ->readpage() then lock_page())
> !PageUptodate() necessarily means an I/O error:
Yes, the error paths in the vm/fs layer can be pretty crappy.
> /**
> * read_cache_page - read into page cache, fill it if needed
> ...
> * If the page does not get brought uptodate, return -EIO.
> */
>
> Which is wrong, the page could be invalidated between being broough
> uptodate and being examined for being uptodate. Then we'd be
> returning EIO, which is definitely wrong.
>
> AFAICS this could be a real (albeit rare) bug in NFS's readdir().
Actually this bug is known for a long time and exists in the
generic mapping read code too. And it doesn't even need to be
invalidated as such, but even truncated. It can be hard to get
people excited about "theoretical" bugs :(
> This is easily fixable in read_cache_page(), but what I'm trying to
> say is that assumptions about PG_uptodate aren't all that clear to
> begin with, so it would perhaps be useful to first think about this a
> bit more.
PG_uptodate should be set if we can return data to userspace
from it. I wouldn't worry about the error path bugs like this:
they should all be testing PG_error for -EIOness rather than
!PageUptodate. However I don't want to skip clearing PG_uptodate
in invalidate just yet if possible.
It seems to be a documented and known issue from day 0, so if
we can't see a really easy way to fix it without leave PG_uptodate
hanging around, can we put the burden on the callers to handle
the case correctly rather than put it on the VM to handle it?
(which we will then have to support for T < infinity)
And it isn't just a fuse problem is it? Other places can invalidate
and truncate pages which might be spliced into a pipe, can't they?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-07-07 11:01 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-25 12:40 [patch 0/2] splice: fix nfs export of fuse filesystems Miklos Szeredi
2008-06-25 12:40 ` [patch 1/2] mm: dont clear PG_uptodate in invalidate_complete_page2() Miklos Szeredi, Miklos Szeredi
2008-06-25 13:11 ` Evgeniy Polyakov
2008-06-25 13:32 ` Miklos Szeredi
2008-06-25 14:16 ` Evgeniy Polyakov
2008-06-25 14:41 ` Miklos Szeredi
2008-06-25 15:30 ` Evgeniy Polyakov
2008-06-25 15:59 ` Miklos Szeredi
2008-06-25 16:18 ` Evgeniy Polyakov
2008-06-25 15:47 ` Evgeniy Polyakov
2008-06-25 16:02 ` Miklos Szeredi
2008-06-25 16:19 ` Evgeniy Polyakov
2008-06-25 15:11 ` Linus Torvalds
2008-06-25 15:29 ` Miklos Szeredi
2008-06-25 16:30 ` Linus Torvalds
2008-06-25 16:42 ` Miklos Szeredi
2008-06-25 17:38 ` Jamie Lokier
2008-06-25 18:35 ` Miklos Szeredi
2008-07-07 6:38 ` Nick Piggin
2008-07-07 9:21 ` Miklos Szeredi
2008-07-07 10:12 ` Miklos Szeredi
2008-07-07 11:01 ` Nick Piggin [this message]
2008-07-07 12:03 ` Miklos Szeredi
2008-07-07 12:17 ` Nick Piggin
2008-07-07 12:52 ` Miklos Szeredi
2008-07-07 14:28 ` Nick Piggin
2008-07-07 15:08 ` Miklos Szeredi
2008-07-08 2:22 ` Nick Piggin
2008-07-07 10:43 ` Nick Piggin
2008-06-25 12:40 ` [patch 2/2] splice: fix generic_file_splice_read() race with page invalidation Miklos Szeredi, Miklos Szeredi
2008-06-25 13:00 ` 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=200807072101.58963.nickpiggin@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@linux-foundation.org \
--cc=hugh@veritas.com \
--cc=jamie@shareable.org \
--cc=jens.axboe@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=miklos@szeredi.hu \
--cc=torvalds@linux-foundation.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