Commit 3cf8b87b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] invalidate_inodes2(): mark pages not uptodate

Andrea Arcangeli <andrea@suse.de> points out that invalidate_inode_pages2() is
supposed to mark mapped-into-pagetable pages as not uptodate so that next time
someone faults the page in we will go get a new version from backing store.

The callers are the direct-io code and the NFS "something changed on the
server" code.  In both these cases we do need to go and re-read the page.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8d6d3943
...@@ -243,6 +243,10 @@ EXPORT_SYMBOL(invalidate_inode_pages); ...@@ -243,6 +243,10 @@ EXPORT_SYMBOL(invalidate_inode_pages);
* where the page is seen to be mapped into process pagetables. In that case, * where the page is seen to be mapped into process pagetables. In that case,
* the page is marked clean but is left attached to its address_space. * the page is marked clean but is left attached to its address_space.
* *
* The page is also marked not uptodate so that a subsequent pagefault will
* perform I/O to bringthe page's contents back into sync with its backing
* store.
*
* FIXME: invalidate_inode_pages2() is probably trivially livelockable. * FIXME: invalidate_inode_pages2() is probably trivially livelockable.
*/ */
void invalidate_inode_pages2(struct address_space *mapping) void invalidate_inode_pages2(struct address_space *mapping)
...@@ -260,10 +264,12 @@ void invalidate_inode_pages2(struct address_space *mapping) ...@@ -260,10 +264,12 @@ void invalidate_inode_pages2(struct address_space *mapping)
if (page->mapping == mapping) { /* truncate race? */ if (page->mapping == mapping) { /* truncate race? */
wait_on_page_writeback(page); wait_on_page_writeback(page);
next = page->index + 1; next = page->index + 1;
if (page_mapped(page)) if (page_mapped(page)) {
clear_page_dirty(page); clear_page_dirty(page);
else ClearPageUptodate(page);
} else {
invalidate_complete_page(mapping, page); invalidate_complete_page(mapping, page);
}
} }
unlock_page(page); unlock_page(page);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment