Skip to content

Commit 6ffe77b

Browse files
guaneryutytso
authored andcommitted
ext4: iterate over buffer heads correctly in move_extent_per_page()
In commit bcff248 ("ext4: don't read blocks from disk after extents being swapped") bh is not updated correctly in the for loop and wrong data has been written to disk. generic/324 catches this on sub-page block size ext4. Fixes: bcff248 ("ext4: don't read blocks from disk after extentsbeing swapped") Signed-off-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 1e9d180 commit 6ffe77b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/ext4/move_extent.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
390390
*err = ext4_get_block(orig_inode, orig_blk_offset + i, bh, 0);
391391
if (*err < 0)
392392
break;
393+
bh = bh->b_this_page;
393394
}
394395
if (!*err)
395396
*err = block_commit_write(pagep[0], from, from + replaced_size);

0 commit comments

Comments
 (0)