]> git.hungrycats.org Git - linux/commit
btrfs: stripe_meta: do not steal from the global reserve below the relocation reserve
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 6 Sep 2026 05:14:43 +0000 (01:14 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 18 Sep 2026 21:36:27 +0000 (17:36 -0400)
commitc1b6a78ece630d658d0043370c584fd18f938d14
treeec3547c428deed45e0a06ca1ad8ba933ae366808
parentfd34780bdf50f615b0ad228b5f3487b1d17d5c5b
btrfs: stripe_meta: do not steal from the global reserve below the relocation reserve

With the whole-stripe reserve in place the fill stopped cleanly at the
edge: 374 MiB claimable, the reserve plus margin plus the outstanding
reservations, no canary, no abort.  Then the test deleted half of its
tiny files, and every unlink that the gate refused came back through
the global reserve steal, which does not look at stripes.  Deleting an
inline file is pure COW churn under stripe_meta: it frees no stripe,
since the leaf it lived in stays, and each transaction of unlinks takes
fresh stripes.  Metadata used did not move by a megabyte while the
claimable supply went from 374 MiB to zero, and the next commit aborted
with the canary ("claimable 0 open 1490944 trapped 1506082816").

Refuse the steal once the claimable supply is down to the relocation
reserve plus the claim margin.  The unlink fails with ENOSPC, which is
recoverable, instead of the abort, which is not, and the reserve stays
with the background relocation that is the only thing that turns
trapped space back into whole stripes.

Assisted-by: Claude:claude-fable-5
fs/btrfs/space-info.c