[lkml]   [2000]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: page->mapping == 0
Paul Mackerras wrote:
> I am not any kind of expert on the page cache but it seems to me that
> maybe after locking the page we should check if it is still the page
> we want (i.e. page->mapping and page->index are still correct), and go
> back and look up the page again if not. Presumably there will be
> quite a few places besides do_generic_file_read where that check would
> be needed also.

I'm getting at least some kind of clue about the page cache, though I
don't claim to be an expert. You've pointed out how the operation of
becoming a reader on a page can fail because the page disappears while
you're waiting. That's an error, right? It's the result of a user
space race, which in turn is the result of parallel processes doing
nonatomic file operations with no synchronization. It sounds like
bailing out of the file_read if the page turns out to be unmapped after
the lock is the right thing to do, at least for a quick fix.

There actually aren't that many places where lock_page is called:;i=lock_page

Maybe lock_page needs to return an error code.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:45    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean