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