Re: [patch 1/2] mm: dont clear PG_uptodate in invalidate_complete_page2()

2 messages, 2 authors, 2008-06-25 · open the first message on its own page

Re: [patch 1/2] mm: dont clear PG_uptodate in invalidate_complete_page2()

From: Miklos Szeredi <miklos@szeredi.hu>
Date: 2008-06-25 15:30:01

quoted
Clearing the uptodate page flag will cause page_cache_pipe_buf_confirm()
to return -ENODATA if that page was in the buffer.  This in turn will cause
splice() to return a short or zero count.
I really think we should just change splice itself at this point.
We discussed this yesterday.  My conclusion was (which I still think
is true) that it can't be fixed in page_cache_pipe_buf_confirm(),
because due to current practice of not setting PG_error for I/O errors
for read, it is impossible to distinguish between a never-been-uptodate
page and a was-uptodate-before-invalidation page.

And it's not just an nfsd issue.  Userspace might also expect that if
a zero count is returned, that means it went beyond EOF, and not that
it should retry the splice, maybe it has better luck this time.

So no, this is not just a fuse/nfsd issue, it applies to all
filesystems that do invalidate_inode_pages2 (there are 4-5 of them I
think).

And I don't see what I would be ignoring.  This is _not_ about
truncate(2), that is shared by all filesystems, and bugs wrt splice
would affect not just fuse.

Miklos

--
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>

Re: [patch 1/2] mm: dont clear PG_uptodate in invalidate_complete_page2()

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2008-06-25 16:31:37

On Wed, 25 Jun 2008, Miklos Szeredi wrote:
We discussed this yesterday.  My conclusion was (which I still think
is true) that it can't be fixed in page_cache_pipe_buf_confirm(),
because due to current practice of not setting PG_error for I/O errors
for read, it is impossible to distinguish between a never-been-uptodate
page and a was-uptodate-before-invalidation page.
Umm. The regular read does this quite well. If something isn't up-to-date, 
it tries a synchronous read. Once.
And it's not just an nfsd issue.  Userspace might also expect that if
a zero count is returned, that means it went beyond EOF, and not that
it should retry the splice, maybe it has better luck this time.
You're totally ignoring the real issue - user space that uses splice() 
*knows* that it uses splice(). It's a private mmap(). 

NFSD, on the other hand, is supposed to act as NFSD. I think that 
currently it assumes that nobody else modifies the files, which is 
reasonable, but breaks with FUSE.

But do you see? That's a NFSD/FUSE issue, not a splice one!

		Linus

--
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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help