hugetlbfs: dirty pages as they are added to pagecache
[muen/linux.git] / mm / hugetlb.c
index 5c390f5a5207b5c0b4d1d55524d2f655c7edcae1..7b5c0ad9a6bd03909885334877a33f363c007b80 100644 (file)
@@ -3690,6 +3690,12 @@ int huge_add_to_page_cache(struct page *page, struct address_space *mapping,
                return err;
        ClearPagePrivate(page);
 
+       /*
+        * set page dirty so that it will not be removed from cache/file
+        * by non-hugetlbfs specific code paths.
+        */
+       set_page_dirty(page);
+
        spin_lock(&inode->i_lock);
        inode->i_blocks += blocks_per_huge_page(h);
        spin_unlock(&inode->i_lock);