Skip to content

Commit

Permalink
btrfs: fail if fstrim_range->start == U64_MAX
Browse files Browse the repository at this point in the history
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 <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Josef Bacik authored and David Sterba committed Dec 8, 2021
1 parent d815b3f commit f981fec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -6051,6 +6051,9 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range)
int dev_ret = 0;
int ret = 0;

if (range->start == U64_MAX)
return -EINVAL;

/*
* Check range overflow if range->len is set.
* The default range->len is U64_MAX.
Expand Down

0 comments on commit f981fec

Please sign in to comment.