]> git.hungrycats.org Git - linux/commitdiff
read-repair-fixes: TESTING: s-repair follow-up rows (candidate, not promoted)
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Thu, 22 Oct 2026 22:34:48 +0000 (18:34 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Thu, 22 Oct 2026 22:34:48 +0000 (18:34 -0400)
Read repair after an abort (repair bbio inherits csum_search_commit_root)
and no repair or scrub writes after an abort or shutdown:
refs/cand/s-repair/{mn,618}/{topic,zb64}, plus R56 on raid56-fixes.
New arms abortgood, shutdown, scrubabort (lane FAIL, candidate PASS on
both lanes), dirtyabort (FAIL everywhere, open for Zygo), and the
candidates' regression runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6wxsJn1aY7PwnhgXdz6Ec

topics/read-repair-fixes/TESTING.md

index bd0be67e9df20c05b95dd8521824f38cac67654e..bf5acdf775b0d0306e38f0720409462013cf5004 100644 (file)
@@ -52,6 +52,12 @@ lane-relocate).
 | `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` RR_ARM=abortgood (**candidate, not promoted**) | after an abort, a read of a sector corrupt on one mirror returns the good copy's data; nothing is written to any member after the abort; the bad copy stays bad | P2 (P3) | ~1 min | lane FAIL as expected on mn lane 0d1010a882d3 (`7.3.0-rc7+ #1`) 3/3 and 6.18 lane 19a5204c6cda (`6.18.57+ #1`) 3/3: EIO, 17 repair lookups failed, 0 writes.  Candidate PASS on mn 3e3c635885e4 (`#2`) 3/3: data correct in 0.06-0.10 s, 16 repair lookups, 0 failed, 0 writes, bad copy unchanged; 6.18 176448c38243 (`#2`) 3/3: data correct in 0.07-0.13 s, 0 writes, bad copy unchanged | 2026-10-22 | ehive, KASAN, -fi configs | 96cec4a (4c343a3) | harness `forensics/s-repair-20261022/` |
+| same, RR_ARM=shutdown (**candidate, not promoted**; misc-next only, FS_IOC_SHUTDOWN) | after an emergency shutdown (fs error set, SB_RDONLY clear), a read through an existing mapping is repaired in memory and nothing is written | P3 | ~1 min | lane FAIL as expected on #5 (568c45b64012) 1/1 and mn lane (`#1`) 3/3: 16 write requests after the shutdown, bad copy rewritten.  Candidate PASS mn (`#2`) 3/3: data correct, 0 writes.  6.18: SKIP (no shutdown ioctl) | 2026-10-22 | as above | 96cec4a | as above |
+| same, RR_ARM=scrubabort (**candidate, not promoted**) | a scrub running when a log-commit abort forces RO writes no repair after the abort | P4 | ~1.5 min | lane FAIL as expected on #5 1/1 (+1 INVALID, window missed), mn lane (`#1`) 3/3 and 6.18 lane (`#1`) 3/3: 1 write request, the bad sector "fixed up" ~14 s after "forced readonly", the scrub ran to the device end.  Candidate PASS mn (`#2`) 3/3: the scrub found the bad sector after the abort and wrote nothing; 6.18 (`#2`) 3/3: the same | 2026-10-22 | as above | 96cec4a | as above |
+| same, RR_ARM=dirtyabort (probe; **not fixed by the candidate**) | data pages dirtied before an abort are not written back after it | none | ~1.5 min | FAIL on every kernel: #5, mn lane, mn cand: 4 write requests after the abort; 6.18 lane: 2; 6.18 cand: 4.  See Open | 2026-10-22 | as above | 0b766f2 | as above |
+| regression on the candidates: inject x3, repair x2, corrupt-recovery-test.sh (**candidate, not promoted**) | the existing patch's coverage still holds with P2-P4 | 1-P4 | ~45 min | mn cand (`#2`): inject PASS 3/3 (EIO in 1.07-1.15 s, no oops, unmounted), repair PASS 2/2, corrupt-recovery PASS.  6.18 cand (`#2`): inject PASS 3/3 (EIO in 1.61-1.71 s, no oops, unmounted), repair PASS 2/2, corrupt-recovery PASS.  The abort arm is INVALID on both candidates by design (2/2 each): P2 removes its trigger (the repair lookup no longer fails); the inject arm still covers the end_io | 2026-10-22 | as above | 0b766f2 | as above |
+| W=1 `make fs/btrfs/` at every candidate commit (**candidate, not promoted**) | no new warnings | P2-P4, R56 | - | none new on either lane at any commit; only the pre-existing frame-size and stripe_whole_bytes warnings, which reappear when fs.h changes rebuild their objects; all four bzImages link | 2026-10-22 | ehive | - | harness `forensics/s-repair-20261022/build/` |
 
 **read-repair-submit-fail-test.sh, abort arm.**
 
