Re: [PATCH 2/2] btrfs: extent-tree: Ensure btrfs_trim_fs can trim the whole fs

2017-11-21 Thread Qu Wenruo
On 2017年11月21日 23:12, Filipe Manana wrote: > On Tue, Nov 21, 2017 at 7:21 AM, Qu Wenruo wrote: >> [BUG] >> fstrim on some btrfs only trims the unallocated space, not trimming any >> space in existing block groups. >> >> [CAUSE] >> fstrim_range passed in by default fstrim will be:

Re: [PATCH 2/2] btrfs: extent-tree: Ensure btrfs_trim_fs can trim the whole fs

2017-11-21 Thread Filipe Manana
On Tue, Nov 21, 2017 at 7:21 AM, Qu Wenruo wrote: > [BUG] > fstrim on some btrfs only trims the unallocated space, not trimming any > space in existing block groups. > > [CAUSE] > fstrim_range passed in by default fstrim will be: > > range->start = 0 > range->len = fs_size (which

Re: [PATCH 2/2] btrfs: extent-tree: Ensure btrfs_trim_fs can trim the whole fs

2017-11-21 Thread Qu Wenruo
On 2017年11月21日 15:41, Nikolay Borisov wrote: > > > On 21.11.2017 09:21, Qu Wenruo wrote: >> [BUG] >> fstrim on some btrfs only trims the unallocated space, not trimming any >> space in existing block groups. >> >> [CAUSE] >> fstrim_range passed in by default fstrim will be: >> >> range->start

Re: [PATCH 2/2] btrfs: extent-tree: Ensure btrfs_trim_fs can trim the whole fs

2017-11-20 Thread Nikolay Borisov
On 21.11.2017 09:21, Qu Wenruo wrote: > [BUG] > fstrim on some btrfs only trims the unallocated space, not trimming any > space in existing block groups. > > [CAUSE] > fstrim_range passed in by default fstrim will be: > > range->start = 0 > range->len = fs_size (which equals with

[PATCH 2/2] btrfs: extent-tree: Ensure btrfs_trim_fs can trim the whole fs

2017-11-20 Thread Qu Wenruo
[BUG] fstrim on some btrfs only trims the unallocated space, not trimming any space in existing block groups. [CAUSE] fstrim_range passed in by default fstrim will be: range->start = 0 range->len = fs_size (which equals with super->total_bytes) range->min_len = 512 However btrfs_trim_fs()