]> git.hungrycats.org Git - linux/commit
btrfs: stripe_alloc: give a queued stripe group a chunk to relocate into when the...
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Mon, 7 Sep 2026 11:33:59 +0000 (07:33 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Wed, 16 Sep 2026 21:40:05 +0000 (17:40 -0400)
commit499ca8fdf310bdf6f6a7119cd5c50adce2d6542f
tree8493b38de368a91fc5ef19c45f1a5ecc35e31890
parent7ed5cea7f8a0f2a2fd184f2ddfb9b02d85600c09
btrfs: stripe_alloc: give a queued stripe group a chunk to relocate into when the supply is short

A relocation data reservation never takes a ticket, so the flush state
machine never runs for it, and with it goes the chunk allocation every
other data reservation gets when its space_info is full.  That did not
show while other groups still had whole stripes.  Once the reclaim
worker had emptied and removed five of seven data groups, the two left
were the trapped ones it was queued to move next, their claimable
supply was under a megabyte, and every relocation failed with ENOSPC
while 2.6 GiB of the devices sat unallocated.

Have the reclaim worker allocate one chunk before it relocates a stripe
group whose live bytes exceed the claimable supply of the other groups.
An earlier version did this from the reservation path instead, for any
refused relocation reservation; that let a live device shrink -- which
relocates into space it does not have and is meant to fail cleanly at
that reservation -- grow the data space_info chunk by chunk until the
raid1 metadata had nowhere to go and the relocation aborted the
transaction in merge_reloc_roots() (6.18 acceptance suite T6).  The
worker is the one caller that should be making room.

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