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.
-Reproducer: alloc-hints-space-test.sh. Kai, this patch doubles as the
-bug report for your series.
+
+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
+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.
Changes for the current base: btrfs_update_device() is already
non-static upstream (the prototype is not re-added), and
# Testing: allocator-hints
Kai Krakow's allocator hint series (patches 1-7), KeinNiemand's fixed-width
-mirror fix (8) and three follow-ups (9-11). A per-device hint in the
+mirror fix (8) and four follow-ups (9-12). A per-device hint in the
DEV_ITEM `type` field, shown and set through
`/sys/fs/btrfs/<uuid>/devinfo/<devid>/type` (CONFIG_BTRFS_ALLOCATOR_HINTS),
steers the chunk allocator: preferred/only for data or metadata, avoid new
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
+candidate to adapt for fstests (a btrfs/ test) once the hints are
+merged: it is deterministic, needs only three scratch devices of
+unequal size (or `btrfs filesystem resize <devid>:<size>`) and the
+`devinfo/<devid>/type` sysfs file, and its control arm needs no hints.
+Its verification and statfs report would carry over; the 14 min run
+would need a smaller fill to fit the quick group.
+
## Fixed-width mirror coverage and negative control (2026-11-06, ah1106)
New arms of `alloc-hints-test.sh` (harness 03d60649) for patch 8: e3 (e2
exercised.
## Not covered / open
-
-- **KERNEL BUG (found 2026-10-18): space estimates ignore the hints.** See
- `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).
-- **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
- `calc_available_free_space()` divides the unallocated space of all devices
- by the copy count (3 GiB / 2 here) although devid 1 alone cannot hold a
- raid1 chunk. Upstream fixed this in v7.1 (Qu Wenruo's per-profile
- estimate, "This leads to various ENOSPC related transaction abort and
- flips the fs read-only"); the 6.18 candidate carries those three commits
- and passes both arms. Loss class: ENOSPC transaction abort, un-fsynced
- data only (the abort hit while the writers were still writing; data
- synced before survived).
- The fallback to `free_chunk_space` (zoned, or a failed estimate) and the
dynamic reclaim thresholds that read it stay hint-blind (not used by
these tests).
layout, so the loop did not reproduce it. The deterministic
`alloc-hints-space-test.sh` reproduces what is very likely the same
defect.
-- e2 (patch 8) negative control: done 2026-11-06 (ah1106, above).
-- `make headers_install` on the series (patch 9): done 2026-11-12, above.
- Striped profiles (raid0/10/5/6) and stripe_alloc data under hints: not
tested.
+## Closed
+
+- **KERNEL BUG (found 2026-10-18): space estimates ignore the hints.** See
+ `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).
+- **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
+ `calc_available_free_space()` divides the unallocated space of all devices
+ by the copy count (3 GiB / 2 here) although devid 1 alone cannot hold a
+ raid1 chunk. Upstream fixed this in v7.1 (Qu Wenruo's per-profile
+ estimate, "This leads to various ENOSPC related transaction abort and
+ flips the fs read-only"); the 6.18 candidate carries those three commits
+ and passes both arms. Loss class: ENOSPC transaction abort, un-fsynced
+ data only (the abort hit while the writers were still writing; data
+ synced before survived).
+- e2 (patch 8) negative control: done 2026-11-06 (ah1106, above).
+- `make headers_install` on the series (patch 9): done 2026-11-12, above.
+
**Questions for Zygo**
Answered 2026-10-18: fix it in the series (the fix is the report to Kai);