Re: [PATCH] btrfs: Fix off-by-one error btrfs_trim_free_extents

2019-04-24 Thread David Sterba
On Wed, Apr 24, 2019 at 11:46:55AM +0300, Nikolay Borisov wrote: > btrfs_trim_free_extents always caps the range it's going to trim based > on the size of the device. This happens if find_first_clear_extent_bit > detects that untrimmed range is past the last allocated range. Since it > doesn't have

[PATCH] btrfs: Fix off-by-one error btrfs_trim_free_extents

2019-04-24 Thread Nikolay Borisov
btrfs_trim_free_extents always caps the range it's going to trim based on the size of the device. This happens if find_first_clear_extent_bit detects that untrimmed range is past the last allocated range. Since it doesn't have knowledge of the size of the device it just returns (u64)-1 for end. The