Default: `9999`.
+* **`workaround-clone-logical-ino`**
+ Whether to serialize the dedupe (clone) ioctl against the `LOGICAL_INO` ioctl to avoid a btrfs kernel bug that can be triggered when both run concurrently.
+
+ * `yes` (the default) prevents any thread from running dedupe while another thread is running `LOGICAL_INO`, and vice versa. The two ioctls never overlap.
+ * `no` removes the restriction: any thread may run either operation at any time. This is faster under high concurrency but unsafe on kernels affected by the bug.
+
+ Leave this enabled unless you have confirmed your kernel is not affected.
+
+ Default: `yes`.
+
## [throttle] section
The [throttle] section helps manage btrfs commit latency by injecting intentional delays between system calls that queue delayed references (refs). Instead of submitting as many commands as possible and waiting for the queue to drain, this option queues commands at the **average rate** at which they are processed. This can improve system responsiveness and stabilize IO latency, particularly for write operations.
# Config version (number) or alias (STABLE, CURRENT, v0.11).
version = 2
+[thread]
+
+ # Serialize the dedupe ioctl against LOGICAL_INO to avoid a kernel
+ # bug triggered when both run concurrently. yes: no thread runs
+ # dedupe while another runs LOGICAL_INO (and vice versa). no: any
+ # thread may run either operation at any time (faster, but unsafe
+ # on affected kernels).
+ workaround-clone-logical-ino = yes
+
# scan_next's planner and matching pipeline emit a high volume of
# DEBUG/INFO progress detail that is interesting only when actively
# debugging dedup decisions. Quiet to warnings-and-errors by default;
bc->get_config().get("state.point.defer", bees_parse_bool));
}
- // Workaround for the logical-ino-vs-clone kernel bug
- MultiLocker::enable_locking(true);
+ // Workaround for the logical-ino-vs-clone kernel bug: serialize the
+ // dedupe ioctl against LOGICAL_INO unless the operator opts out.
+ const bool workaround_clone_logical_ino = bc->get_config().get("thread.workaround-clone-logical-ino", bees_parse_bool);
+ BEESLOGINFO("thread.workaround-clone-logical-ino = " << (workaround_clone_logical_ino ? "yes" : "no") << " [thread.workaround-clone-logical-ino]");
+ MultiLocker::enable_locking(workaround_clone_logical_ino);
// Start crawlers
bc->start();