Skip to content

Commit f981fec

Browse files
josefbacikkdave
authored andcommitted
btrfs: fail if fstrim_range->start == U64_MAX
We've always been failing generic/260 because it's testing things we actually don't care about and thus won't fail for. However we probably should fail for fstrim_range->start == U64_MAX since we clearly can't trim anything past that. This in combination with an update to generic/260 will allow us to pass this test properly. Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent d815b3f commit f981fec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/btrfs/extent-tree.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6051,6 +6051,9 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range)
60516051
int dev_ret = 0;
60526052
int ret = 0;
60536053

6054+
if (range->start == U64_MAX)
6055+
return -EINVAL;
6056+
60546057
/*
60556058
* Check range overflow if range->len is set.
60566059
* The default range->len is U64_MAX.

0 commit comments

Comments
 (0)