mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-06 10:49:18 -05:00
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]> Signed-off-by: Jan Kara <[email protected]>
This commit is contained in:
parent
81fe8c62fe
commit
2c2ea9451f
1 changed files with 1 additions and 3 deletions
|
|
@ -2108,7 +2108,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;
|
||||
|
||||
|
|
@ -2156,8 +2156,6 @@ int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range)
|
|||
|
||||
if (ret >= 0)
|
||||
ret = 0;
|
||||
|
||||
out:
|
||||
range->len = trimmed * sb->s_blocksize;
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue