--- 25-akpm/mm/truncate.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff -puN mm/truncate.c~invalidate_inodes2-mark-pages-notuptodate mm/truncate.c --- 25/mm/truncate.c~invalidate_inodes2-mark-pages-notuptodate 2004-05-22 17:30:57.535651264 -0700 +++ 25-akpm/mm/truncate.c 2004-05-22 17:32:20.354060952 -0700 @@ -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 addr 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); } _