Blame SOURCES/0074-RHBZ-1056976-dm-mpath-rules.patch

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