VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / mm / truncate.c
index 1dd32a2..c9a30ae 100644 (file)
@@ -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);
                }