[PATCH 1/8] btrfs: add config options for the root device scan
From: Ismael Luceno
Date: Mon Nov 16 2026 - 17:43:56 EST
Add Kconfig options to enable scanning all block devices for the remaining
members of a multi-device btrfs root filesystem when no initrd is available
to run the device scanner, plus a configurable polling interval for the scan.
The scan relies on devtmpfs device nodes and is used by the root-device wait
logic that follows in this series.
Signed-off-by: Ismael Luceno <ismael@xxxxxxxxxxx>
Signed-off-by: Ismael Luceno <iluceno@xxxxxxx>
---
fs/btrfs/Kconfig | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
index 4b10d78ed99b..c8ce06c9c3e7 100644
--- a/fs/btrfs/Kconfig
+++ b/fs/btrfs/Kconfig
@@ -82,6 +82,31 @@ config BTRFS_ASSERT
If unsure, say N.
+config BTRFS_ROOT_SCAN
+ bool "Btrfs multi-device root scan support"
+ select DEVTMPFS
+ depends on BTRFS_FS
+ default y
+ help
+ When btrfs is the root filesystem and rootwait is given, look in the
+ kernel for the rest of a multi-device filesystem. This is for systems
+ without an initrd to run the device scanner. It finds devices through
+ the device nodes that devtmpfs provides.
+
+ If unsure, say Y.
+
+config BTRFS_ROOT_SCAN_INTERVAL_MS
+ int "Interval between device scans while waiting for root devices (ms)"
+ depends on BTRFS_ROOT_SCAN
+ range 1 10000
+ default 100
+ help
+ How often, in milliseconds, to re-scan the block devices while
+ waiting for all of a multi-device root filesystem's devices to
+ appear. Only used together with CONFIG_BTRFS_ROOT_SCAN.
+
+ If unsure, say 100.
+
config BTRFS_EXPERIMENTAL
bool "Btrfs experimental features"
depends on BTRFS_FS