]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
rules: skip btrfs check if devices are not ready in 64-btrfs.rules (#8304)
authorFranck Bui <fbui@suse.com>
Wed, 28 Feb 2018 09:36:06 +0000 (10:36 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 28 Feb 2018 09:36:06 +0000 (10:36 +0100)
If any devices are marked with 'SYSTEMD_READY=0' then we shouldn't run any
btrfs check on them.

Indeed there's no point in running "btrfs ready" on devices that already have
SYSTEMD_READY=0 set. Most probably such devices are members of a higher layer
aggregate device such as dm-multipath or software RAID. Doing IO on them wastes
time at best, and may cause delays, timeouts, or even hangs at worst (think
active-passive multipath or degraded RAID, for example).

It was initially reported at:
https://bugzilla.opensuse.org/show_bug.cgi?id=872929

rules/64-btrfs.rules.in

index c3a0972f2e56e55ad07cdff9633b67dc006923cc..aad29afb8bf83f33528619a3e94b43f11961170e 100644 (file)
@@ -3,6 +3,7 @@
 SUBSYSTEM!="block", GOTO="btrfs_end"
 ACTION=="remove", GOTO="btrfs_end"
 ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end"
+ENV{SYSTEMD_READY}=="0", GOTO="btrfs_end"
 
 # let the kernel know about this btrfs filesystem, and check if it is complete
 IMPORT{builtin}="btrfs ready $devnode"