]> git.hungrycats.org Git - linux/commitdiff
TESTING.md stripe-alloc: question 7, btrfs-progs --enqueue loses briefly freed exclus...
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Wed, 21 Oct 2026 23:27:39 +0000 (19:27 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Wed, 21 Oct 2026 23:27:39 +0000 (19:27 -0400)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6wxsJn1aY7PwnhgXdz6Ec

topics/stripe-alloc/TESTING.md

index 123bbda61ef305a2d933a2657ae4f2d8b23b4dda..6e5855d5256d0d3c29dbb584c3b336f5520bebe8 100644 (file)
@@ -886,4 +886,22 @@ passes no discard option runs async discard only.
      repair).  Side findings: scrub on nodatasum data recomputes parity
      from the stale strip (both cases); raid6 RMW recovery does not try Q
      when P is silently stale.  Evidence:
-     raid56-wh-harness/forensics/f-ioerr-20261020/ (README.md files).
\ No newline at end of file
+     raid56-wh-harness/forensics/f-ioerr-20261020/ (README.md files).7. NEW (f-oct, 2026-10-21), btrfs-progs `--enqueue` and a briefly freed
+   exclusive operation.  `check_running_fs_exclop()` (common/utils.c) reads
+   sysfs `exclusive_operation` before any exclusive ioctl.  With
+   `--enqueue` it waits for the notification, but (a) after the notify it
+   reopens the file and sleeps in a second `select()` for
+   `(remaining % 10) + 1` s "to randomize the order" before it re-reads
+   the operation, so a holder that frees the operation for less than ~10
+   s (the reclaim worker between groups) usually retakes it first; and (b)
+   it closes and reopens the file every loop, and a new open takes the
+   node's current event count, so a notify that lands between a select()
+   returning and the reopen is lost until the next notify or the 60 s
+   timeout.  The kernel side works around (a) with a 12 s gap between
+   reclaimed groups (reclaimbackoff candidate).  Sketch of a progs fix:
+   keep one fd open across the loop (kernfs poll compares the open file's
+   event count with the node's, so no notify is lost), re-read the
+   operation immediately after each notify and go straight to the ioctl
+   when it is free, and randomize only when the ioctl itself loses the
+   race (`BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS`).  No progs patch written;
+   want one?