5559af34374839c0dbaa85683dee12870e744acb
[multipath-tools/.git] / multipath / 11-dm-mpath.rules
1 ACTION!="add|change", GOTO="mpath_end"
2 ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="mpath_end"
3 ENV{DM_UUID}!="mpath-?*", GOTO="mpath_end"
4
5 # Do not initiate scanning if no path is available,
6 # otherwise there would be a hang or IO error on access.
7 # We'd like to avoid this, especially within udev processing.
8 ENV{DM_NR_VALID_PATHS}!="?*", IMPORT{db}="DM_NR_VALID_PATHS"
9 ENV{DM_NR_VALID_PATHS}!="0", GOTO="mpath_blkid_end"
10 ENV{ID_FS_TYPE}!="?*", IMPORT{db}="ID_FS_TYPE"
11 ENV{ID_FS_USAGE}!="?*", IMPORT{db}="ID_FS_USAGE"
12 ENV{ID_FS_UUID}!="?*", IMPORT{db}="ID_FS_UUID"
13 ENV{ID_FS_ENC}!="?*", IMPORT{db}="ID_FS_UUID_ENC"
14 ENV{ID_FS_VERSION}!="?*", IMPORT{db}="ID_FS_VERSION"
15 LABEL="mpath_blkid_end"
16
17 # Also skip all foreign rules if no path is available.
18 # Remember the original value of DM_DISABLE_OTHER_RULES_FLAG
19 # and restore it back once we have at least one path available.
20 IMPORT{db}="DM_DISABLE_OTHER_RULES_FLAG_OLD"
21 ENV{DM_ACTION}=="PATH_FAILED",\
22         ENV{DM_NR_VALID_PATHS}=="0",\
23         ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}=="",\
24         ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}",\
25         ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1"
26 ENV{DM_ACTION}=="PATH_REINSTATED",\
27         ENV{DM_NR_VALID_PATHS}=="1",\
28         ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="$env{DM_DISABLE_OTHER_RULES_FLAG_OLD}",\
29         ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="",\
30         ENV{DM_ACTIVATION}="1"
31
32 # DM_SUBSYSTEM_UDEV_FLAG0 is the "RELOAD" flag for multipath subsystem.
33 # Drop the DM_ACTIVATION flag here as mpath reloads tables if any of its
34 # paths are lost/recovered. For any stack above the mpath device, this is not
35 # something that should be reacted upon since it would be useless extra work.
36 # It's exactly mpath's job to provide *seamless* device access to any of the
37 # paths that are available underneath.
38 ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", ENV{DM_ACTIVATION}="0"
39
40 LABEL="mpath_end"