Skip to content

Commit

Permalink
rules: skip btrfs check if devices are not ready in 64-btrfs.rules (s…
Browse files Browse the repository at this point in the history
…ystemd#8304)

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
  • Loading branch information
fbuihuu authored and poettering committed Feb 28, 2018
1 parent 8181846 commit f8adf25
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rules/64-btrfs.rules.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f8adf25

Please sign in to comment.