|
@@ -4902,6 +4902,8 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)
|
|
|
|
|
|
if (unlikely(minlen > EXT4_BLOCKS_PER_GROUP(sb)))
|
|
if (unlikely(minlen > EXT4_BLOCKS_PER_GROUP(sb)))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
+ if (start + len <= first_data_blk)
|
|
|
|
+ goto out;
|
|
if (start < first_data_blk) {
|
|
if (start < first_data_blk) {
|
|
len -= first_data_blk - start;
|
|
len -= first_data_blk - start;
|
|
start = first_data_blk;
|
|
start = first_data_blk;
|
|
@@ -4950,5 +4952,6 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)
|
|
}
|
|
}
|
|
range->len = trimmed * sb->s_blocksize;
|
|
range->len = trimmed * sb->s_blocksize;
|
|
|
|
|
|
|
|
+out:
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|