Skip to content

Defrag fixes for v5.15

Qu Wenruo linux-btrfs stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: don't hold CPU for too long when defragging a filefs/btrfs/ioctl.c+1 -04 replies
2/2btrfs: defrag: use the same cluster size for defrag ioctl and autodefragfs/btrfs/ioctl.c+2 -72 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchDavid Sterba
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH for v5.15 0/2] Defrag fixes for v5.15

In v5.16 btrfs had a big rework (originally considered as a refactor only) on defrag, which brings quite some regressions.

With those regressions, extra scrutiny is brought to defrag code, and some existing bugs are exposed.

For v5.15, there are those patches need to be backported:
(Tracked through github issue:
https://github.com/btrfs/linux/issues/422)

- Already upstreamed:
"btrfs: don't hold CPU for too long when defragging a file" The first patch.

- In maintainer's tree
btrfs: defrag: don't try to merge regular extents with preallocated extents
btrfs: defrag: don't defrag extents which are already at max capacity
btrfs: defrag: remove an ambiguous condition for rejection

Those will be backported when they get merged upstream.

- One special fix for v5.15
The 2nd patch.

The problem is, that patch has no upstream commit, since v5.16 reworked the defrag code and fix the problem unintentionally. It's not a good idea to bring the whole rework (along with its bugs) to stable kernel.

So here I crafted a small fix for v5.15 only.

Not sure if this is conflicted with any stable policy.

Qu Wenruo (2):
btrfs: don't hold CPU for too long when defragging a file
btrfs: defrag: use the same cluster size for defrag ioctl and
autodefrag

 fs/btrfs/ioctl.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
Signature · 1 line
2.35.1