Blob Blame History Raw
---
 multipath/multipath.rules |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: multipath-tools-130222/multipath/multipath.rules
===================================================================
--- multipath-tools-130222.orig/multipath/multipath.rules
+++ multipath-tools-130222/multipath/multipath.rules
@@ -21,6 +21,7 @@ ACTION!="change", GOTO="update_timestamp
 IMPORT{db}="DM_MULTIPATH_TIMESTAMP"
 IMPORT{db}="DM_MULTIPATH_DEVICE_PATH"
 IMPORT{db}="DM_MULTIPATH_WIPE_PARTS"
+IMPORT{db}="DM_MULTIPATH_NEED_KPARTX"
 # Check if the device is part of a multipath device. the -T option just keeps
 # the old result if the timestamp hasn't changed.
 PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -T $env{DM_MULTIPATH_TIMESTAMP}:$env{DM_MULTIPATH_DEVICE_PATH} -c $env{DEVNAME}", \
@@ -43,7 +44,10 @@ KERNEL!="dm-*", GOTO="end_mpath"
 ENV{DM_UUID}=="mpath-?*|part[0-9]*-mpath-?*", OPTIONS+="link_priority=10"
 ACTION!="change", GOTO="end_mpath"
 ENV{DM_UUID}!="mpath-?*", GOTO="end_mpath"
+ENV{DM_ACTIVATION}=="1", ENV{DM_MULTIPATH_NEED_KPARTX}="1"
 ENV{DM_SUSPENDED}=="1", GOTO="end_mpath"
 ENV{DM_ACTION}=="PATH_FAILED", GOTO="end_mpath"
-ENV{DM_ACTIVATION}=="1", RUN+="$env{MPATH_SBIN_PATH}/kpartx -u $tempnode"
+ENV{DM_ACTIVATION}!="1", ENV{DM_MULTIPATH_NEED_KPARTX}!="1", GOTO="end_mpath"
+RUN+="$env{MPATH_SBIN_PATH}/kpartx -a $tempnode", \
+	ENV{DM_MULTIPATH_NEED_KPARTX}=""
 LABEL="end_mpath"