ext4: Fix filesystem corruption on FS mounted with delalloc From: Valerie Clement This patch fixes a filesystem corruption issue when the filesystem is mounted with the delalloc option and blocksize < pagesize. In the mpage_put_bnr_to_bhs() function, when skipping the first blocks at the beginning of the first page, pblock should not be incremented, otherwise the last blocks are corrupted. When writing into blocks at the end of a group, the first blocks of the following group can be corrupted. In that case, we've got the error message below: EXT4-fs error (device sdc1): ext4_valid_block_bitmap: Invalid block bitmap - block_group = 6233, block = 51060737 (Issue found when using fsstress tool on ext4 FS with 1K blocksize) Signed-off-by: Valerie Clement Signed-off-by: Mingming Cao --- fs/mpage.c | 1 - 1 file changed, 1 deletion(-) Index: linux-2.6.26-rc1/fs/mpage.c =================================================================== --- linux-2.6.26-rc1.orig/fs/mpage.c 2008-05-05 17:10:15.000000000 -0700 +++ linux-2.6.26-rc1/fs/mpage.c 2008-05-05 17:10:16.000000000 -0700 @@ -844,7 +844,6 @@ static void mpage_put_bnr_to_bhs(struct if (cur_logical >= logical) break; cur_logical++; - pblock++; } while ((bh = bh->b_this_page) != head); do {