]> git.hungrycats.org Git - linux/commitdiff
allocator-hints: DATA_ONLY and METADATA_ONLY space results (hs1112); cover says which...
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Thu, 12 Nov 2026 23:20:34 +0000 (18:20 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Thu, 12 Nov 2026 23:20:34 +0000 (18:20 -0500)
TESTING.md: four rows and the arm descriptions for dataonly/metaonly on
misc-next and 6.18 with negative controls; the closed space-estimate
entry notes the two hints confirmed fixed; a new open item for a hint
change not clearing space_info->full.  Cover: patch 12 paragraph splits
the effect by hint (DATA_ONLY/NONE_ONLY lose acked data, METADATA_ONLY
only df Avail) and the reproducer covers both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
topics/allocator-hints/0000-cover-letter.patch
topics/allocator-hints/TESTING.md

index 827ff2d865255adb6db82d685fb3973f9b1d5fc9..baeff8431697a5b733f9049c723c190109db2c0d 100644 (file)
@@ -44,13 +44,16 @@ Patch 12 makes the available space estimates honor the hints.  The
 allocator keeps data off METADATA_ONLY and NONE_ONLY devices and
 metadata off DATA_ONLY and NONE_ONLY devices, but the per-profile
 estimate behind metadata overcommit, and statfs, counted every device.
-With raid1 on 6, 3 and 6 GiB devices and the third NONE_ONLY, filling
-the filesystem aborted the transaction with ENOSPC and forced it
-read-only, while statfs still offered 3 GiB.  The patch shares the hint
-rules between the allocator and the estimates, which are kept separately
-for data and metadata.  With it the same fill ends in a clean ENOSPC.
-In statfs only f_bavail (df Avail) changes; f_blocks and f_bfree (df
-Size and Used) still count every device.
+With a DATA_ONLY or NONE_ONLY device, metadata overcommits against
+chunks that cannot be allocated: once the other devices are full the
+transaction aborts with ENOSPC, the filesystem goes read-only, and
+writes that had returned success but were not yet committed are lost.
+With a METADATA_ONLY device nothing is lost, because data reservations
+never overcommit and the write fails with ENOSPC; only df Avail is too
+high.  The patch shares the hint rules between the allocator and the
+estimates, which are kept separately for data and metadata.  In statfs
+only f_bavail (df Avail) changes; f_blocks and f_bfree (df Size and
+Used) still count every device.
 
 To reproduce: make raid1 data and metadata on 6, 3 and 6 GiB devices,
 set the third to NONE_ONLY and run a full balance so it holds no
@@ -58,10 +61,13 @@ chunks.  Write 64 MiB files until ENOSPC, then create 2000-byte files
 from four writers until each gets ENOSPC, sync, balance the metadata,
 remount and read everything back.  Without the patch the metadata fill
 aborts the transaction and the files created since the last commit are
-lost; with it the fill ends in ENOSPC and every file reads back.  A
-control filesystem with the same usable space but no third device and
-no hints already ends cleanly.  Kai, this patch doubles as the bug
-report for your series.
+lost; with it the fill ends in ENOSPC and every file reads back.
+Switching the third device to DATA_ONLY after the data fill gives the
+same abort and loss.  With the third device METADATA_ONLY instead, the
+data fill ends in a clean ENOSPC either way, but without the patch df
+Avail still shows 2.7 GiB.  A control filesystem with the same usable
+space but no third device and no hints already ends cleanly.  Kai, this
+patch doubles as the bug report for your series.
 
 Changes for the current base: btrfs_update_device() is already
 non-static upstream (the prototype is not re-added), and
index bfc5a4c24faa0542194b6ce98c4e2c73584b4f67..f104f795f01e181d8f062b4521a7e7d13bb6a292 100644 (file)
@@ -134,6 +134,10 @@ free-space-cache.c / tree-log.c frame sizes (KASAN) and stripe_whole_bytes.
 | `alloc-hints-space-test.sh` | the same | | 7 min | **PASS** both arms: no abort, all files (98063 / 98057), statfs 31 / 55 MiB | 2026-10-18 | 6.18 candidate zb64 5d94450c26ba (bhive 6.18.57+ #2, md5 ad019627) | 8912994 | harness `forensics/bhive-ahfix-devfrag-20261018/cand618.log` |
 | `alloc-hints-space-test.sh` | the same | | 5 min | **FAIL both arms** (hint AND no-hint control): `Transaction aborted (error -28)` at btrfs_finish_one_ordered, forced read-only during the metadata fill, metadata space_info over-reserved by 466 MiB; all 99340 / 99235 un-fsynced metadata files lost (writers got EROFS), data files verify; statfs 3103 MiB (hint) / 55 MiB (control) | 2026-10-18 | 6.18 lane zb64 0d9bf28b00a8 tree (bhive 6.18.57+ #1, md5 d5bcda6a) | 8912994 | harness `forensics/bhive-ahfix-devfrag-20261018/lane618.log`, `lane618-aborts-dmesg.txt` |
 | `alloc-hints-space-test.sh` (ee6e2f9, before the statfs assertion) | the same | | 14 min | **FAIL (kernel bug)**: hint arm 2 ENOSPC transaction aborts, forced read-only, 24125 uncommitted files lost, df avail 3103 MiB at data ENOSPC; nodev control PASS (0 aborts, all files, df avail 55 MiB) | 2026-10-18 | misc-next zb64 568c45b64012 (bhive #5) | ee6e2f9 | harness `forensics/bhive-topics-testing-20261018/` (README, new3.log, hint-arm dmesg) |
+| `alloc-hints-space-test.sh` (arms dataonly, metaonly) | patch 12 for DATA_ONLY / METADATA_ONLY: no abort, every acked write (plain and fsynced) reads back, metaonly statfs < 512 MiB at data ENOSPC | 12 | 10 + 1 min | **PASS** x2 each: 0 lost, Avail 0 MiB at data ENOSPC | 2026-11-12 | misc-next zb64 9e0e654aa3f3 (dhive 7.3.0+ #77, md5 857cfb02) | e6fad3ba | harness `forensics/hs1112/` |
+| `alloc-hints-space-test.sh` (dataonly, metaonly) | the same | 12 | 7 + 1 min | **PASS** x2 each | 2026-11-12 | 6.18 zb64 511d12740cc4 (ahive 6.18.62+ #12, md5 8dee09f0) | e6fad3ba | harness `forensics/hs1112/` |
+| `alloc-hints-space-test.sh` (dataonly, metaonly, hint, nodev), negative control | patch 12 reverted | 12 | 25 min | dataonly **FAIL**: ENOSPC transaction abort, forced RO, loss of acked data (13 plain-written inline files, 0 of 5579 fsynced); metaonly PASS, no loss, statfs Avail 2784 MiB at data ENOSPC (5855 before the fill); hint FAIL as on 10-18, nodev PASS | 2026-11-12 | misc-next zb64 9e0e654aa3f3 + revert (refs/cand/hs1112/misc-next/zb64-no12 b09ebbf0f327, dhive #78) | e6fad3ba | harness `forensics/hs1112/` |
+| the same, negative control | patch 12 reverted | 12 | 8 min | dataonly **FAIL**: abort at btrfs_finish_one_ordered, 1331 plain-written files lost, 0 of 1945 fsynced; metaonly PASS, Avail 2784 MiB; hint FAIL, nodev PASS | 2026-11-12 | 6.18 zb64 511d12740cc4 + revert (refs/cand/hs1112/6.18/zb64-no12 bdf60126b8a3, ahive #13) | e6fad3ba | harness `forensics/hs1112/` |
 | `alloc-hints-test.sh` arm c x15 (`AH_ARMS=c`) | repeat of the 10-13 failure | 7 | 15 x 70 s | 15/15 PASS, every run the 3-chunk layout (the 10-13 failure had 5 chunks) | 2026-10-18 | misc-next zb64 568c45b64012 (bhive #5) | 1e003fbac1ba | harness `forensics/bhive-topics-testing-20261018/new2.log` |
 
 **alloc-hints-space-test.sh.**  raid1 data and metadata on 6 / 3 / 6 GiB
@@ -164,10 +168,21 @@ pairs devid 1's 3 GiB with NONE_ONLY devid 3's 6 GiB and reports 3 GiB of
 raid1 space; `calc_available_free_space()` lets metadata overcommit against
 it and statfs shows it, while the real allocator can place no chunk.  The
 2026-10-13 arm-c abort (devid 1 760 MiB, devid 2 0, NONE_ONLY devid 3
-2.3 GiB free) fits the same mechanism.  Limits: NONE_ONLY only;
-METADATA_ONLY / DATA_ONLY (space counted for the other type) and
-PREFERRED_NONE are expected to show the same blindness to a lesser degree,
-not tested.  Not shown on a kernel without the series: without hints the
+2.3 GiB free) fits the same mechanism.  Arms dataonly and metaonly (2026-11-12, hs1112) cover the other two
+exclusive hints.  **dataonly**: the hint arm's data fill, then devid 3 is
+set to DATA_ONLY, so metadata can use only the full devids 1+2 while
+devid 3 has 6 GiB unallocated.  Inline-file writers (4 plain, 1 fsync)
+and a plain buffered data writer run to ENOSPC; every write that
+returned success is verified after the remount.  **metaonly**: devid 3
+METADATA_ONLY; 2 plain and 1 fsync data writers to ENOSPC.  Without
+patch 12, dataonly aborts the transaction (btrfs_run_delayed_refs on
+misc-next, btrfs_finish_one_ordered on 6.18) and loses plain-written
+files whose writes had succeeded (13 and 1331; no fsynced file lost).
+metaonly loses nothing, because data reservations never overcommit; only
+statfs f_bavail is overstated (2784 MiB at data ENOSPC, against 0 with
+the patch), and f_blocks and Used are identical.  With patch 12 both arms
+pass on both lanes, with nothing lost.  Limits: PREFERRED_NONE is not
+tested.  Not shown on a kernel without the series: without hints the
 device takes chunks, so the control is the device-less filesystem instead.
 
 The cover summarizes this test instead of naming it.  It is the
@@ -279,6 +294,14 @@ Build checks (bhive, vm-scripts `uh1112/run-uh1112.sh`):
   layout, so the loop did not reproduce it.  The deterministic
   `alloc-hints-space-test.sh` reproduces what is very likely the same
   defect.
+- **A hint change does not restart data allocation after ENOSPC
+  (2026-11-12, hs1112, every kernel, patch 12 or not).**  In arm dataonly,
+  after devid 3 goes from NONE_ONLY to DATA_ONLY statfs offers 3103 MiB,
+  but the plain data writer hits ENOSPC after 30 MiB and no data chunk
+  appears on devid 3 in any of 8 runs.  Likely, from the code (no probe
+  yet): the data space_info `full` flag set at the NONE_ONLY data ENOSPC
+  is never cleared by the type store, and btrfs_chunk_alloc() skips
+  allocation while it is set.  Class: ENOSPC at write(2), nothing lost.
 - Striped profiles (raid0/10/5/6) and stripe_alloc data under hints: not
   tested.
 
@@ -288,7 +311,8 @@ Build checks (bhive, vm-scripts `uh1112/run-uh1112.sh`):
   `alloc-hints-space-test.sh` above: deterministic ENOSPC transaction
   aborts and a statfs that reports gigabytes free on a full filesystem when
   a NONE_ONLY device has unallocated space.  **Fixed** by patch 12
-  (promoted on both lanes 2026-10-18).
+  (promoted on both lanes 2026-10-18).  DATA_ONLY and METADATA_ONLY
+  confirmed fixed 2026-11-12 (arms dataonly, metaonly).
 - **6.18 finding (separate from the hints): metadata overcommit is wrong
   for unequal devices.**  On the 6.18 lane kernel the no-hint control
   (raid1 on 6 + 3 GiB) aborts exactly like the hint arm: 6.18's