multipath.rules: fixup race condition with systemd
authorHannes Reinecke <hare@suse.de>
Tue, 20 May 2014 10:34:05 +0000 (12:34 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sun, 29 Mar 2015 15:54:18 +0000 (17:54 +0200)
systemd will call 'fsck' on any device, even if no device
type is found. This might cause a race between the mount call
and any fsck call on the device-mapper device.
So for multipath we should arbitrary set the device type to
'none', as then systemd with detect a missing 'fsck.none'
command and skip fsck here.

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipath/multipath.rules

index 56056bf..c76e6b8 100644 (file)
@@ -4,10 +4,11 @@ SUBSYSTEM!="block", GOTO="end_mpath"
 ENV{MPATH_SBIN_PATH}="/sbin"
 TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin"
 
-SUBSYSTEM=="block", ACTION=="add|change", KERNEL=="sd*[!0-9]|dasd*[!0-9]", \
+SUBSYSTEM=="block", ACTION=="add|change", KERNEL=="sd*|dasd*", \
        ENV{DM_MULTIPATH_DEVICE_PATH}!="1", \
        PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -u %k", \
        ENV{DM_MULTIPATH_DEVICE_PATH}="1" \
+       ENV{ID_FS_TYPE}="none" \
        ENV{SYSTEMD_READY}="0"
 
 LABEL="end_mpath"