the balance allocates after deleting the top chunk takes its exact
address, below the bound, and is relocated again on resume.
+ - balance-resume-convert-test.sh: a convert to dup, paused after the
+ top chunks were converted, with a chunk below the bound that already
+ had the dup profile at start. The resume must show no soft filter,
+ relocate every chunk below the bound once, the dup one included, and
+ none of the chunks the interrupted run converted (all at or above the
+ bound). On a kernel that still adds soft on resume, the dup chunk is
+ skipped and the test fails.
+
- remap-balance-resume-test.sh (remap-tree filesystems, misc-next
only): a METADATA_REMAP chunk placed above slow data chunks, a full
-d -m balance paused after the walk passed it, unmount, resume; the
filesystem needs an --enable-experimental btrfs-progs with a mkfs fix
for remap-tree to fix a NULL deref bug.
- - balance-resume-legacy-test.sh (patch 3 only): a data balance paused
- by a stock 6.12 kernel, then resumed on the patched kernel: the resume
- must use usage=90 and no vrange, and a balance started on the patched
- kernel must get the vrange and no usage filter.
+ - balance-resume-legacy-test.sh (patch 3 only): data balances paused
+ by a stock 6.12 kernel, then resumed on the patched kernel. A plain
+ item must resume with usage=90, a convert item with soft, neither
+ with a vrange; an item with a user-given vrange, converting or not,
+ must resume unchanged (no soft, no usage); a balance started on the
+ patched kernel must get the vrange and no usage filter.
Zygo Blaxell (3):
btrfs: free queued remap chunks when balance bails out
on its own with a vrange bound fixed at balance start (the next chunk
address), plus an in-memory chunk-allocation floor so that no chunk is
allocated below the bound while a balance item exists. Patch 3
-(optional) keeps usage=90 for balance items written by older kernels
-(no vrange). Patch 1 frees the METADATA_REMAP chunks queued on
+(optional) keeps the old resume filters (soft for a type being
+converted, else usage=90) for chunk types without a vrange, which only
+balance items written by older kernels lack; a type with a vrange is
+resumed unchanged. Since 2026-11-05 (Zygo: "If vrange is present then
+we should not make any other changes") patch 2 removes
+update_balance_args() entirely, so the soft filter a convert used to get
+on resume is gone too: the bound already keeps every chunk the
+interrupted run converted out of the range, and soft also skipped the
+chunks below the bound that had the target profile at start. Patch 1 frees the METADATA_REMAP chunks queued on
`__btrfs_balance()`'s local list when the walk bails out (pause, cancel,
errors). To verify: a paused and resumed balance must relocate exactly
the block groups that existed below the bound at the pause, each once,
including the >= 90% full ones that usage=90 would skip, and never a
chunk the interrupted run created; a legacy item must resume with
-usage=90; a bail-out with queued remap chunks must free every entry.
+usage=90 (soft for a convert), a legacy item with a vrange must resume
+unchanged, and a paused convert must resume without soft and relocate
+the target-profile chunks below the bound; a bail-out with queued remap
+chunks must free every entry.
Kernel under test for the "Current" column: misc-next zb64 568c45b64012
(uname 7.3.0-rc7+ #5, KASAN) unless a row says otherwise. Test logs are
changes the call-site filter and the test then fails as blind with fewer
than 2 allocations).
+## 2026-11-05 round (br1105: no resume changes when a vrange is present)
+
+Kernels: 6.18 zb64 d23f7c23cacd (#318, KASAN inline + lockdep +
+BTRFS_ASSERT, bzImage md5 7973bbc96916073e9f8779c9aeabd15b) on bhive and
+ahive; misc-next zb64 1fa7804a5147 (#67, same options, md5
+b92c061498a8129faf653f8365ab9a6a) on dhive and ehive. Negative controls
+on the previous lane kernels (6.18 #317 / #316, misc-next #66), whose
+patch 3 added soft for every converting type, vrange or not. Legacy
+items prepared by stock Debian 6.12.115 (ahive, for 6.18) and 6.12.90
+(ehive, for misc-next); every check ran on a sparse copy, so one prepare
+served the control and the candidate. Evidence:
+`raid56-wh-harness/forensics/br1105-618/`, `forensics/br1105-mn/`.
+
+| test | verifies | patch(es) | duration | result | kernel |
+|---|---|---|---|---|---|
+| `balance-resume-convert-test.sh` (new) | a paused `-dconvert=dup` resumes with convert + the stored bound and no soft; every chunk below the bound is relocated once, including the one that already had the dup profile at start; none of the chunks the interrupted run converted (at or above the bound) is relocated again; all data dup at the end | 2 (and 3: the vrange check gates soft) | 2 min | PASS x2 each on 6.18 #318 bhive, #318 ahive, misc-next #67 dhive, #67 ehive: "balance: resume -dconvert=dup,vrange=0..12110004224", 4 chunks below the bound relocated (dup 298844160 among them), the 2 converted chunks at 12110004224 and 13183746048 untouched | #318, #67 |
+| same, negative control | the detector sees the old behavior | - | 2 min | FAIL as expected on 6.18 #317 (bhive), #316 (ahive) and misc-next #66 (dhive): "balance: resume -dconvert=dup,soft,vrange=0..12110004224", and the dup chunk 298844160 below the bound was not relocated; every other assertion PASS | #317, #316, #66 |
+| `balance-resume-legacy-test.sh check plain` | legacy item: usage=90, no soft, no vrange | 3 | 1 min | PASS on #318 (ahive) and #67 (ehive); also PASS on #316 and #66 | #318, #67 |
+| `... check convert` (new variant) | legacy `-dconvert=dup` item: soft, no usage, no vrange | 3 | 1 min | PASS on #318 and #67 ("-dconvert=dup,soft"); also PASS on #316 and #66 | #318, #67 |
+| `... check vrange` (new variant) | legacy item with a user-given vrange=0..1099511627776: resumed unchanged (no usage, no soft) | 3 | 1 min | PASS on #318 and #67; also PASS on #316 and #66 (the old patch 3 already gated usage=90 on the vrange) | #318, #67 |
+| `... check convert-vrange` (new variant) | legacy `-dconvert=dup,vrange=0..1099511627776` item: no soft, no usage | 3 | 1 min | PASS on #318 and #67 ("-dconvert=dup,vrange=0..1099511627776"); **FAIL as expected on #316 and #66** ("-dconvert=dup,soft,vrange=...") | #318, #67 |
+| `balance-resume-test.sh`, `balance-resume-reuse-test.sh` | as above | 2 | 1 min each | PASS on #318 (bhive, ahive) and #67 (dhive, ehive) | #318, #67 |
+| `remap-balance-resume-test.sh`, `remap-balance-leak-test.sh` | as above | 1, 2 | 2 min each | PASS on #67 (dhive, ehive); SKIP on 6.18 (no remap tree: the kernel cannot mount the fs), as expected | #67 |
+
+Observation (not gated): the legacy vrange items resume with the
+chunk-allocation floor at the stored vend, so the resumed run allocates
+its chunks from 1 TiB up (highest chunk after the resume 1102732853248 /
+1104880336896, and the next balance's bound 1105954078720). Harmless at
+1 TiB; a user-given vrange end near U64_MAX would put the floor there.
+
## Not covered / open
- Patch 1's other bail-outs (cancel, chunk search or relocation errors,