- show the candidate returns EIO promptly with no oops and still unmounts;
- show ordinary read repair still returns correct data.
+Kernels: the abort-arm rows ran on dhive (m-reloc) with the lane and
+candidate kernels built from the shared KASAN configs; the inject-arm,
+repair and corrupt-recovery rows ran on ehive (q-repair) with kernels built
+from copies of those configs plus CONFIG_FAULT_INJECTION,
+FAULT_INJECTION_DEBUG_FS and FAIL_FUNCTION, the same copy for each lane's
+baseline and candidate. The lanes have moved since (relocation and
+stripe-alloc promotions); fs/btrfs/bio.c is unchanged, so the results hold.
+
Found in m-reloc's relocation runs: six oopses 1.5 s after a relocation
abort forced the filesystem read-only (forensics m-reloc-20261021,
lane-relocate).
| test | verifies | patch(es) | duration | last result | date | kernel | harness | evidence |
|---|---|---|---|---|---|---|---|---|
-| `read-repair-submit-fail-test.sh` RR_ARM=abort | a repair bio whose csum lookup fails at submission (-EIO after an abort) does not oops; the read fails with EIO; unmount works | 1 | ~3 min | lane FAIL as expected on #5 (568c45b64012), misc-next lane 2550544f9c6e (`7.3.0-rc7+ #1`) and 6.18 lane 7626a4a10198 (`6.18.57+ #1`): 1 hit, `BUG: kernel NULL pointer dereference` (RIP 0, btrfs_bio_end_io <- btrfs_submit_bbio <- btrfs_check_read_bio), read hung. Candidate PASS on mn c5dc301213ee (`#2`) and 6.18 c3dbf52a35a8 (`#2`): 17 hits, EIO in 0.3-0.4 s, no oops, unmounted | 2026-10-22 | as listed (dhive, KASAN + lockdep) | working copy of read-repair-submit-fail-test.sh (commit pending, see harness log) | harness `forensics/m-reloc-repair-20261022/` |
-| same, RR_ARM=repair (control) | one mirror corrupt, no abort: reads return the file's data through read repair | 1 | ~3 min | PASS on #5 and both candidates: 2 reads correct, 10 "read error corrected", scrub clean | 2026-10-22 | #5; mn #2; 6.18 #2 | as above | as above |
+| `read-repair-submit-fail-test.sh` RR_ARM=inject (default) | a repair bio whose csum lookup fails at submission (fail_function: btrfs_search_slot -EIO in kworkers only) does not oops; the read fails with EIO; unmount works | 1 | ~1 min | lane FAIL as expected on misc-next lane 2550544f9c6e (`7.3.0-rc7+ #1`) and 6.18 lane 7626a4a10198 (`6.18.57+ #1`): 1 valid hit each, `BUG: kernel NULL pointer dereference` (RIP 0, btrfs_bio_end_io <- btrfs_submit_bbio <- btrfs_check_read_bio; mn offsets identical to the original oops), read hung. Candidate PASS 3/3 on mn c5dc301213ee (`#2`) and 3/3 on 6.18 c3dbf52a35a8 (`#2`): 17 hits, 17/17 injections inside a repair lookup, 0 elsewhere, reader lookups clean, EIO in 1.1-1.5 s, no oops, unmounted | 2026-10-22 | as listed (ehive, KASAN, -fi configs) | 339e54b | harness `forensics/q-repair-20261022/` |
+| `read-repair-submit-fail-test.sh` RR_ARM=abort | a repair bio whose csum lookup fails at submission (-EIO after an abort) does not oops; the read fails with EIO; unmount works | 1 | ~3 min | lane FAIL as expected on #5 (568c45b64012), misc-next lane 2550544f9c6e (`7.3.0-rc7+ #1`) and 6.18 lane 7626a4a10198 (`6.18.57+ #1`): 1 hit, `BUG: kernel NULL pointer dereference` (RIP 0, btrfs_bio_end_io <- btrfs_submit_bbio <- btrfs_check_read_bio), read hung. Candidate PASS on mn c5dc301213ee (`#2`) and 6.18 c3dbf52a35a8 (`#2`): 17 hits, EIO in 0.3-0.4 s, no oops, unmounted | 2026-10-22 | as listed (dhive, KASAN + lockdep) | working copy as of 04:25, committed as ddd893f | harness `forensics/m-reloc-repair-20261022/` |
+| same, RR_ARM=repair (control) | one mirror corrupt, no abort: reads return the file's data through read repair | 1 | ~3 min | PASS on #5 and both candidates: 2 reads correct, 10 "read error corrected", scrub clean | 2026-10-22 | #5; mn #2; 6.18 #2 (dhive) | as above | as above |
+| same, RR_ARM=repair, rerun (regression, lane vs candidate) | as above | 1 | ~1 min | PASS on all four: mn lane 2/2, mn cand 2/2, 6.18 lane 3/3, 6.18 cand 3/3 (10 repairs logged each); earlier 6.18 runs that never read the corrupt mirror were INVALID, not failures (fixed by steering reads, 339e54b) | 2026-10-22 | ehive -fi kernels as in the inject row | ddd893f (mn), 339e54b (6.18) | harness `forensics/q-repair-20261022/` |
+| `corrupt-recovery-test.sh` (defaults: raid6 data + raid1c3 metadata, STOCK and STRIPE_ALLOC, 1-2 corrupt devices, corrupt + missing) | read repair (raid6 rebuild, raid1c3 mirror) still recovers, detects and repairs within-tolerance corruption | 1 | ~10 min | PASS on all four (mn lane/cand, 6.18 lane/cand): bad=0 on every case, detectors moved, scrub uncorrectable 0, post-scrub re-read clean | 2026-10-22 | ehive -fi kernels | ddd893f | harness `forensics/q-repair-20261022/*-corrupt-recovery.log` |
| W=1 `fs/btrfs/bio.o` | no new warnings | 1 | - | none on either lane, before or after the patch; bzImage links on all four kernels | 2026-10-22 | mn 2550544f9c6e / c5dc301213ee; 6.18 7626a4a10198 / c3dbf52a35a8 | - | `build-{mn,618}/w1-*.txt` |
+| W=1 `make fs/btrfs/` (lane), bio.o (candidate), -fi configs | no new warnings | 1 | - | mn lane 2 pre-existing (stripe_whole_bytes unused, tree-log.c frame size), candidate bio.o 0; 6.18 lane 3 pre-existing, candidate bio.o 0; all four bzImages link | 2026-10-22 | as above (ehive) | - | harness `forensics/q-repair-20261022/build/` |
**read-repair-submit-fail-test.sh, abort arm.**
from the btree inode's page cache and nothing fails.
Kprobe events detect the trigger. A hit is a repair bbio's
-`btrfs_lookup_bio_sums` returning -5; a run with no hit is INVALID. The
-`inject` arm (fail_function on btrfs_search_slot in kworkers, added by
-q-repair) needs CONFIG_FAULT_INJECTION and was not run on these kernels.
+`btrfs_lookup_bio_sums` returning -5; a run with no hit is INVALID.
+
+**read-repair-submit-fail-test.sh, inject arm** (the default, deterministic).
+fail_function makes `btrfs_search_slot` return -EIO, with task-filter on and
+make-it-fail set on kthreadd and every kworker but never on the reader. The
+reader looks its checksums up in its own task, and each repair bio looks
+them up in a btrfs-endio kworker, so exactly the repair bios fail at
+submission. A 256 MiB raid1 file's last 64 KiB is corrupted on both mirrors,
+so every read of it needs repair; the injection is armed on a synced idle
+filesystem right before a buffered read of that tail and disarmed right
+after. A run counts only if the trace shows a hit, every injected failure's
+stack (fail_function verbose=2) runs through btrfs_check_read_bio and
+btrfs_lookup_bio_sums, and the reader's own lookups ran and succeeded;
+otherwise it is INVALID. It needs CONFIG_FAULT_INJECTION,
+FAULT_INJECTION_DEBUG_FS and FAIL_FUNCTION, which the lane test configs do
+not have. Limits: it exercises the csum lookup failure only, not a
+btrfs_map_block or split failure (the patch handles all three the same way,
+through the one end_io), and only raid1 data. On a kernel without the fix a
+run hangs the read and needs a reboot, so each lane got one inject run; with
+the abort arm each lane oopsed in 2 of 2 valid runs, the candidates in 0 of 8.
+
+**corrupt-recovery-test.sh** is the read-repair regression check: within
+tolerance corruption on raid6 data and raid1c3 metadata must be read back
+intact, detected, and repaired by scrub. It covers the normal repair path
+the patch touches (repair bios that submit cleanly), not the failure path.
## Open
from the failed bbio, so read repair keeps working after an abort as the
original read does. Not done; the fix above is needed either way, for
the other submit failures.
+- Not btrfs, found while building the inject arm: a trace kretprobe on
+ btrfs_search_slot next to fail_function's kprobe on the same function hit
+ a kprobes core use-after-free when the two were removed (WARNING at
+ kernel/kprobes.c:1203 __disarm_kprobe_ftrace, then KASAN
+ slab-use-after-free in aggr_pre_handler; harness
+ forensics/q-repair-20261022/mncand-inject-0-kprobes-uaf/). The test no
+ longer puts a trace probe on the injected function. Not chased.