summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorEryu Guan <guaneryu@gmail.com>2016-02-21 18:38:44 -0500
committerSasha Levin <sasha.levin@oracle.com>2016-04-18 08:49:16 -0400
commitd3b9f52c79ea65d9256e7a49a1c9c259bae2bd68 (patch)
tree523beabbf533f9638046757fe82e6bf84f2a80e5 /fs/ext4
parentd14fefe00f42efae8471b4f48674bc5b4e5ed999 (diff)
downloadlinux-stable-d3b9f52c79ea65d9256e7a49a1c9c259bae2bd68.tar.gz
linux-stable-d3b9f52c79ea65d9256e7a49a1c9c259bae2bd68.tar.bz2
linux-stable-d3b9f52c79ea65d9256e7a49a1c9c259bae2bd68.zip
ext4: iterate over buffer heads correctly in move_extent_per_page()
[ Upstream commit 87f9a031af48defee9f34c6aaf06d6f1988c244d ] In commit bcff24887d00 ("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: bcff24887d00 ("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 Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/move_extent.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index 165f309bafcc..f498c34b4688 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -397,6 +397,7 @@ data_copy:
*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);