linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/3] btrfs: fixes for defrag_check_next_extent()
@ 2022-01-28  7:21 Qu Wenruo
  2022-01-28  7:21 ` [PATCH v4 1/3] btrfs: defrag: don't try to merge regular extents with preallocated extents Qu Wenruo
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Qu Wenruo @ 2022-01-28  7:21 UTC (permalink / raw)
  To: linux-btrfs

That function is reused between older kernels (v5.15) and the refactored
defrag code (v5.16+).

However that function has one long existing bugs affecting defrag to
handle preallocated range.

And it can not handle compressed extent well neither.

Finally there is an ambiguous check which doesn't make much sense by
itself, and can be related by enhanced extent capacity check.

This series will fix all the 3 problem mentioned above.

Changelog:
v2:
- Use @extent_thresh from caller to replace the harded coded threshold
  Now caller has full control over the extent threshold value.

- Remove the old ambiguous check based on physical address
  The original check is too specific, only reject extents which are
  physically adjacent, AND too large.
  Since we have correct size check now, and the physically adjacent check
  is not always a win.
  So remove the old check completely.

v3:
- Split the @extent_thresh and physicall adjacent check into other
  patches

- Simplify the comment 

v4:
- Fix the @em usage which should be @next.
  As it will fail the submitted test case.

Qu Wenruo (3):
  btrfs: defrag: don't try to merge regular extents with preallocated
    extents
  btrfs: defrag: don't defrag extents which is already at its max
    capacity
  btrfs: defrag: remove an ambiguous condition for rejection

 fs/btrfs/ioctl.c | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-02-14 18:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-28  7:21 [PATCH v4 0/3] btrfs: fixes for defrag_check_next_extent() Qu Wenruo
2022-01-28  7:21 ` [PATCH v4 1/3] btrfs: defrag: don't try to merge regular extents with preallocated extents Qu Wenruo
2022-01-28 11:50   ` Filipe Manana
2022-01-28  7:21 ` [PATCH v4 2/3] btrfs: defrag: don't defrag extents which is already at its max capacity Qu Wenruo
2022-02-01 15:03   ` David Sterba
2022-02-02  0:05     ` Qu Wenruo
2022-01-28  7:21 ` [PATCH v4 3/3] btrfs: defrag: remove an ambiguous condition for rejection Qu Wenruo
2022-01-28 12:17 ` [PATCH v4 0/3] btrfs: fixes for defrag_check_next_extent() Filipe Manana
2022-01-28 12:38   ` Qu Wenruo
2022-01-28 12:43     ` Filipe Manana
2022-01-28 12:45       ` Qu Wenruo
2022-01-28 21:54 ` David Sterba
2022-02-14 18:23   ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).