]> 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>
Wed, 16 Sep 2026 21:40:05 +0000 (17:40 -0400)
commitfc7452d545a72cd6827b59c4dcc0a288ba462188
tree06786decfc69e8b007b8cfb8f7c80b8458fef4c9
parent0ef5fa77a2825788e978a37bb5b6bf2aa1b90133
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