Skip to content

Commit

Permalink
ext4: Mark the buffer_heads as dirty and uptodate after prepare_write
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aneesh Kumar K.V authored and Theodore Ts'o committed Nov 7, 2008
1 parent ac51d83 commit ed9b3e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit ed9b3e3

Please sign in to comment.