]> git.hungrycats.org Git - linux/commit
btrfs: stripe_alloc: keep the admitted bytes placeable when a group goes read-only
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sat, 5 Sep 2026 12:17:26 +0000 (08:17 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 18 Sep 2026 21:36:25 +0000 (17:36 -0400)
commit0ce8a7297983709a4a84ecead3c92d38c8f09d1f
tree7fedaaba7c3638ebc696243e675f006866349d6c
parent39b3a64d32e487c1a1b83a2d15ab71123f394eee
btrfs: stripe_alloc: keep the admitted bytes placeable when a group goes read-only

inc_block_group_ro() checks that the rest of the space_info can absorb
the group's free space in bytes.  Under stripe_alloc the data admission
gate promised writers whole stripes: bytes_may_use plus the held margin
against bytes_stripe_claimable.  Making a group read-only removes its
claimable stripes from that supply after the promise was made, so with
the reclaim worker relocating a group at the fill edge, admitted
writebacks found no stripe and were dropped:

  allocation failed flags 129, wanted 8192 ...
  space_info DATA has 450560 free, is full ... block group ... [readonly]

Refuse the read-only transition while the admitted bytes would no
longer fit in the claimable supply without this group.  Scrub, balance
and reclaim retry later; this is the fail-early direction and only bites
transiently at the edge, since bytes_may_use drains as writeback
completes.

Assisted-by: Claude:claude-fable-5
fs/btrfs/block-group.c