|
|
4728c8 |
---
|
|
|
4728c8 |
multipath/11-dm-mpath.rules | 34 ++++++++++++++++++++++++++++++++++
|
|
|
4728c8 |
multipath/Makefile | 2 ++
|
|
|
4728c8 |
2 files changed, 36 insertions(+)
|
|
|
4728c8 |
|
|
|
4728c8 |
Index: multipath-tools-130222/multipath/11-dm-mpath.rules
|
|
|
4728c8 |
===================================================================
|
|
|
4728c8 |
--- /dev/null
|
|
|
4728c8 |
+++ multipath-tools-130222/multipath/11-dm-mpath.rules
|
|
|
4728c8 |
@@ -0,0 +1,34 @@
|
|
|
4728c8 |
+ACTION!="add|change", GOTO="mpath_end"
|
|
|
4728c8 |
+ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="mpath_end"
|
|
|
4728c8 |
+ENV{DM_UUID}!="mpath-?*", GOTO="mpath_end"
|
|
|
4728c8 |
+
|
|
|
4728c8 |
+# Do not initiate scanning if no path is available,
|
|
|
4728c8 |
+# otherwise there would be a hang or IO error on access.
|
|
|
4728c8 |
+# We'd like to avoid this, especially within udev processing.
|
|
|
4728c8 |
+ENV{DM_NR_VALID_PATHS}!="?*", IMPORT{db}="DM_NR_VALID_PATHS"
|
|
|
4728c8 |
+ENV{DM_NR_VALID_PATHS}=="0", ENV{DM_NOSCAN}="1"
|
|
|
4728c8 |
+
|
|
|
4728c8 |
+# Also skip all foreign rules if no path is available.
|
|
|
4728c8 |
+# Remember the original value of DM_DISABLE_OTHER_RULES_FLAG
|
|
|
4728c8 |
+# and restore it back once we have at least one path available.
|
|
|
4728c8 |
+IMPORT{db}="DM_DISABLE_OTHER_RULES_FLAG_OLD"
|
|
|
4728c8 |
+ENV{DM_ACTION}=="PATH_FAILED",\
|
|
|
4728c8 |
+ ENV{DM_NR_VALID_PATHS}=="0",\
|
|
|
4728c8 |
+ ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}=="",\
|
|
|
4728c8 |
+ ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}",\
|
|
|
4728c8 |
+ ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1"
|
|
|
4728c8 |
+ENV{DM_ACTION}=="PATH_REINSTATED",\
|
|
|
4728c8 |
+ ENV{DM_NR_VALID_PATHS}=="1",\
|
|
|
4728c8 |
+ ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="$env{DM_DISABLE_OTHER_RULES_FLAG_OLD}",\
|
|
|
4728c8 |
+ ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="",\
|
|
|
4728c8 |
+ ENV{DM_ACTIVATION}="1"
|
|
|
4728c8 |
+
|
|
|
4728c8 |
+# DM_SUBSYSTEM_UDEV_FLAG0 is the "RELOAD" flag for multipath subsystem.
|
|
|
4728c8 |
+# Drop the DM_ACTIVATION flag here as mpath reloads tables if any of its
|
|
|
4728c8 |
+# paths are lost/recovered. For any stack above the mpath device, this is not
|
|
|
4728c8 |
+# something that should be reacted upon since it would be useless extra work.
|
|
|
4728c8 |
+# It's exactly mpath's job to provide *seamless* device access to any of the
|
|
|
4728c8 |
+# paths that are available underneath.
|
|
|
4728c8 |
+ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", ENV{DM_ACTIVATION}="0"
|
|
|
4728c8 |
+
|
|
|
4728c8 |
+LABEL="mpath_end"
|
|
|
4728c8 |
Index: multipath-tools-130222/multipath/Makefile
|
|
|
4728c8 |
===================================================================
|
|
|
4728c8 |
--- multipath-tools-130222.orig/multipath/Makefile
|
|
|
4728c8 |
+++ multipath-tools-130222/multipath/Makefile
|
|
|
4728c8 |
@@ -25,6 +25,7 @@ install:
|
|
|
4728c8 |
$(INSTALL_PROGRAM) -m 755 mpathconf $(DESTDIR)$(bindir)/
|
|
|
4728c8 |
$(INSTALL_PROGRAM) -d $(DESTDIR)/usr/lib/udev/rules.d
|
|
|
4728c8 |
$(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/usr/lib/udev/rules.d/62-multipath.rules
|
|
|
4728c8 |
+ $(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)/usr/lib/udev/rules.d/11-dm-mpath.rules
|
|
|
4728c8 |
$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
|
|
|
4728c8 |
$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
|
|
|
4728c8 |
$(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
|
|
|
4728c8 |
@@ -33,6 +34,7 @@ install:
|
|
|
4728c8 |
|
|
|
4728c8 |
uninstall:
|
|
|
4728c8 |
rm $(DESTDIR)/usr/lib/udev/rules.d/62-multipath.rules
|
|
|
4728c8 |
+ rm $(DESTDIR)/usr/lib/udev/rules.d/11-dm-mpath.rules
|
|
|
4728c8 |
rm $(DESTDIR)$(bindir)/$(EXEC)
|
|
|
4728c8 |
rm $(DESTDIR)$(bindir)/mpathconf
|
|
|
4728c8 |
rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
|