summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2014-04-18 16:43:21 +0200
committerTheodore Ts'o <tytso@mit.edu>2014-04-18 16:43:21 +0200
commit2c1d23289bc2f7cfa358bc856b87a992dcb11ad5 (patch)
tree9ad212ad5d9082eaac42beced6115a46c03c6818 /fs/ext4
parentext4: use filemap_write_and_wait_range() correctly in collapse range (diff)
downloadlinux-2c1d23289bc2f7cfa358bc856b87a992dcb11ad5.tar.xz
linux-2c1d23289bc2f7cfa358bc856b87a992dcb11ad5.zip
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: Lukas Czerner <lczerner@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/extents.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index f4a676908b0b..c6f624582d37 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -5454,7 +5454,7 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
ext4_discard_preallocations(inode);
ret = ext4_es_remove_extent(inode, punch_start,
- EXT_MAX_BLOCKS - punch_start - 1);
+ EXT_MAX_BLOCKS - punch_start);
if (ret) {
up_write(&EXT4_I(inode)->i_data_sem);
goto out_stop;