]> git.ipfire.org Git - people/ms/linux.git/commitdiff
ext4: Mark the buffer_heads as dirty and uptodate after prepare_write
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sun, 16 Nov 2008 16:05:39 +0000 (11:05 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Dec 2008 18:55:45 +0000 (10:55 -0800)
(cherry picked from commit ed9b3e3379731e9f9d2f73f3d7fd9e7d2ce3df4a)

We need to make sure we mark the buffer_heads as dirty and uptodate
so that block_write_full_page write them correctly.

This fixes mmap corruptions that can occur in low memory situations.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/inode.c

index 4ec89d30d90ca941ce67cb44ee7203e48905f9a0..846a79096c25777a7f9543802a75d24693f220e2 100644 (file)
@@ -2242,6 +2242,8 @@ static int ext4_da_writepage(struct page *page,
                        unlock_page(page);
                        return 0;
                }
+               /* now mark the buffer_heads as dirty and uptodate */
+               block_commit_write(page, 0, PAGE_CACHE_SIZE);
        }
 
        if (test_opt(inode->i_sb, NOBH) && ext4_should_writeback_data(inode))