]> git.hungrycats.org Git - linux/commit
btrfs: track balance progress with virtual address range misc-next/topics/balance-resume
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Wed, 16 Sep 2026 06:29:10 +0000 (02:29 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 18 Sep 2026 21:36:15 +0000 (17:36 -0400)
commite1437f21b3123c9808524738d365db2a3fe4b81b
tree899bf501c7c0cb8641c797cd02cf9bac513ed950
parent1397021ba66f3c04ce85760af47d0cd7f52f7d4b
btrfs: track balance progress with virtual address range

The usage=90 heuristic applied when resuming a balance can change the
set of block groups selected by the original request.  In particular, it
can skip full block groups that have not been considered yet.

The chunk tree is scanned in descending virtual address order.  Record
that progress by reducing the upper bound of the vrange filter after each
chunk is considered.  Create a 0..current-address range when the original
balance did not have a vrange filter.

Write the cursor back to the balance item during transaction commits, as
with device stats and device-replace progress.  Keep the original limit
and other filters intact.  Commit on pause so progress survives unmount
or a read-only remount even without another transaction.

Assisted-by: Codex:gpt-5
fs/btrfs/transaction.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h