ext3: Return -EINVAL when start is beyond the end of fs in ext3_trim_fs()
PATCH 1/1 ext3: Return -EINVAL when start is beyond the end of fs in ext3_trim_fs()
We should return -EINVAL when the FITRIM parameters are not sane, but currently we are exiting silently if start is beyond the end of the file system. This commit fixes this so we return -EINVAL as other file systems do.
Signed-off-by Lukas Czerner <[email protected]>
CC Jan Kara <[email protected]>
--- fs/ext3/balloc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext3/balloc.c +1 -1
@@ -2100,7 +2100,7 @@ int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range)if (unlikely (minlen >EXT3_BLOCKS_PER_GROUP (sb)))return -EINVAL ;if (start >= max_blks) - goto out; +return -EINVAL ;if (start + len > max_blks) len = max_blks - start;
Signature · 1 line
1.7.4.4
Quoted 4 lines · Lukas Czerner
We should return
-EINVALwhen the FITRIM parameters are not sane, but currently we are exiting silently if start is beyond the end of the file system. This commit fixes this so we return-EINVALas other file systems do.
Thanks. Merged.
Honza
Quoted 23 lines
Signed-off-by Lukas Czerner <[email protected]>CC Jan Kara <[email protected]>--- fs/ext3/balloc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)fs/ext3/balloc.c +1
-1@@ -2100,7 +2100,7 @@ int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range)if (unlikely (minlen >EXT3_BLOCKS_PER_GROUP (sb)))return -EINVAL ;if (start >= max_blks) - goto out; +return -EINVAL ;if (start + len > max_blks) len = max_blks - start;Signature · 1 line
1.7.4.4
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR