From: Aneesh Kumar K.V Date: Sun, 16 Nov 2008 16:05:39 +0000 (-0500) Subject: ext4: Mark the buffer_heads as dirty and uptodate after prepare_write X-Git-Tag: v2.6.27.8~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7cd10cb101e006e5beb4f3da3826727ed5ef85f8;p=thirdparty%2Fkernel%2Fstable.git ext4: Mark the buffer_heads as dirty and uptodate after prepare_write (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 Signed-off-by: "Theodore Ts'o" Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 4ec89d30d90ca..846a79096c257 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -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))