提交 2c1d2328 编写于 作者: L Lukas Czerner 提交者: Theodore Ts'o

ext4: fix removing status extents in ext4_collapse_range()

Currently in ext4_collapse_range() when calling ext4_es_remove_extent() to
remove status extents we're passing (EXT_MAX_BLOCKS - punch_start - 1)
in order to remove all extents from start of the collapse range to the
end of the file. However this is wrong because we might miss the
possible extent covering the last block of the file.

Fix it by removing the -1.
Signed-off-by: NLukas Czerner <lczerner@redhat.com>
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: NNamjae Jeon <namjae.jeon@samsung.com>
上级 1a66c7c3
...@@ -5454,7 +5454,7 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len) ...@@ -5454,7 +5454,7 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
ext4_discard_preallocations(inode); ext4_discard_preallocations(inode);
ret = ext4_es_remove_extent(inode, punch_start, ret = ext4_es_remove_extent(inode, punch_start,
EXT_MAX_BLOCKS - punch_start - 1); EXT_MAX_BLOCKS - punch_start);
if (ret) { if (ret) {
up_write(&EXT4_I(inode)->i_data_sem); up_write(&EXT4_I(inode)->i_data_sem);
goto out_stop; goto out_stop;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册