]> git.hungrycats.org Git - linux/commit
btrfs: stripe_alloc: let a data write fall back to the relocation group rather than...
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 6 Sep 2026 04:10:38 +0000 (00:10 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 18 Sep 2026 21:36:26 +0000 (17:36 -0400)
commit32d0c95fb87da18f934f57fa55346b1ae27c6e73
treea61b971c997b6ed9f1dc5ef04a9c5a557deb4769
parent6c67267e7cfc8549ee6121e6b70bd6ea58348322
btrfs: stripe_alloc: let a data write fall back to the relocation group rather than drop

Dedicating a group to relocation takes its claimable stripes away from
every other writer at once.  Admission stops counting them from then
on, but a write admitted a moment earlier against exactly those stripes
still has to be placed, and with the group hard-excluded it was not:
ten milliseconds after "relocating block group 2976120832" a 16K
writeback allocation returned ENOSPC and its data was dropped, the one
drop left in a fill-to-the-edge run under reclaim.  The read-only
transition has a guard for this; the dedication had none.

Keep the exclusion for the allocator's first passes and lift it once
the search reaches the chunk-allocation loop, i.e. only when no other
group can serve the write.  The class tag on the stripe runs already
guarantees the two sides never share a stripe, so the fallback costs
relocation a few stripes, not its correctness.  Zoned's hard exclusion
follows from append-only zones, which do not apply here.

Assisted-by: Claude:claude-fable-5
fs/btrfs/extent-tree.c