aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-06-17 17:59:47 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-17 17:59:47 -0700
commit3cf8b87b608bccb0ed2e811f89930c66d355cc1f (patch)
treed97bd8d7cfeeee85710b9b2f7c183c9c8531d15f /mm
parent8d6d3943bb891439f71286ed4a86d4f698e93fc8 (diff)
downloadhistory-3cf8b87b608bccb0ed2e811f89930c66d355cc1f.tar.gz
[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: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/truncate.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/truncate.c b/mm/truncate.c
index 1dd32a204dfc17..c9a30ae6206b2e 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -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,10 +264,12 @@ 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);
}