From: Aneesh Kumar K.V Date: Fri, 7 Nov 2008 14:06:45 +0000 (-0500) Subject: ext4: Mark the buffer_heads as dirty and uptodate after prepare_write X-Git-Tag: v2.6.28-rc4~21^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ed9b3e3379731e9f9d2f73f3d7fd9e7d2ce3df4a;p=linux-2.6-omap-h63xx.git ext4: Mark the buffer_heads as dirty and uptodate after prepare_write 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" --- diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 5a130b56f1c..be21a5ae33c 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2329,6 +2329,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))