@@ -103,12 +109,63 @@ 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.
 
+## Candidate follow-up (s-repair, candidate, not promoted)
+
+Zygo's rule (2026-10-22): no writes after an abort, repair writes
+included; a read may use the commit root to repair in memory but must not
+write the repaired block back.  Three patches after the topic patch, and
+one on raid56-fixes:
+- P2 "btrfs: look up a repair read's csums in the same root as the failed
+  read": the repair bbio inherits `csum_search_commit_root`.  Fixes
+  f07b855c56b1, Cc 6.18+.
+- P3 "btrfs: do not write back a read repair after a transaction abort":
+  `btrfs_can_submit_repair_write()` (not SB_RDONLY, no fs error, no
+  TRANS_ABORTED) in the repair write; covers data and tree block repair.
+  The abort sets TRANS_ABORTED, then the error, and only then SB_RDONLY;
+  an emergency shutdown (misc-next) never sets SB_RDONLY.  Fixes
+  8ceaad6cd6e7 (and 9b2839451dfc on misc-next), Cc 6.18+.
+- P4 "btrfs: scrub: do not write back repairs after a transaction abort":
+  scrub repair and RAID56 parity scrub never checked the fs state, and a
+  scrub keeps going through every block group after a non-commit abort.
+  Fixes 54765392a1b9, 5a6ac9eacb49, Cc 6.6+.
+- R56 "btrfs: raid56: no RMW write-back of repaired sectors after an
+  abort", on the raid56-fixes topic (refs/cand/s-repair/{mn,618}/r56-topic
+  d575213c1316 / 67a43df4db89) and on top of each zb64.  No dedicated test.
+
+Refs: refs/cand/s-repair/mn/topic f2d670d70ed4 (on a0d12f2d99a3),
+mn/zb64 af0f30422e76 (on 0d1010a882d3), 618/topic b53d20733b1a (on
+5943f40e7a76), 618/zb64 e02320b57626 (on 19a5204c6cda).  The tested
+kernels were built from 3e3c635885e4 and 176448c38243; the P4 message was
+reworded afterwards, and the trees are identical (927c7ec85a88,
+e9bc363f56fc).
+
+Write detector for the new arms: write, discard and flush requests on the
+loop devices under both members (/sys/block/loopN/stat), from the abort to
+after the unmount, with a negative control in every run (each loop's last
+4 KiB rewritten with its own contents inside the window must be counted;
+2 requests each run, subtracted) and a content oracle (mirror 1's corrupt
+range read back after the unmount).
+
+Paths checked: data read repair (window, P2+P3); tree block repair (csum in
+the header, no root mismatch; same write function, P3); scrub repair and
+parity scrub (real, P4); raid56 RMW write-back (R56); direct IO and encoded
+reads (never use the commit root, so read and repair agree; the original
+lookup can itself fail after an abort); scrub csum lookups (commit root,
+consistent); dev-replace copy (continues on purpose, untouched).
+
 ## Open
 
-- Possible follow-up: the repair bbio could inherit `csum_search_commit_root`
-  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.
+- Data writeback after an abort (Zygo's call): pages dirtied before an
+  abort are still written back after it (dirtyabort: 2-4 write requests on
+  every kernel, lane and candidate).  An emergency shutdown blocks
+  that writeback; an abort does not.
+- Dev-replace keeps copying after an abort (deliberate, comment in
+  `__btrfs_handle_fs_error()`).  Under the "no writes after abort" rule it
+  is a write; left as is pending Zygo.
+- R56 (raid56 RMW write-back guard) has no test of its own.
+- 6.12 and 6.6 stable lack even the SB_RDONLY check in the repair write
+  (only an ASSERT); P3's Cc says 6.18+ because 8ceaad6cd6e7 is its
+  prerequisite there.
 - 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