Skip to content

Commit

Permalink
ext4: iterate over buffer heads correctly in move_extent_per_page()
Browse files Browse the repository at this point in the history
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>
Cc: stable@vger.kernel.org
  • Loading branch information
guaneryu authored and tytso committed Feb 21, 2016
1 parent f96c450 commit 87f9a03
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ext4/move_extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
*err = ext4_get_block(orig_inode, orig_blk_offset + i, bh, 0);
if (*err < 0)
break;
bh = bh->b_this_page;
}
if (!*err)
*err = block_commit_write(pagep[0], from, from + replaced_size);
Expand Down

0 comments on commit 87f9a03

Please sign in to comment.