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);
* 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 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.
*/
void invalidate_inode_pages2(struct address_space *mapping)
......@@ -260,11 +264,13 @@ void invalidate_inode_pages2(struct address_space *mapping)
if (page->mapping == mapping) { /* truncate race? */
wait_on_page_writeback(page);
next = page->index + 1;
if (page_mapped(page))
if (page_mapped(page)) {
clear_page_dirty(page);
else
ClearPageUptodate(page);
} else {
invalidate_complete_page(mapping, page);
}
}
unlock_page(page);
}
pagevec_release(&pvec);
......
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