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

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