diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index 763ac01..c297b30 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,35 @@ multipath-tools-091027.tar.gz /multipath-tools-120613.tgz /multipath-tools-120821.tgz /multipath-tools-130222.tgz +/multipath-tools-f21166a.tgz +/multipath.conf +/multipath-tools-git847cc43.tgz +/multipath-tools-0.7.3.tgz +/multipath-tools-07e7bd5.tgz +/multipath-tools-1cb704b.tgz +/multipath-tools-0.7.7.tgz +/multipath-tools-ef6d98b.tgz +/multipath-tools-1a8625a.tgz +/multipath-tools-b80318b.tgz +/multipath-tools-0.7.8.tgz +/multipath-tools-0.7.9.tgz +/multipath-tools-17a6101.tgz +/multipath-tools-2df6110.tgz +/multipath-tools-0.8.0.tgz +/multipath-tools-0.8.2.tgz +/multipath-tools-0.8.4.tgz +/multipath-tools-0.8.5.tgz +/multipath-tools-0.8.6.tgz +/multipath-tools-0.8.7.tgz +/multipath-tools-0.8.9.tgz +/multipath-tools-0.9.0.tgz +/multipath-tools-0.9.3.tgz +/multipath-tools-0.9.4.tgz +/multipath-tools-0.9.5.tgz +/multipath-tools-0.9.6.tgz +/multipath-tools-0.9.7.tgz +/multipath-tools-0.9.8.tgz +/multipath-tools-0.9.9.tgz +/multipath-tools-0.10.0.tgz +/multipath-tools-0.11.1.tgz +/multipath-tools-0.13.0.tgz diff --git a/0001-RH-dont_start_with_no_config.patch b/0001-RH-dont_start_with_no_config.patch deleted file mode 100644 index e894632..0000000 --- a/0001-RH-dont_start_with_no_config.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- - multipathd/multipathd.service | 1 + - 1 file changed, 1 insertion(+) - -Index: multipath-tools-130222/multipathd/multipathd.service -=================================================================== ---- multipath-tools-130222.orig/multipathd/multipathd.service -+++ multipath-tools-130222/multipathd/multipathd.service -@@ -2,6 +2,7 @@ - Description=Device-Mapper Multipath Device Controller - Before=iscsi.service iscsid.service lvm2-activation-early.service - After=syslog.target -+ConditionPathExists=/etc/multipath.conf - DefaultDependencies=no - Conflicts=shutdown.target - diff --git a/0001-RH-fixup-udev-rules-for-redhat.patch b/0001-RH-fixup-udev-rules-for-redhat.patch new file mode 100644 index 0000000..ed5b7e9 --- /dev/null +++ b/0001-RH-fixup-udev-rules-for-redhat.patch @@ -0,0 +1,63 @@ +From 64a07df23affd21842fdc604887276e62e5b41de Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 13 Apr 2017 07:22:23 -0500 +Subject: [PATCH] RH: fixup udev rules for redhat + +The multipath rules need to run after scsi_id is run. This means moving +them after 60-persistent-storage.rules for redhat. Redhat also uses a +different naming scheme for partitions than SuSE. + +Signed-off-by: Benjamin Marzinski +--- + Makefile.inc | 2 +- + kpartx/kpartx.rules.in | 2 +- + multipath/Makefile | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile.inc b/Makefile.inc +index 9e3dc466..ead89030 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -34,7 +34,7 @@ endif + # Paths. All these can be overridden on the "make" command line. + prefix := + # Prefix for binaries +-exec_prefix := $(prefix) ++exec_prefix := $(prefix)/usr + # Prefix for non-essential libraries (libdmmp) + usr_prefix := $(if $(prefix),$(prefix),/usr) + # Prefix for configuration files (multipath.conf) +diff --git a/kpartx/kpartx.rules.in b/kpartx/kpartx.rules.in +index 9d879609..2049eb8f 100644 +--- a/kpartx/kpartx.rules.in ++++ b/kpartx/kpartx.rules.in +@@ -39,6 +39,6 @@ LABEL="mpath_kpartx_end" + GOTO="kpartx_end" + + LABEL="run_kpartx" +-RUN+="@BINDIR@/kpartx -un -p -part /dev/$name" ++RUN+="@BINDIR@/kpartx -un /dev/$name" + + LABEL="kpartx_end" +diff --git a/multipath/Makefile b/multipath/Makefile +index 67fb5e62..2ea9e528 100644 +--- a/multipath/Makefile ++++ b/multipath/Makefile +@@ -27,7 +27,7 @@ install: + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir) + $(Q)$(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir) + $(Q)$(INSTALL_PROGRAM) -m 644 99-z-dm-mpath-late.rules $(DESTDIR)$(udevrulesdir) +- $(Q)$(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)$(udevrulesdir)/56-multipath.rules ++ $(Q)$(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)$(udevrulesdir)/62-multipath.rules + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(tmpfilesdir) + $(Q)$(INSTALL_PROGRAM) -m 644 tmpfiles.conf $(DESTDIR)$(tmpfilesdir)/multipath.conf + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)/man8 +@@ -50,7 +50,7 @@ uninstall: + $(Q)$(RM) $(DESTDIR)$(udevrulesdir)/99-z-dm-mpath-late.rules + $(Q)$(RM) $(DESTDIR)$(modulesloaddir)/multipath.conf + $(Q)$(RM) $(DESTDIR)$(modulesloaddir)/scsi_dh.conf +- $(Q)$(RM) $(DESTDIR)$(libudevdir)/rules.d/56-multipath.rules ++ $(Q)$(RM) $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules + $(Q)$(RM) $(DESTDIR)$(mandir)/man8/$(EXEC).8 + $(Q)$(RM) $(DESTDIR)$(mandir)/man5/$(EXEC).conf.5 + $(Q)$(RM) $(DESTDIR)$(tmpfilesdir)/multipath.conf diff --git a/0002-RH-Remove-the-property-blacklist-exception-builtin.patch b/0002-RH-Remove-the-property-blacklist-exception-builtin.patch new file mode 100644 index 0000000..b8e580a --- /dev/null +++ b/0002-RH-Remove-the-property-blacklist-exception-builtin.patch @@ -0,0 +1,100 @@ +From f7be16ac9fce97585a4552d49f3d3c54a93c9c17 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 2 Jul 2014 12:49:53 -0500 +Subject: [PATCH] RH: Remove the property blacklist exception builtin + +Multipath set the default property blacklist exceptions to +(ID_SCSI_VPD|ID_WWN). This has the effect of blacklisting some internal +devices. These devices may never have multiple paths, but it is nice +to be able to set multipath up on them all the same. This patch simply +removes the default, and makes it so that if no property +blacklist_exception is given, then devices aren't failed for not matching +it. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/blacklist.c | 5 ++--- + multipath/multipath.conf.5.in | 11 ++++++----- + tests/blacklist.c | 7 ++----- + 3 files changed, 10 insertions(+), 13 deletions(-) + +diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c +index 17e1b54a..10d13e98 100644 +--- a/libmultipath/blacklist.c ++++ b/libmultipath/blacklist.c +@@ -230,8 +230,6 @@ setup_default_blist (struct config * conf) + ORIGIN_DEFAULT)) + return 1; + } +- if (store_ble(conf->elist_property, "(SCSI_IDENT_|ID_WWN)", ORIGIN_DEFAULT)) +- return 1; + + vector_foreach_slot (conf->hwtable, hwe, i) { + if (hwe->bl_product) { +@@ -438,7 +436,8 @@ filter_property(const struct config *conf, struct udev_device *udev, + *uid_attribute != '\0'; + bool uid_attr_seen = false; + +- r = MATCH_PROPERTY_BLIST_MISSING; ++ if (VECTOR_SIZE(conf->elist_property)) ++ r = MATCH_PROPERTY_BLIST_MISSING; + udev_list_entry_foreach(list_entry, + udev_device_get_properties_list_entry(udev)) { + +diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in +index 3c9ae097..ba291e11 100644 +--- a/multipath/multipath.conf.5.in ++++ b/multipath/multipath.conf.5.in +@@ -1470,9 +1470,14 @@ keywords. Both are regular expressions. For a full description of these keywords + Regular expression for an udev property. All + devices that have matching udev properties will be excluded/included. + The handling of the \fIproperty\fR keyword is special, +-because devices \fBmust\fR have at least one whitelisted udev property; ++because if a property blacklist_exception is set, devices \fBmust\fR have at ++least one whitelisted udev property; + otherwise they're treated as blacklisted, and the message + "\fIblacklisted, udev property missing\fR" is displayed in the logs. ++For example, setting the property blacklist_exception to ++\fB(SCSI_IDENT_|ID_WWN)\fR, will cause well-behaved SCSI devices and devices ++that provide a WWN (World Wide Number) to be included, and all others to be ++excluded. This works to exclude most non-multipathable devices. + . + .RS + .PP +@@ -1483,10 +1488,6 @@ Blacklisting by missing properties is only applied to devices which do have the + property specified by \fIuid_attribute\fR (e.g. \fIID_SERIAL\fR) + set. Previously, it was applied to every device, possibly causing devices to be + blacklisted because of temporary I/O error conditions. +-.PP +-The default \fIblacklist exception\fR is: \fB(SCSI_IDENT_|ID_WWN)\fR, causing +-well-behaved SCSI devices and devices that provide a WWN (World Wide Number) +-to be included, and all others to be excluded. + .RE + .TP + .B protocol +diff --git a/tests/blacklist.c b/tests/blacklist.c +index ab3da619..52ae03e0 100644 +--- a/tests/blacklist.c ++++ b/tests/blacklist.c +@@ -371,9 +371,8 @@ static void test_property_missing(void **state) + { + static struct udev_device udev = { "sdb", { "ID_FOO", "ID_BAZ", "ID_BAR", "ID_SERIAL", NULL } }; + conf.blist_property = blist_property_wwn; +- expect_condlog(3, "sdb: blacklisted, udev property missing\n"); + assert_int_equal(filter_property(&conf, &udev, 3, "ID_SERIAL"), +- MATCH_PROPERTY_BLIST_MISSING); ++ MATCH_NOTHING); + assert_int_equal(filter_property(&conf, &udev, 3, "ID_BLAH"), + MATCH_NOTHING); + assert_int_equal(filter_property(&conf, &udev, 3, ""), +@@ -465,9 +464,7 @@ static void test_filter_path_missing1(void **state) + conf.blist_device = blist_device_foo_bar; + conf.blist_protocol = blist_protocol_fcp; + conf.blist_wwid = blist_wwid_xyzzy; +- expect_condlog(3, "sdb: blacklisted, udev property missing\n"); +- assert_int_equal(filter_path(&conf, &miss1_pp), +- MATCH_PROPERTY_BLIST_MISSING); ++ assert_int_equal(filter_path(&conf, &miss1_pp), MATCH_NOTHING); + } + + /* This one matches the property whitelist, to test the other missing diff --git a/0002-RH-multipath.rules.patch b/0002-RH-multipath.rules.patch deleted file mode 100644 index a910dc1..0000000 --- a/0002-RH-multipath.rules.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- - multipath/Makefile | 3 +++ - multipath/multipath.rules | 24 ++++++++++++++++++++++++ - 2 files changed, 27 insertions(+) - -Index: multipath-tools-130222/multipath/multipath.rules -=================================================================== ---- /dev/null -+++ multipath-tools-130222/multipath/multipath.rules -@@ -0,0 +1,24 @@ -+# multipath wants the devmaps presented as meaninglful device names -+# so name them after their devmap name -+SUBSYSTEM!="block", GOTO="end_mpath" -+ -+ENV{MPATH_SBIN_PATH}="/sbin" -+TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin" -+ -+ACTION=="add", ENV{DEVTYPE}!="partition", \ -+ ENV{DM_MULTIPATH_DEVICE_PATH}!="1", \ -+ TEST=="/etc/multipath.conf", \ -+ PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -c $tempnode", \ -+ ENV{DM_MULTIPATH_DEVICE_PATH}="1" -+ -+ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{DEVTYPE}!="partition", \ -+ RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}" -+ -+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_SUSPENDED}=="1", GOTO="end_mpath" -+ENV{DM_ACTION}=="PATH_FAILED", GOTO="end_mpath" -+RUN+="$env{MPATH_SBIN_PATH}/kpartx -a $tempnode" -+LABEL="end_mpath" -Index: multipath-tools-130222/multipath/Makefile -=================================================================== ---- multipath-tools-130222.orig/multipath/Makefile -+++ multipath-tools-130222/multipath/Makefile -@@ -21,12 +21,15 @@ $(EXEC): $(OBJS) - install: - $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/ -+ $(INSTALL_PROGRAM) -d $(DESTDIR)/lib/udev/rules.d -+ $(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/lib/udev/rules.d/62-multipath.rules - $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir) - $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir) - $(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir) - $(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5.gz $(DESTDIR)$(man5dir) - - uninstall: -+ rm $(DESTDIR)/lib/udev/rules.d/62-multipath.rules - rm $(DESTDIR)$(bindir)/$(EXEC) - rm $(DESTDIR)$(mandir)/$(EXEC).8.gz - rm $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz diff --git a/0003-RH-Make-build-system-RH-Fedora-friendly.patch b/0003-RH-Make-build-system-RH-Fedora-friendly.patch deleted file mode 100644 index f293c80..0000000 --- a/0003-RH-Make-build-system-RH-Fedora-friendly.patch +++ /dev/null @@ -1,109 +0,0 @@ -From f5e11246063b07d6dce6d37d3b74662475baa981 Mon Sep 17 00:00:00 2001 -From: Fabio M. Di Nitto -Date: Thu, 15 Oct 2009 04:39:27 +0200 -Subject: [PATCH 08/12] RH: Make build system RH/Fedora friendly - -Signed-off-by: Fabio M. Di Nitto ---- -:100644 100644 7ec25d5... 06fb625... M Makefile.inc -:100644 100644 21e4ad4... 06d79c0... M kpartx/Makefile -:100644 100644 32d9ef5... 25e1483... M multipathd/Makefile - Makefile.inc | 2 +- - kpartx/Makefile | 10 +++++----- - libmpathpersist/Makefile | 7 ++----- - libmultipath/Makefile | 2 ++ - multipathd/Makefile | 1 + - 5 files changed, 11 insertions(+), 11 deletions(-) - -Index: multipath-tools-130222/Makefile.inc -=================================================================== ---- multipath-tools-130222.orig/Makefile.inc -+++ multipath-tools-130222/Makefile.inc -@@ -29,7 +29,7 @@ multipathdir = $(TOPDIR)/libmultipath - mandir = $(prefix)/usr/share/man/man8 - man5dir = $(prefix)/usr/share/man/man5 - man3dir = $(prefix)/usr/share/man/man3 --rcdir = $(prefix)/etc/init.d -+rcdir = $(prefix)/etc/rc.d/init.d - syslibdir = $(prefix)/$(LIB) - libdir = $(prefix)/$(LIB)/multipath - unitdir = $(prefix)/lib/systemd/system -Index: multipath-tools-130222/kpartx/Makefile -=================================================================== ---- multipath-tools-130222.orig/kpartx/Makefile -+++ multipath-tools-130222/kpartx/Makefile -@@ -26,17 +26,17 @@ $(EXEC): $(OBJS) - install: $(EXEC) $(EXEC).8 - $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir) -- $(INSTALL_PROGRAM) -d $(DESTDIR)$(libudevdir) -- $(INSTALL_PROGRAM) -m 755 kpartx_id $(DESTDIR)$(libudevdir) -- $(INSTALL_PROGRAM) -d $(DESTDIR)/etc/udev/rules.d -- $(INSTALL_PROGRAM) -m 644 kpartx.rules $(DESTDIR)/etc/udev/rules.d/ -+# $(INSTALL_PROGRAM) -d $(DESTDIR)$(libudevdir) -+# $(INSTALL_PROGRAM) -m 755 kpartx_id $(DESTDIR)$(libudevdir) -+# $(INSTALL_PROGRAM) -d $(DESTDIR)/etc/udev/rules.d -+# $(INSTALL_PROGRAM) -m 644 kpartx.rules $(DESTDIR)/etc/udev/rules.d/ - $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir) - $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir) - - uninstall: - rm -f $(DESTDIR)$(bindir)/$(EXEC) - rm -f $(DESTDIR)$(mandir)/$(EXEC).8.gz -- rm -f $(DESTDIR)$(libudevdir)/kpartx_id -+# rm -f $(DESTDIR)$(libudevdir)/kpartx_id - - clean: - rm -f core *.o $(EXEC) *.gz -Index: multipath-tools-130222/multipathd/Makefile -=================================================================== ---- multipath-tools-130222.orig/multipathd/Makefile -+++ multipath-tools-130222/multipathd/Makefile -@@ -35,6 +35,7 @@ install: - $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) -d $(DESTDIR)$(rcdir) -+ $(INSTALL_PROGRAM) -m 755 multipathd.init.redhat $(DESTDIR)$(rcdir)/$(EXEC) - $(INSTALL_PROGRAM) -d $(DESTDIR)$(unitdir) - $(INSTALL_PROGRAM) -m 644 $(EXEC).service $(DESTDIR)$(unitdir) - $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir) -Index: multipath-tools-130222/libmultipath/Makefile -=================================================================== ---- multipath-tools-130222.orig/libmultipath/Makefile -+++ multipath-tools-130222/libmultipath/Makefile -@@ -46,9 +46,11 @@ install: - $(INSTALL_PROGRAM) -d $(DESTDIR)$(syslibdir) - $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(syslibdir)/$(LIBS) - $(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(libdir) -+ ln -sf $(LIBS) $(DESTDIR)$(syslibdir)/$(DEVLIB) - - uninstall: - rm -f $(DESTDIR)$(syslibdir)/$(LIBS) -+ rm -f $(DESTDIR)$(syslibdir)/$(DEVLIB) - - clean: - rm -f core *.a *.o *.gz *.so *.so.* -Index: multipath-tools-130222/libmpathpersist/Makefile -=================================================================== ---- multipath-tools-130222.orig/libmpathpersist/Makefile -+++ multipath-tools-130222/libmpathpersist/Makefile -@@ -28,17 +28,14 @@ $(LIBS): - install: $(LIBS) - $(INSTALL_PROGRAM) -d $(DESTDIR)$(syslibdir) - $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(syslibdir)/$(LIBS) -- $(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(syslibdir) - $(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(man3dir) -- $(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)/usr/include/ -- $(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)/usr/share/doc/mpathpersist/ -- ln -sf $(DESTDIR)$(syslibdir)/$(LIBS) $(DESTDIR)$(syslibdir)/$(DEVLIB) -+ ln -sf $(LIBS) $(DESTDIR)$(syslibdir)/$(DEVLIB) - install -m 644 mpath_persistent_reserve_in.3.gz $(DESTDIR)$(man3dir) - install -m 644 mpath_persistent_reserve_out.3.gz $(DESTDIR)$(man3dir) -- install -m 644 mpath_persist.h $(DESTDIR)/usr/include/ - - uninstall: - rm -f $(DESTDIR)$(syslibdir)/$(LIBS) -+ rm -f $(DESTDIR)$(syslibdir)/$(DEVLIB) - rm $(DESTDIR)$(mandir)/mpath_persistent_reserve_in.3.gz - rm $(DESTDIR)$(mandir)/mpath_persistent_reserve_out.3.gz - diff --git a/0003-RH-don-t-start-without-a-config-file.patch b/0003-RH-don-t-start-without-a-config-file.patch new file mode 100644 index 0000000..05d4e7a --- /dev/null +++ b/0003-RH-don-t-start-without-a-config-file.patch @@ -0,0 +1,137 @@ +From 5613e07ce9cabf2fdc402f6f102cc54bd1059800 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 15 Oct 2014 10:39:30 -0500 +Subject: [PATCH] RH: don't start without a config file + +If /etc/multipath.conf doesn't exist, don't start multipathd and blacklist +all devices when running multipath. A completely blank configuration file +is almost never what users want. Also, people may have the multipath +packages installed but don't want to use them. This patch provides a +simple way to disable multipath. Simply removing or renaming +/etc/multipath.conf will keep multipath from doing anything. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/config.c | 13 +++++++++++++ + libmultipath/config.h | 1 + + multipath/main.c | 6 ++++++ + multipath/multipath.rules.in | 1 + + multipathd/multipathd.8.in | 2 ++ + multipathd/multipathd.service.in | 1 + + multipathd/multipathd.socket.in | 1 + + 7 files changed, 25 insertions(+) + +diff --git a/libmultipath/config.c b/libmultipath/config.c +index 8b424d18..b8317f4d 100644 +--- a/libmultipath/config.c ++++ b/libmultipath/config.c +@@ -937,6 +937,19 @@ int init_config__ (const char *file, struct config *conf) + } + factorize_hwtable(conf->hwtable, builtin_hwtable_size, file); + validate_pctable(conf->overrides, 0, file); ++ } else { ++ condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); ++ if (conf->blist_devnode == NULL) { ++ conf->blist_devnode = vector_alloc(); ++ if (!conf->blist_devnode) { ++ condlog(0, "cannot allocate blacklist\n"); ++ goto out; ++ } ++ } ++ if (store_ble(conf->blist_devnode, ".*", ORIGIN_NO_CONFIG)) { ++ condlog(0, "cannot store default no-config blacklist\n"); ++ goto out; ++ } + } + + conf->processed_main_config = 1; +diff --git a/libmultipath/config.h b/libmultipath/config.h +index 5b4ebf8c..2302eacc 100644 +--- a/libmultipath/config.h ++++ b/libmultipath/config.h +@@ -10,6 +10,7 @@ + + #define ORIGIN_DEFAULT 0 + #define ORIGIN_CONFIG 1 ++#define ORIGIN_NO_CONFIG 2 + + enum devtypes { + DEV_NONE, +diff --git a/multipath/main.c b/multipath/main.c +index f2adcdeb..31012874 100644 +--- a/multipath/main.c ++++ b/multipath/main.c +@@ -834,11 +834,14 @@ main (int argc, char *argv[]) + char *dev = NULL; + struct config *conf; + bool enable_foreign = false; ++ bool have_config; ++ struct stat buf; + + libmultipath_init(); + if (atexit(dm_lib_exit) || atexit(libmultipath_exit)) + condlog(1, "failed to register cleanup handler for libmultipath: %m"); + logsink = LOGSINK_STDERR_WITH_TIME; ++ have_config = (stat(DEFAULT_CONFIGFILE, &buf) == 0); + if (init_config(DEFAULT_CONFIGFILE)) + exit(RTVL_FAIL); + if (atexit(uninit_config)) +@@ -1092,6 +1095,9 @@ main (int argc, char *argv[]) + while ((r = configure(conf, cmd, dev_type, dev)) == RTVL_RETRY) + condlog(3, "restart multipath configuration process"); + ++ if (!have_config && r == RTVL_OK && ++ (cmd == CMD_LIST_SHORT || cmd == CMD_LIST_LONG)) ++ r = RTVL_FAIL; + out: + put_multipath_config(conf); + if (dev) +diff --git a/multipath/multipath.rules.in b/multipath/multipath.rules.in +index 2ac1972f..cc248231 100644 +--- a/multipath/multipath.rules.in ++++ b/multipath/multipath.rules.in +@@ -9,6 +9,7 @@ IMPORT{cmdline}="nompath" + ENV{nompath}=="?*", GOTO="end_mpath" + IMPORT{cmdline}="multipath" + ENV{multipath}=="off", GOTO="end_mpath" ++TEST!="/etc/multipath.conf", GOTO="end_mpath" + + ENV{DEVTYPE}!="partition", GOTO="test_dev" + IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH" +diff --git a/multipathd/multipathd.8.in b/multipathd/multipathd.8.in +index 8815e099..342e363e 100644 +--- a/multipathd/multipathd.8.in ++++ b/multipathd/multipathd.8.in +@@ -49,6 +49,8 @@ map regains its maximum performance and redundancy. + With the \fB-k\fR option, \fBmultipathd\fR acts as a client utility that + sends commands to a running instance of the multipathd daemon (see + \fBCOMMANDS\fR below). ++ ++In this Linux distribution, multipathd does not run unless a /etc/multipath.conf file exists. + . + . + .\" ---------------------------------------------------------------------------- +diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in +index eb58943c..ab166435 100644 +--- a/multipathd/multipathd.service.in ++++ b/multipathd/multipathd.service.in +@@ -6,6 +6,7 @@ Wants=systemd-udevd-kernel.socket multipathd-queueing.service @MODPROBE_UNIT@ + After=systemd-udevd-kernel.socket @MODPROBE_UNIT@ + After=multipathd.socket systemd-remount-fs.service + Before=initrd-cleanup.service ++ConditionPathExists=/etc/multipath.conf + DefaultDependencies=no + Conflicts=shutdown.target + Conflicts=initrd-cleanup.service +diff --git a/multipathd/multipathd.socket.in b/multipathd/multipathd.socket.in +index 11002fce..5ed24757 100644 +--- a/multipathd/multipathd.socket.in ++++ b/multipathd/multipathd.socket.in +@@ -1,6 +1,7 @@ + [Unit] + Description=multipathd control socket + DefaultDependencies=no ++ConditionPathExists=/etc/multipath.conf + ConditionKernelCommandLine=!nompath + ConditionKernelCommandLine=!multipath=off + ConditionVirtualization=!container diff --git a/0004-RH-Fix-nvme-function-missing-argument.patch b/0004-RH-Fix-nvme-function-missing-argument.patch new file mode 100644 index 0000000..33a8d5f --- /dev/null +++ b/0004-RH-Fix-nvme-function-missing-argument.patch @@ -0,0 +1,26 @@ +From 283b5dd645663a2cf16f2813581772d7a84db6ad Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Fri, 25 Jan 2019 14:54:56 -0600 +Subject: [PATCH] RH: Fix nvme function missing argument + +A future patch will change the compilation options to error when +function declarations have unspecified arguments. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/nvme/argconfig.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libmultipath/nvme/argconfig.h b/libmultipath/nvme/argconfig.h +index b3caa7be..f91504c9 100644 +--- a/libmultipath/nvme/argconfig.h ++++ b/libmultipath/nvme/argconfig.h +@@ -63,7 +63,7 @@ struct argconfig_commandline_options { + extern "C" { + #endif + +-typedef void argconfig_help_func(); ++typedef void argconfig_help_func(void); + void argconfig_append_usage(const char *str); + void argconfig_print_help(const char *program_desc, + const struct argconfig_commandline_options *options); diff --git a/0004-RH-multipathd-blacklist-all-by-default.patch b/0004-RH-multipathd-blacklist-all-by-default.patch deleted file mode 100644 index 2dda63c..0000000 --- a/0004-RH-multipathd-blacklist-all-by-default.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 61b2002c6b2752c15b431e400cd614edc8c5b039 Mon Sep 17 00:00:00 2001 -From: Fabio M. Di Nitto -Date: Mon, 19 Oct 2009 07:05:45 +0200 -Subject: [PATCH 09/12] RH: multipathd blacklist all by default - -If there is no configuration installed on the system, blacklist -everything by default. - -BZ#528059 - -Signed-off-by: Fabio M. Di Nitto ---- -:100644 100644 e7e962e... 5aa1ab0... M libmultipath/config.c -:100644 100644 86b1320... 7e90e75... M libmultipath/config.h - libmultipath/config.c | 16 ++++++++++++++++ - libmultipath/config.h | 1 + - 2 files changed, 17 insertions(+) - -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -21,6 +21,7 @@ - #include "defaults.h" - #include "prio.h" - #include "devmapper.h" -+#include "version.h" - - static int - hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2) -@@ -585,6 +586,21 @@ load_config (char * file) - - } else { - init_keywords(); -+ condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); -+ condlog(0, "A default multipath.conf file is located at"); -+ condlog(0, "/usr/share/doc/device-mapper-multipath-%d.%d.%d/multipath.conf", MULTIPATH_VERSION(VERSION_CODE)); -+ if (conf->blist_devnode == NULL) { -+ conf->blist_devnode = vector_alloc(); -+ if (!conf->blist_devnode) { -+ condlog(0, "cannot allocate blacklist\n"); -+ goto out; -+ } -+ } -+ if (store_ble(conf->blist_devnode, strdup(".*"), -+ ORIGIN_NO_CONFIG)) { -+ condlog(0, "cannot store default no-config blacklist\n"); -+ goto out; -+ } - } - - /* -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -6,6 +6,7 @@ - - #define ORIGIN_DEFAULT 0 - #define ORIGIN_CONFIG 1 -+#define ORIGIN_NO_CONFIG 2 - - /* - * In kernel, fast_io_fail == 0 means immediate failure on rport delete. diff --git a/0005-RH-add-mpathconf.patch b/0005-RH-add-mpathconf.patch deleted file mode 100644 index 89ab3a3..0000000 --- a/0005-RH-add-mpathconf.patch +++ /dev/null @@ -1,496 +0,0 @@ ---- - libmultipath/config.c | 3 - multipath/Makefile | 5 - multipath/main.c | 4 - multipath/mpathconf | 312 ++++++++++++++++++++++++++++++++++++++++++++++++++ - multipath/mpathconf.8 | 103 ++++++++++++++++ - 5 files changed, 423 insertions(+), 4 deletions(-) - -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -587,8 +587,7 @@ load_config (char * file) - } else { - init_keywords(); - condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); -- condlog(0, "A default multipath.conf file is located at"); -- condlog(0, "/usr/share/doc/device-mapper-multipath-%d.%d.%d/multipath.conf", MULTIPATH_VERSION(VERSION_CODE)); -+ condlog(0, "run \"/sbin/mpathconf --enable\" to create a default /etc/multipath.conf"); - if (conf->blist_devnode == NULL) { - conf->blist_devnode = vector_alloc(); - if (!conf->blist_devnode) { -Index: multipath-tools-130222/multipath/Makefile -=================================================================== ---- multipath-tools-130222.orig/multipath/Makefile -+++ multipath-tools-130222/multipath/Makefile -@@ -17,22 +17,27 @@ $(EXEC): $(OBJS) - $(CC) $(CFLAGS) $(OBJS) -o $(EXEC) $(LDFLAGS) - $(GZIP) $(EXEC).8 > $(EXEC).8.gz - $(GZIP) $(EXEC).conf.5 > $(EXEC).conf.5.gz -+ $(GZIP) mpathconf.8 > mpathconf.8.gz - - install: - $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/ -+ $(INSTALL_PROGRAM) -m 755 mpathconf $(DESTDIR)$(bindir)/ - $(INSTALL_PROGRAM) -d $(DESTDIR)/lib/udev/rules.d - $(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/lib/udev/rules.d/62-multipath.rules - $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir) - $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir) - $(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir) - $(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5.gz $(DESTDIR)$(man5dir) -+ $(INSTALL_PROGRAM) -m 644 mpathconf.8.gz $(DESTDIR)$(mandir) - - uninstall: - rm $(DESTDIR)/lib/udev/rules.d/62-multipath.rules - rm $(DESTDIR)$(bindir)/$(EXEC) -+ rm $(DESTDIR)$(bindir)/mpathconf - rm $(DESTDIR)$(mandir)/$(EXEC).8.gz - rm $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz -+ rm $(DESTDIR)$(mandir)/mpathconf.8.gz - - clean: - rm -f core *.o $(EXEC) *.gz -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -433,10 +433,10 @@ main (int argc, char *argv[]) - exit(1); - } - -- if (dm_prereq()) -+ if (load_config(DEFAULT_CONFIGFILE)) - exit(1); - -- if (load_config(DEFAULT_CONFIGFILE)) -+ if (dm_prereq()) - exit(1); - - while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:Brtq")) != EOF ) { -Index: multipath-tools-130222/multipath/mpathconf -=================================================================== ---- /dev/null -+++ multipath-tools-130222/multipath/mpathconf -@@ -0,0 +1,312 @@ -+#!/bin/sh -+# -+# Copyright (C) 2010 Red Hat, Inc. All rights reserved. -+# -+# This file is part of the device-mapper-multipath package. -+# -+# This copyrighted material is made available to anyone wishing to use, -+# modify, copy, or redistribute it subject to the terms and conditions -+# of the GNU General Public License v.2. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software Foundation, -+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ -+# -+# Simple editting of /etc/multipath.conf -+# This program was largely ripped off from lvmconf -+# -+ -+unset ENABLE FIND FRIENDLY MODULE MULTIPATHD HAVE_DISABLE HAVE_FIND HAVE_BLACKLIST HAVE_DEFAULTS HAVE_FRIENDLY HAVE_MULTIPATHD HAVE_MODULE SHOW_STATUS CHANGED_CONFIG -+ -+DEFAULT_CONFIGFILE="/usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf" -+CONFIGFILE="/etc/multipath.conf" -+MULTIPATHDIR="/etc/multipath" -+TMPFILE=/etc/multipath/.multipath.conf.tmp -+ -+function usage -+{ -+ echo "usage: $0 " -+ echo "" -+ echo "Commands:" -+ echo "Enable: --enable " -+ echo "Disable: --disable" -+ echo "Set user_friendly_names (Default n): --user_friendly_names " -+ echo "Set find_multipaths (Default n): --find_multipaths " -+ echo "Load the dm-multipath modules on enable (Default y): --with_module " -+ echo "start/stop/reload multipathd (Default n): --with_multipathd " -+ echo "" -+} -+ -+function parse_args -+{ -+ while [ -n "$1" ]; do -+ case $1 in -+ --enable) -+ ENABLE=1 -+ shift -+ ;; -+ --disable) -+ ENABLE=0 -+ shift -+ ;; -+ --user_friendly_names) -+ if [ -n "$2" ]; then -+ FRIENDLY=$2 -+ shift 2 -+ else -+ usage -+ exit 1 -+ fi -+ ;; -+ --find_multipaths) -+ if [ -n "$2" ]; then -+ FIND=$2 -+ shift 2 -+ else -+ usage -+ exit 1 -+ fi -+ ;; -+ --with_module) -+ if [ -n "$2" ]; then -+ MODULE=$2 -+ shift 2 -+ else -+ usage -+ exit 1 -+ fi -+ ;; -+ --with_multipathd) -+ if [ -n "$2" ]; then -+ MULTIPATHD=$2 -+ shift 2 -+ else -+ usage -+ exit 1 -+ fi -+ ;; -+ *) -+ usage -+ exit -+ esac -+ done -+} -+ -+function validate_args -+{ -+ if [ "$ENABLE" = "0" ] && [ -n "$FRIENDLY" -o -n "$FIND" -o -n "$MODULE" ]; then -+ echo "ignoring extra parameters on disable" -+ FRIENDLY="" -+ FIND="" -+ MODULE="" -+ fi -+ if [ -n "$FRIENDLY" ] && [ "$FRIENDLY" != "y" -a "$FRIENDLY" != "n" ]; then -+ echo "--user_friendly_names must be either 'y' or 'n'" -+ exit 1 -+ fi -+ if [ -n "$FIND" ] && [ "$FIND" != "y" -a "$FIND" != "n" ]; then -+ echo "--find_multipaths must be either 'y' or 'n'" -+ exit 1 -+ fi -+ if [ -z "$ENABLE" -a -z "$FIND" -a -z "$FRIENDLY" ]; then -+ SHOW_STATUS=1 -+ fi -+ if [ -n "$MODULE" ] && [ "$MODULE" != "y" -a "$MODULE" != "n" ]; then -+ echo "--with_module must be either 'y' or 'n'" -+ exit 1 -+ fi -+ if [ -n "$MULTIPATHD" ] && [ "$MULTIPATHD" != "y" -a "$MULTIPATHD" != "n" ]; then -+ echo "--with_multipathd must be either 'y' or 'n'" -+ exit 1 -+ fi -+} -+ -+umask 0077 -+ -+parse_args "$@" -+ -+validate_args -+ -+if [ ! -d "$MULTIPATHDIR" ]; then -+ echo "/etc/multipath/ does not exist. failing" -+ exit 1 -+fi -+ -+rm $TMPFILE 2> /dev/null -+if [ -f "$CONFIGFILE" ]; then -+ cp $CONFIGFILE $TMPFILE -+elif [ -f "$DEFAULT_CONFIGFILE" ]; then -+ cp $DEFAULT_CONFIGFILE $TMPFILE -+else -+ touch $TMPFILE -+fi -+ -+if grep -q "^blacklist[[:space:]]*{" $TMPFILE ; then -+ HAVE_BLACKLIST=1 -+fi -+ -+if grep -q "^defaults[[:space:]]*{" $TMPFILE ; then -+ HAVE_DEFAULTS=1 -+fi -+ -+if [ -z "$MODULE" -o "$MODULE" = "y" ]; then -+ if lsmod | grep -q "dm_multipath" ; then -+ HAVE_MODULE=1 -+ else -+ HAVE_MODULE=0 -+ fi -+fi -+ -+if [ "$MULTIPATHD" = "y" ]; then -+ if service multipathd status > /dev/null ; then -+ HAVE_MULTIPATHD=1 -+ else -+ HAVE_MULTIPATHD=0 -+ fi -+fi -+ -+if [ "$HAVE_BLACKLIST" = "1" ]; then -+ if sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*devnode \"\.\?\*\"" ; then -+ HAVE_DISABLE=1 -+ elif sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[#[:space:]]*devnode \"\.\?\*\"" ; then -+ HAVE_DISABLE=0 -+ fi -+fi -+ -+if [ "$HAVE_DEFAULTS" = "1" ]; then -+ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*find_multipaths[[:space:]]*\(yes\|1\)" ; then -+ HAVE_FIND=1 -+ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*find_multipaths[[:space:]]*\(no\|0\)" ; then -+ HAVE_FIND=0 -+ fi -+ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*user_friendly_names[[:space:]]*\(yes\|1\)" ; then -+ HAVE_FRIENDLY=1 -+ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*user_friendly_names[[:space:]]*\(no\|0\)" ; then -+ HAVE_FRIENDLY=0 -+ fi -+fi -+ -+if [ -n "$SHOW_STATUS" ]; then -+ if [ -z "$HAVE_DISABLE" -o "$HAVE_DISABLE" = 0 ]; then -+ echo "multipath is enabled" -+ else -+ echo "multipath is disabled" -+ fi -+ if [ -z "$HAVE_FIND" -o "$HAVE_FIND" = 0 ]; then -+ echo "find_multipaths is disabled" -+ else -+ echo "find_multipaths is enabled" -+ fi -+ if [ -z "$HAVE_FRIENDLY" -o "$HAVE_FRIENDLY" = 0 ]; then -+ echo "user_friendly_names is disabled" -+ else -+ echo "user_friendly_names is enabled" -+ fi -+ if [ -n "$HAVE_MODULE" ]; then -+ if [ "$HAVE_MODULE" = 1 ]; then -+ echo "dm_multipath module is loaded" -+ else -+ echo "dm_multipath module is not loaded" -+ fi -+ fi -+ if [ -n "$HAVE_MULTIPATHD" ]; then -+ service multipathd status -+ fi -+ exit 0 -+fi -+ -+if [ -z "$HAVE_BLACKLIST" ]; then -+ cat >> $TMPFILE <<- _EOF_ -+ -+blacklist { -+} -+_EOF_ -+fi -+ -+if [ -z "$HAVE_DEFAULTS" ]; then -+ cat >> $TMPFILE <<- _EOF_ -+ -+defaults { -+} -+_EOF_ -+fi -+ -+if [ "$ENABLE" = 1 ]; then -+ if [ "$HAVE_DISABLE" = 1 ]; then -+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*devnode \"\.\?\*\"/# devnode ".*"/' $TMPFILE -+ fi -+elif [ "$ENABLE" = 0 ]; then -+ if [ -z "$HAVE_DISABLE" ]; then -+ sed -i '/^blacklist[[:space:]]*{/ a\ -+ devnode "*" -+' $TMPFILE -+ elif [ "$HAVE_DISABLE" = 0 ]; then -+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[#[:space:]]*devnode \"\.\?\*\"/ devnode ".*"/' $TMPFILE -+ fi -+fi -+ -+if [ "$FIND" = "n" ]; then -+ if [ "$HAVE_FIND" = 1 ]; then -+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*find_multipaths[[:space:]]*\(yes\|1\)/ find_multipaths no/' $TMPFILE -+ CHANGED_CONFIG=1 -+ fi -+elif [ "$FIND" = "y" ]; then -+ if [ -z "$HAVE_FIND" ]; then -+ sed -i '/^defaults[[:space:]]*{/ a\ -+ find_multipaths yes -+' $TMPFILE -+ CHANGED_CONFIG=1 -+ elif [ "$HAVE_FIND" = 0 ]; then -+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*find_multipaths[[:space:]]*\(no\|0\)/ find_multipaths yes/' $TMPFILE -+ CHANGED_CONFIG=1 -+ fi -+fi -+ -+if [ "$FRIENDLY" = "n" ]; then -+ if [ "$HAVE_FRIENDLY" = 1 ]; then -+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*user_friendly_names[[:space:]]*\(yes\|1\)/ user_friendly_names no/' $TMPFILE -+ CHANGED_CONFIG=1 -+ fi -+elif [ "$FRIENDLY" = "y" ]; then -+ if [ -z "$HAVE_FRIENDLY" ]; then -+ sed -i '/^defaults[[:space:]]*{/ a\ -+ user_friendly_names yes -+' $TMPFILE -+ CHANGED_CONFIG=1 -+ elif [ "$HAVE_FRIENDLY" = 0 ]; then -+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*user_friendly_names[[:space:]]*\(no\|0\)/ user_friendly_names yes/' $TMPFILE -+ CHANGED_CONFIG=1 -+ fi -+fi -+ -+if [ -f "$CONFIGFILE" ]; then -+ cp $CONFIGFILE $CONFIGFILE.old -+ if [ $? != 0 ]; then -+ echo "failed to backup old config file, $CONFIGFILE not updated" -+ exit 1 -+ fi -+fi -+ -+cp $TMPFILE $CONFIGFILE -+if [ $? != 0 ]; then -+ echo "failed to copy new config file into place, check $CONFIGFILE is still OK" -+ exit 1 -+fi -+ -+rm -f $TMPFILE -+ -+if [ "$ENABLE" = 1 ]; then -+ if [ "$HAVE_MODULE" = 0 ]; then -+ modprobe dm_multipath -+ fi -+ if [ "$HAVE_MULTIPATHD" = 0 ]; then -+ service multipathd start -+ fi -+elif [ "$ENABLE" = 0 ]; then -+ if [ "$HAVE_MULTIPATHD" = 1 ]; then -+ service multipathd stop -+ fi -+elif [ -n "$CHANGED_CONFIG" -a "$HAVE_MULTIPATHD" = 1 ]; then -+ service multipathd reload -+fi -Index: multipath-tools-130222/multipath/mpathconf.8 -=================================================================== ---- /dev/null -+++ multipath-tools-130222/multipath/mpathconf.8 -@@ -0,0 +1,103 @@ -+.TH MPATHCONF 8 "June 2010" "" "Linux Administrator's Manual" -+.SH NAME -+mpathconf - A tool for configuring device-mapper-multipath -+.SH SYNOPSIS -+.B mpathconf -+.RB [\| commands \|] -+.RB [\| options \|] -+.SH DESCRIPTION -+.B mpathconf -+is a utility that creates or modifies -+.B /etc/multipath.conf. -+It can enable or disable multipathing and configure some common options. -+.B mpathconf -+can also load the -+.B dm_multipath -+module, start and stop the -+.B multipathd -+daemon, and configure the -+.B multipathd -+service to start automatically or not. If -+.B mpathconf -+is called with no commands, it will display the current configuration. -+ -+The default options for mpathconf are -+.B --with_module -+The -+.B --with_multipathd -+option is not set by default. Enabling multipathing will load the -+.B dm_multipath -+module but it will not immediately start it. This is so -+that users can manually edit their config file if necessary, before starting -+.B multipathd. -+ -+If -+.B /etc/multipath.conf -+already exists, mpathconf will edit it. If it does not exist, mpathconf will -+use -+.B /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf -+as the starting file. This file has -+.B user_friendly_names -+set. If this file does not exist, mpathconf will create -+.B /etc/multipath.conf -+from scratch. For most users, this means that -+.B user_friendly_names -+will be set by default, unless they use the -+.B --user_friendly_names n -+command. -+.SH COMMANDS -+.TP -+.B --enable -+Removes any line that blacklists all device nodes from the -+.B /etc/multipath.conf -+blacklist section. -+.TP -+.B --disable -+Adds a line that blacklists all device nodes to the -+.B /etc/multipath.conf -+blacklist section. If no blacklist section exists, it will create one. -+.TP -+.B --user_friendly_name \fP { \fBy\fP | \fBn\fP } -+If set to \fBy\fP, this adds the line -+.B user_friendly_names yes -+to the -+.B /etc/multipath.conf -+defaults section. If set to \fBn\fP, this removes the line, if present. This -+command can be used along with any other command. -+.TP -+.B --find_multipaths\fP { \fBy\fP | \fBn\fP } -+If set to \fBy\fP, this adds the line -+.B find_multipaths yes -+to the -+.B /etc/multipath.conf -+defaults section. If set to \fBn\fP, this removes the line, if present. This -+command can be used aldong with any other command. -+.SH OPTIONS -+.TP -+.B --with_module\fP { \fBy\fP | \fBn\fP } -+If set to \fBy\fP, this runs -+.B modprobe dm_multipath -+to install the multipath modules. This option only works with the -+.B --enable -+command. This option is set to \fBy\fP by default. -+.TP -+.B --with_multipathd { \fBy\fP | \fBn\fP } -+If set to \fBy\fP, this runs -+.B service multipathd start -+to start the multipathd daemon on \fB--enable\fP, -+.B service multipathd stop -+to start the multipathd daemon on \fB--disable\fP, and -+.B service multipathd reload -+to reconfigure multipathd on \fB--user_frindly_names\fP and -+\fB--find_multipaths\fP. -+This option is set to \fBn\fP by default. -+.SH FILES -+.BR /etc/multipath.conf -+.SH "SEE ALSO" -+.BR multipath.conf (5), -+.BR modprobe (8), -+.BR multipath (8), -+.BR multipathd (8), -+.BR service (8), -+.SH AUTHOR -+Benjamin Marzinski diff --git a/0005-RH-use-rpm-optflags-if-present.patch b/0005-RH-use-rpm-optflags-if-present.patch new file mode 100644 index 0000000..7a6f57f --- /dev/null +++ b/0005-RH-use-rpm-optflags-if-present.patch @@ -0,0 +1,67 @@ +From bf46f8029998498045bb055415ba3ff515c79eaa Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 19 Apr 2017 06:10:01 -0500 +Subject: [PATCH] RH: use rpm optflags if present + +Use the passed in optflags when compiling as an RPM, and keep the +default flags as close as possible to the current fedora flags, while +still being generic. + +Signed-off-by: Benjamin Marzinski +--- + Makefile.inc | 25 ++++++++++++++++++------- + 1 file changed, 18 insertions(+), 7 deletions(-) + +diff --git a/Makefile.inc b/Makefile.inc +index ead89030..03aee175 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -102,17 +102,29 @@ SYSTEMD_LIBDEPS := $(if $(SYSTEMD),$(if $(shell test $(SYSTEMD) -gt 209 && echo + MODPROBE_UNIT := $(shell test "0$(SYSTEMD)" -lt 245 2>/dev/null || \ + echo "modprobe@dm_multipath.service") + +-OPTFLAGS := -O2 -g $(STACKPROT) --param=ssp-buffer-size=4 ++ifndef RPM_OPT_FLAGS ++ OPTFLAGS := -O2 -g $(STACKPROT) --param=ssp-buffer-size=4 \ ++ -Wall $(FORTIFY_OPT) -fexceptions -grecord-gcc-switches \ ++ -fasynchronous-unwind-tables ++ ifeq ($(shell test -f /usr/lib/rpm/redhat/redhat-hardened-cc1 && echo 1),1) ++ OPTFLAGS += -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 ++ endif ++ ifeq ($(shell test -f /usr/lib/rpm/redhat/redhat-annobin-cc1 && echo 1),1) ++ OPTFLAGS += -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 ++ endif ++else ++ OPTFLAGS := $(RPM_OPT_FLAGS) --param=ssp-buffer-size=4 ++endif + + # Set WARN_ONLY=1 to avoid compilation erroring out due to warnings. Useful during development. + WARN_ONLY := + ERROR := $(if $(WARN_ONLY),,error=) + WERROR := $(if $(WARN_ONLY),,-Werror) +-WARNFLAGS := $(WERROR) -Wall -Wextra -Wformat=2 $(WFORMATOVERFLOW) -W$(ERROR)implicit-int \ ++WARNFLAGS := $(WERROR) -Wextra -Wformat=2 $(WFORMATOVERFLOW) -W$(ERROR)implicit-int \ + -W$(ERROR)implicit-function-declaration -W$(ERROR)format-security \ +- $(WNOCLOBBERED) -W$(ERROR)cast-qual $(ERROR_DISCARDED_QUALIFIERS) $(W_URCU_TYPE_LIMITS) ++ $(WNOCLOBBERED) -W$(ERROR)cast-qual $(ERROR_DISCARDED_QUALIFIERS) $(W_URCU_TYPE_LIMITS) -Wstrict-prototypes + +-CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) \ ++CPPFLAGS := $(CPPFLAGS) $(D_URCU_VERSION) \ + -D_FILE_OFFSET_BITS=64 \ + -DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(TGTDIR)$(plugindir)\" \ + -DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \ +@@ -121,12 +133,11 @@ CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) \ + -DABSTRACT_SOCKET=\"$(abstract_socket)\" -DPATHNAME_SOCKET=\"$(pathname_socket)\" \ + -DWSTRINGOP_TRUNCATION=$(if $(WSTRINGOP_TRUNCATION),1,0) \ + -MMD -MP +-CFLAGS := -std=$(C_STD) $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \ +- -fexceptions ++CFLAGS := -std=$(C_STD) $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe + BIN_CFLAGS := -fPIE -DPIE + LIB_CFLAGS := -fPIC + SHARED_FLAGS := -shared +-LDFLAGS := $(LDFLAGS) -Wl,-z,relro -Wl,-z,now -Wl,-z,defs ++LDFLAGS := $(LDFLAGS) $(RPM_LD_FLAGS) -Wl,-z,relro -Wl,-z,now -Wl,-z,defs + BIN_LDFLAGS := -pie + + # Source code directories. Don't modify. diff --git a/0006-RH-add-find-multipaths.patch b/0006-RH-add-find-multipaths.patch deleted file mode 100644 index 4a0c364..0000000 --- a/0006-RH-add-find-multipaths.patch +++ /dev/null @@ -1,222 +0,0 @@ ---- - libmultipath/config.c | 1 + - libmultipath/config.h | 1 + - libmultipath/configure.c | 11 +++++++++++ - libmultipath/defaults.h | 1 + - libmultipath/dict.c | 34 ++++++++++++++++++++++++++++++++++ - libmultipath/wwids.c | 26 ++++++++++++++++++++++++++ - libmultipath/wwids.h | 1 + - multipath/main.c | 2 +- - multipathd/main.c | 6 ++++++ - 9 files changed, 82 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -547,6 +547,7 @@ load_config (char * file) - conf->reassign_maps = DEFAULT_REASSIGN_MAPS; - conf->checkint = DEFAULT_CHECKINT; - conf->max_checkint = MAX_CHECKINT(conf->checkint); -+ conf->find_multipaths = DEFAULT_FIND_MULTIPATHS; - conf->fast_io_fail = DEFAULT_FAST_IO_FAIL; - conf->retain_hwhandler = DEFAULT_RETAIN_HWHANDLER; - conf->detect_prio = DEFAULT_DETECT_PRIO; -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -508,6 +508,10 @@ coalesce_paths (struct vectors * vecs, v - - memset(empty_buff, 0, WWID_SIZE); - -+ /* ignore refwwid if it's empty */ -+ if (refwwid && !strlen(refwwid)) -+ refwwid = NULL; -+ - if (force_reload) { - vector_foreach_slot (pathvec, pp1, k) { - pp1->mpp = NULL; -@@ -537,6 +541,13 @@ coalesce_paths (struct vectors * vecs, v - if (refwwid && strncmp(pp1->wwid, refwwid, WWID_SIZE)) - continue; - -+ /* If find_multipaths was selected check if the path is valid */ -+ if (conf->find_multipaths && !refwwid && -+ !should_multipath(pp1, pathvec)) { -+ orphan_path(pp1); -+ continue; -+ } -+ - /* - * at this point, we know we really got a new mp - */ -Index: multipath-tools-130222/libmultipath/defaults.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/defaults.h -+++ multipath-tools-130222/libmultipath/defaults.h -@@ -15,6 +15,7 @@ - #define DEFAULT_USER_FRIENDLY_NAMES 0 - #define DEFAULT_VERBOSITY 2 - #define DEFAULT_REASSIGN_MAPS 1 -+#define DEFAULT_FIND_MULTIPATHS 0 - #define DEFAULT_FAST_IO_FAIL 5 - #define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_OFF - #define DEFAULT_DETECT_PRIO DETECT_PRIO_OFF -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -585,6 +585,27 @@ def_reservation_key_handler(vector strve - } - - static int -+def_find_multipaths_handler(vector strvec) -+{ -+ char * buff; -+ -+ buff = set_value(strvec); -+ -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ conf->find_multipaths = 0; -+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) || -+ (strlen(buff) == 1 && !strcmp(buff, "1"))) -+ conf->find_multipaths = 1; -+ -+ FREE(buff); -+ return 0; -+} -+ -+static int - def_names_handler(vector strvec) - { - char * buff; -@@ -2700,6 +2721,18 @@ snprint_def_log_checker_err (char * buff - } - - static int -+snprint_def_find_multipaths (char * buff, int len, void * data) -+{ -+ if (conf->find_multipaths == DEFAULT_FIND_MULTIPATHS) -+ return 0; -+ if (!conf->find_multipaths) -+ return snprintf(buff, len, "no"); -+ -+ return snprintf(buff, len, "yes"); -+} -+ -+ -+static int - snprint_def_user_friendly_names (char * buff, int len, void * data) - { - if (conf->user_friendly_names == USER_FRIENDLY_NAMES_ON) -@@ -2833,6 +2866,7 @@ init_keywords(void) - install_keyword("wwids_file", &wwids_file_handler, &snprint_def_wwids_file); - install_keyword("log_checker_err", &def_log_checker_err_handler, &snprint_def_log_checker_err); - install_keyword("reservation_key", &def_reservation_key_handler, &snprint_def_reservation_key); -+ install_keyword("find_multipaths", &def_find_multipaths_handler, &snprint_def_find_multipaths); - install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler_handler); - install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio); - __deprecated install_keyword("default_selector", &def_selector_handler, NULL); -Index: multipath-tools-130222/libmultipath/wwids.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.c -+++ multipath-tools-130222/libmultipath/wwids.c -@@ -125,6 +125,32 @@ out: - } - - int -+should_multipath(struct path *pp1, vector pathvec) -+{ -+ int i; -+ struct path *pp2; -+ -+ condlog(4, "checking if %s should be multipathed", pp1->dev); -+ vector_foreach_slot(pathvec, pp2, i) { -+ if (pp1->dev == pp2->dev) -+ continue; -+ if (strncmp(pp1->wwid, pp2->wwid, WWID_SIZE) == 0) { -+ condlog(3, "found multiple paths with wwid %s, " -+ "multipathing %s", pp1->wwid, pp1->dev); -+ return 1; -+ } -+ } -+ if (check_wwids_file(pp1->wwid, 0) < 0) { -+ condlog(3, "wwid %s not in wwids file, skipping %s", -+ pp1->wwid, pp1->dev); -+ return 0; -+ } -+ condlog(3, "found wwid %s in wwids file, multipathing %s", pp1->wwid, -+ pp1->dev); -+ return 1; -+} -+ -+int - remember_wwid(char *wwid) - { - int ret = check_wwids_file(wwid, 1); -Index: multipath-tools-130222/libmultipath/wwids.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.h -+++ multipath-tools-130222/libmultipath/wwids.h -@@ -12,6 +12,7 @@ - "#\n" \ - "# Valid WWIDs:\n" - -+int should_multipath(struct path *pp, vector pathvec); - int remember_wwid(char *wwid); - int check_wwids_file(char *wwid, int write_wwid); - -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -333,7 +333,7 @@ configure (void) - /* - * core logic entry point - */ -- r = coalesce_paths(&vecs, NULL, NULL, conf->force_reload); -+ r = coalesce_paths(&vecs, NULL, refwwid, conf->force_reload); - - out: - if (refwwid) -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -49,6 +49,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -471,6 +472,11 @@ rescan: - return 1; - } - -+ if (conf->find_multipaths && -+ !should_multipath(pp, vecs->pathvec)) { -+ orphan_path(pp); -+ return 0; -+ } - condlog(4,"%s: creating new map", pp->dev); - if ((mpp = add_map_with_path(vecs, pp, 1))) { - mpp->action = ACT_CREATE; -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -106,6 +106,7 @@ struct config { - unsigned int dev_loss; - int log_checker_err; - int allow_queueing; -+ int find_multipaths; - uid_t uid; - gid_t gid; - mode_t mode; diff --git a/0006-RH-add-mpathconf.patch b/0006-RH-add-mpathconf.patch new file mode 100644 index 0000000..46f1126 --- /dev/null +++ b/0006-RH-add-mpathconf.patch @@ -0,0 +1,917 @@ +From 29e5c6d6e2177e73d1be2ed2af66c1007487bf60 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 16 Oct 2014 15:49:01 -0500 +Subject: [PATCH] RH: add mpathconf + +mpathconf is a program (largely based on lvmcomf) to help users +configure /etc/multipath.conf and enable or disable multipathing. It +has a couple of built-in options that can be set directly from the +command line. But, mostly it is used to get a multipath.conf file +with the OS defaults, and to enable and disable multipathing via +a single command. + +Co-authored-by: Paul Donohue +Signed-off-by: Benjamin Marzinski +--- + .github/actions/spelling/expect.txt | 3 + + libmultipath/config.c | 2 + + multipath/Makefile | 4 + + multipath/mpathconf | 658 ++++++++++++++++++++++++++++ + multipath/mpathconf.8 | 151 +++++++ + 5 files changed, 818 insertions(+) + create mode 100644 multipath/mpathconf + create mode 100644 multipath/mpathconf.8 + +diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt +index a5856bcc..5c9113ba 100644 +--- a/.github/actions/spelling/expect.txt ++++ b/.github/actions/spelling/expect.txt +@@ -131,9 +131,11 @@ Marzinski + misdetection + mpath + mpathb ++mpathconf + mpathpersist + mpathvalid + msecs ++multipathable + multipathc + multipathd + multipathed +@@ -154,6 +156,7 @@ ontap + OOM + opensvc + OPTFLAGS ++outfile + paramp + partx + pathgroup +diff --git a/libmultipath/config.c b/libmultipath/config.c +index b8317f4d..0bbaa981 100644 +--- a/libmultipath/config.c ++++ b/libmultipath/config.c +@@ -939,6 +939,8 @@ int init_config__ (const char *file, struct config *conf) + validate_pctable(conf->overrides, 0, file); + } else { + condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); ++ condlog(0, "You can run \"/sbin/mpathconf --enable\" to create"); ++ condlog(0, "/etc/multipath.conf. See man mpathconf(8) for more details"); + if (conf->blist_devnode == NULL) { + conf->blist_devnode = vector_alloc(); + if (!conf->blist_devnode) { +diff --git a/multipath/Makefile b/multipath/Makefile +index 2ea9e528..3dc241cc 100644 +--- a/multipath/Makefile ++++ b/multipath/Makefile +@@ -24,6 +24,7 @@ $(EXEC): $(OBJS) $(multipathdir)/libmultipath.so $(mpathcmddir)/libmpathcmd.so + install: + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) + $(Q)$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/ ++ $(Q)$(INSTALL_PROGRAM) -m 755 mpathconf $(DESTDIR)$(bindir)/ + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir) + $(Q)$(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir) + $(Q)$(INSTALL_PROGRAM) -m 644 99-z-dm-mpath-late.rules $(DESTDIR)$(udevrulesdir) +@@ -32,6 +33,7 @@ install: + $(Q)$(INSTALL_PROGRAM) -m 644 tmpfiles.conf $(DESTDIR)$(tmpfilesdir)/multipath.conf + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)/man8 + $(Q)$(INSTALL_PROGRAM) -m 644 $(EXEC).8 $(DESTDIR)$(mandir)/man8 ++ $(Q)$(INSTALL_PROGRAM) -m 644 mpathconf.8 $(DESTDIR)$(mandir)/man8 + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)/man5 + $(Q)$(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5 $(DESTDIR)$(mandir)/man5 + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(modulesloaddir) +@@ -46,12 +48,14 @@ endif + + uninstall: + $(Q)$(RM) $(DESTDIR)$(bindir)/$(EXEC) ++ $(Q)$(RM) $(DESTDIR)$(bindir)/mpathconf + $(Q)$(RM) $(DESTDIR)$(udevrulesdir)/11-dm-mpath.rules + $(Q)$(RM) $(DESTDIR)$(udevrulesdir)/99-z-dm-mpath-late.rules + $(Q)$(RM) $(DESTDIR)$(modulesloaddir)/multipath.conf + $(Q)$(RM) $(DESTDIR)$(modulesloaddir)/scsi_dh.conf + $(Q)$(RM) $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules + $(Q)$(RM) $(DESTDIR)$(mandir)/man8/$(EXEC).8 ++ $(Q)$(RM) $(DESTDIR)$(mandir)/man8/mpathconf.8 + $(Q)$(RM) $(DESTDIR)$(mandir)/man5/$(EXEC).conf.5 + $(Q)$(RM) $(DESTDIR)$(tmpfilesdir)/multipath.conf + +diff --git a/multipath/mpathconf b/multipath/mpathconf +new file mode 100644 +index 00000000..ce430075 +--- /dev/null ++++ b/multipath/mpathconf +@@ -0,0 +1,658 @@ ++#!/bin/bash ++# ++# Copyright (C) 2010 Red Hat, Inc. All rights reserved. ++# ++# This file is part of the device-mapper-multipath package. ++# ++# This copyrighted material is made available to anyone wishing to use, ++# modify, copy, or redistribute it subject to the terms and conditions ++# of the GNU General Public License v.2. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software Foundation, ++# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ ++# ++# Simple editting of /etc/multipath.conf ++# This program was largely ripped off from lvmconf ++# ++ ++unset ENABLE FIND FRIENDLY PROPERTY FOREIGN MODULE MULTIPATHD HAVE_DISABLE HAVE_WWID_DISABLE HAVE_FIND HAVE_BLACKLIST HAVE_EXCEPTIONS HAVE_DEFAULTS HAVE_FRIENDLY HAVE_PROPERTY HAVE_FOREIGN HAVE_MULTIPATHD HAVE_MODULE HAVE_OUTFILE SHOW_STATUS CHANGED_CONFIG WWID_LIST HAVE_OPTION OPTION_NAME OPTION_VALUE HAVE_RECHECK_WWID RECHECK_WWID ++ ++DEFAULT_CONFIG="# device-mapper-multipath configuration file ++ ++# For a complete list of the default configuration values, run either: ++# # multipath -t ++# or ++# # multipathd show config ++ ++# For a list of configuration options with descriptions, see the ++# multipath.conf man page. ++ ++defaults { ++ user_friendly_names yes ++ find_multipaths on ++}" ++ ++CONFIGFILE="/etc/multipath.conf" ++OUTPUTFILE="/etc/multipath.conf" ++MULTIPATHDIR="/etc/multipath" ++TMPFILE="/etc/multipath/.multipath.conf.tmp" ++WWIDS=0 ++ ++function usage ++{ ++ echo "usage: $0 " ++ echo "" ++ echo "Commands:" ++ echo "Enable: --enable " ++ echo "Disable: --disable" ++ echo "Only allow certain wwids (instead of enable): --allow " ++ echo "Set user_friendly_names (Default y): --user_friendly_names " ++ echo "Set find_multipaths (Default on): --find_multipaths " ++ echo "Set default property blacklist (Default n): --property_blacklist " ++ echo "Set enable_foreign to show foreign devices (Default n): --enable_foreign " ++ echo "Set recheck_wwid (Defaut n): --recheck_wwid " ++ echo "Add/Change/Remove option in defaults section: --option :" ++ echo "Load the dm-multipath modules on enable (Default y): --with_module " ++ echo "start/stop/reload multipathd (Default n): --with_multipathd " ++ echo "select output file (Default /etc/multipath.conf): --outfile " ++ echo "" ++} ++ ++function add_wwid ++{ ++ INDEX=0 ++ while [ "$INDEX" -lt "$WWIDS" ] ; do ++ if [ "$1" = "${WWID_LIST[$INDEX]}" ] ; then ++ return ++ fi ++ ((INDEX++)) ++ done ++ WWID_LIST[$WWIDS]="$1" ++ ((WWIDS++)) ++} ++ ++function get_dm_deps ++{ ++ shift 3 ++ while [ -n "$1" -a -n "$2" ]; do ++ MAJOR=$(echo $1 | tr -d '(,') ++ MINOR=$(echo $2 | tr -d ')') ++ UUID=`dmsetup info -c --noheadings -o uuid -j $MAJOR -m $MINOR 2> /dev/null` ++ if [ -n "$UUID" ] ; then ++ set_dm_wwid $UUID ++ fi ++ shift 2 ++ done ++} ++ ++function set_dm_wwid ++{ ++ if [[ "$1" =~ ^part[[:digit:]]+-mpath- ]] ; then ++ add_wwid "${1##part*-mpath-}" ++ elif [[ "$1" =~ ^mpath- ]] ; then ++ add_wwid "${1##mpath-}" ++ else ++ get_dm_deps `dmsetup deps -u $1` ++ fi ++} ++ ++function set_wwid ++{ ++ UUID="" ++ if [[ "$1" =~ ^[[:digit:]]+:[[:digit:]]+$ ]] ; then ++ MAJOR=${1%%:*} ++ MINOR=${1##*:} ++ UUID=`dmsetup info -c --noheadings -o uuid -j $MAJOR -m $MINOR 2> /dev/null` ++ else ++ UUID=`dmsetup info -c --noheadings -o uuid $1 2> /dev/null` ++ fi ++ if [ -n "$UUID" ] ; then ++ set_dm_wwid $UUID ++ else ++ add_wwid "$1" ++ fi ++} ++ ++function parse_args ++{ ++ while [ -n "$1" ]; do ++ case $1 in ++ --enable) ++ ENABLE=1 ++ shift ++ ;; ++ --disable) ++ ENABLE=0 ++ shift ++ ;; ++ --allow) ++ ENABLE=2 ++ if [ -n "$2" ]; then ++ set_wwid $2 ++ shift 2 ++ else ++ usage ++ exit 1 ++ fi ++ ;; ++ --user_friendly_names) ++ if [ -n "$2" ]; then ++ FRIENDLY=$2 ++ shift 2 ++ else ++ usage ++ exit 1 ++ fi ++ ;; ++ --recheck_wwid) ++ if [ -n "$2" ]; then ++ RECHECK_WWID=$2 ++ shift 2 ++ else ++ usage ++ exit 1 ++ fi ++ ;; ++ --find_multipaths) ++ if [ -n "$2" ]; then ++ FIND=$2 ++ shift 2 ++ else ++ usage ++ exit 1 ++ fi ++ ;; ++ --property_blacklist) ++ if [ -n "$2" ]; then ++ PROPERTY=$2 ++ shift 2 ++ else ++ usage ++ exit 1 ++ fi ++ ;; ++ --option) ++ if [ -n "$2" ]; then ++ OPTION_NAME=$(echo $2 | cut -s -f1 -d:) ++ OPTION_VALUE=$(echo $2 | cut -s -f2 -d:) ++ if [ -z "$OPTION_NAME" ]; then ++ usage ++ exit 1 ++ fi ++ shift 2 ++ else ++ usage ++ exit 1 ++ fi ++ ;; ++ --enable_foreign) ++ if [ -n "$2" ]; then ++ FOREIGN=$2 ++ shift 2 ++ else ++ usage ++ exit 1 ++ fi ++ ;; ++ --with_module) ++ if [ -n "$2" ]; then ++ MODULE=$2 ++ shift 2 ++ else ++ usage ++ exit 1 ++ fi ++ ;; ++ --with_multipathd) ++ if [ -n "$2" ]; then ++ MULTIPATHD=$2 ++ shift 2 ++ else ++ usage ++ exit 1 ++ fi ++ ;; ++ --outfile) ++ if [ -n "$2" ]; then ++ OUTPUTFILE=$2 ++ HAVE_OUTFILE=1 ++ shift 2 ++ else ++ usage ++ exit 1 ++ fi ++ ;; ++ *) ++ usage ++ exit ++ esac ++ done ++} ++ ++function validate_args ++{ ++ if [ "$ENABLE" = "0" ] && [ -n "$FRIENDLY" -o -n "$FIND" -o -n "$PROPERTY" -o -n "$MODULE" -o -n "$FOREIGN" -o -n "$OPTION_NAME" -o -n "$RECHECK_WWID" ]; then ++ echo "ignoring extra parameters on disable" ++ FRIENDLY="" ++ FIND="" ++ PROPERTY="" ++ MODULE="" ++ FOREIGN="" ++ OPTION_NAME="" ++ OPTION_VALUE="" ++ RECHECK_WWID="" ++ fi ++ if [ -n "$FRIENDLY" ] && [ "$FRIENDLY" != "y" -a "$FRIENDLY" != "n" ]; then ++ echo "--user_friendly_names must be either 'y' or 'n'" ++ exit 1 ++ fi ++ if [ -n "$RECHECK_WWID" ] && [ "$RECHECK_WWID" != "y" -a "$RECHECK_WWID" != "n" ]; then ++ echo "--recheck_wwid must be either 'y' or 'n'" ++ exit 1 ++ fi ++ if [ "$FIND" = "y" ]; then ++ FIND="on" ++ elif [ "$FIND" = "n" ]; then ++ FIND="off" ++ elif [ -n "$FIND" ] && [ "$FIND" != "on" -a "$FIND" != "yes" -a "$FIND" != "off" -a "$FIND" != "no" -a "$FIND" != "strict" -a "$FIND" != "greedy" -a "$FIND" != "smart" ]; then ++ echo "--find_multipaths must be one of 'on' 'yes' 'y' 'off' 'no' 'n' 'strict' 'greedy' or 'smart'" ++ exit 1 ++ fi ++ if [ -n "$PROPERTY" ] && [ "$PROPERTY" != "y" -a "$PROPERTY" != "n" ]; then ++ echo "--property_blacklist must be either 'y' or 'n'" ++ exit 1 ++ fi ++ if [ -n "$FOREIGN" ] && [ "$FOREIGN" != "y" -a "$FOREIGN" != "n" ]; then ++ echo "--enable_foreign must be either 'y' or 'n'" ++ exit 1 ++ fi ++ if [ -n "$OPTION_NAME" ]; then ++ if [[ $OPTION_NAME =~ [[:space:]]|#|\"|!|\{|\} ]]; then ++ echo "--option name \"$OPTION_NAME\" is invalid" ++ exit 1 ++ elif [[ $OPTION_VALUE =~ \"|#|!|\{|\} ]]; then ++ echo "--option value \"$OPTION_VALUE\" is invalid" ++ exit 1 ++ fi ++ if [[ $OPTION_VALUE =~ [[:space:]] ]]; then ++ OPTION_VALUE=\"$OPTION_VALUE\" ++ fi ++ fi ++ if [ -z "$ENABLE" -a -z "$FIND" -a -z "$FRIENDLY" -a -z "$PROPERTY" -a -z "$FOREIGN" -a -z "$OPTION_NAME" -a -z "$RECHECK_WWID" ]; then ++ SHOW_STATUS=1 ++ fi ++ if [ -n "$MODULE" ] && [ "$MODULE" != "y" -a "$MODULE" != "n" ]; then ++ echo "--with_module must be either 'y' or 'n'" ++ exit 1 ++ fi ++ if [ -n "$MULTIPATHD" ] && [ "$MULTIPATHD" != "y" -a "$MULTIPATHD" != "n" ]; then ++ echo "--with_multipathd must be either 'y' or 'n'" ++ exit 1 ++ fi ++ if [ "$ENABLE" = 2 -a -z "$HAVE_OUTFILE" ]; then ++ echo "Because --allow makes changes that cannot be automatically reversed," ++ echo "you must set --outfile when you set --allow" ++ exit 1 ++ fi ++} ++ ++function add_blacklist_exceptions ++{ ++ INDEX=0 ++ while [ "$INDEX" -lt "$WWIDS" ] ; do ++ sed -i '/^blacklist_exceptions[[:space:]]*{/ a\ ++ wwid '"\"${WWID_LIST[$INDEX]}\""' ++' $TMPFILE ++ ((INDEX++)) ++ done ++} ++ ++umask 0077 ++ ++parse_args "$@" ++ ++validate_args ++ ++if [ ! -d "$MULTIPATHDIR" ]; then ++ echo "/etc/multipath/ does not exist. failing" ++ exit 1 ++fi ++ ++rm $TMPFILE 2> /dev/null ++echo "$DEFAULT_CONFIG" > $TMPFILE ++if [ -f "$CONFIGFILE" ]; then ++ cp $CONFIGFILE $TMPFILE ++fi ++ ++if grep -q "^blacklist[[:space:]]*{" $TMPFILE ; then ++ HAVE_BLACKLIST=1 ++fi ++ ++if grep -q "^blacklist_exceptions[[:space:]]*{" $TMPFILE ; then ++ HAVE_EXCEPTIONS=1 ++fi ++ ++if grep -q "^defaults[[:space:]]*{" $TMPFILE ; then ++ HAVE_DEFAULTS=1 ++fi ++ ++if [ -z "$MODULE" -o "$MODULE" = "y" ]; then ++ if lsmod | grep -q "dm_multipath" ; then ++ HAVE_MODULE=1 ++ else ++ HAVE_MODULE=0 ++ fi ++fi ++ ++if [ "$MULTIPATHD" = "y" ]; then ++ if /bin/systemctl status multipathd.service > /dev/null 2>&1 ; then ++ HAVE_MULTIPATHD=1 ++ else ++ HAVE_MULTIPATHD=0 ++ fi ++fi ++ ++if [ "$HAVE_BLACKLIST" = "1" ]; then ++ if sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*devnode[[:space:]][[:space:]]*\"\.\?\*\"" ; then ++ HAVE_DISABLE=1 ++ elif sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[[:space:]]*devnode[[:space:]][[:space:]]*\"\.\?\*\"" ; then ++ HAVE_DISABLE=0 ++ fi ++fi ++ ++if [ "$HAVE_BLACKLIST" = "1" ]; then ++ if sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*wwid[[:space:]][[:space:]]*\"\.\?\*\"" ; then ++ HAVE_WWID_DISABLE=1 ++ elif sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[[:space:]]*wwid[[:space:]][[:space:]]*\"\.\?\*\"" ; then ++ HAVE_WWID_DISABLE=0 ++ fi ++fi ++ ++if [ "$HAVE_DEFAULTS" = "1" ]; then ++ HAVE_FIND=`sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | sed -n 's/^[[:blank:]]*find_multipaths[[:blank:]][[:blank:]]*\([^[:blank:]]*\).*$/\1/p' | sed -n 1p` ++ if [ "$HAVE_FIND" = "1" ]; then ++ HAVE_FIND="yes" ++ elif [ "$HAVE_FIND" = "0" ]; then ++ HAVE_FIND="no" ++ fi ++ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*user_friendly_names[[:space:]][[:space:]]*\(yes\|1\)" ; then ++ HAVE_FRIENDLY=1 ++ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*user_friendly_names[[:space:]][[:space:]]*\(no\|0\)" ; then ++ HAVE_FRIENDLY=0 ++ fi ++ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*recheck_wwid[[:space:]][[:space:]]*\(yes\|1\)" ; then ++ HAVE_RECHECK_WWID=1 ++ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*recheck_wwid[[:space:]][[:space:]]*\(no\|0\)" ; then ++ HAVE_RECHECK_WWID=0 ++ fi ++ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[[:space:]]*enable_foreign" ; then ++ HAVE_FOREIGN=0 ++ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*enable_foreign[[:space:]][[:space:]]*\"\.\*\"" ; then ++ HAVE_FOREIGN=1 ++ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*enable_foreign[[:space:]][[:space:]]*\"\^\$\"" ; then ++ HAVE_FOREIGN=2 ++ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*enable_foreign[[:space:]][[:space:]]*\"NONE\"" ; then ++ HAVE_FOREIGN=2 ++ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*enable_foreign" ; then ++ HAVE_FOREIGN=3 ++ fi ++ if [ -n "$OPTION_NAME" ]; then ++ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q '^[[:space:]]*'"$OPTION_NAME"'[[:space:]][[:space:]]*'"$OPTION_VALUE" ; then ++ HAVE_OPTION=1 ++ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q '^[[:space:]]*'"$OPTION_NAME"'\([[:space:]].*\)\?$' ; then ++ HAVE_OPTION=0 ++ fi ++ fi ++fi ++ ++if [ "$HAVE_EXCEPTIONS" = "1" ]; then ++ if sed -n '/^blacklist_exceptions[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*property[[:space:]][[:space:]]*\"(SCSI_IDENT_|ID_WWN)\"" ; then ++ HAVE_PROPERTY=1 ++ elif sed -n '/^blacklist_exceptions[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[[:space:]]*property[[:space:]][[:space:]]*\"(SCSI_IDENT_|ID_WWN)\"" ; then ++ HAVE_PROPERTY=0 ++ fi ++fi ++ ++if [ -n "$SHOW_STATUS" ]; then ++ if [ -z "$HAVE_DISABLE" -o "$HAVE_DISABLE" = 0 ]; then ++ echo "multipath is enabled" ++ else ++ echo "multipath is disabled" ++ fi ++ if [ -z "$HAVE_FIND" ]; then ++ echo "find_multipaths is off" ++ else ++ echo "find_multipaths is $HAVE_FIND" ++ fi ++ if [ -z "$HAVE_FRIENDLY" -o "$HAVE_FRIENDLY" = 0 ]; then ++ echo "user_friendly_names is disabled" ++ else ++ echo "user_friendly_names is enabled" ++ fi ++ if [ -z "$HAVE_RECHECK_WWID" -o "$HAVE_RECHECK_WWID" = 0 ]; then ++ echo "recheck_wwid is disabled" ++ else ++ echo "recheck_wwid is enabled" ++ fi ++ if [ -z "$HAVE_PROPERTY" -o "$HAVE_PROPERTY" = 0 ]; then ++ echo "default property blacklist is disabled" ++ else ++ echo "default property blacklist is enabled" ++ fi ++ if [ -z "$HAVE_FOREIGN" -o "$HAVE_FOREIGN" = 0 ]; then ++ echo "enable_foreign is not set (no foreign multipath devices will be shown)" ++ elif [ "$HAVE_FOREIGN" = 1 ]; then ++ echo "enable_foreign is set (all foreign multipath devices will be shown)" ++ elif [ "$HAVE_FOREIGN" = 2 ]; then ++ echo "enable_foreign is set (no foreign multipath devices will be shown)" ++ else ++ echo "enable_foreign is set (foreign multipath devices may not be shown)" ++ fi ++ if [ -n "$HAVE_MODULE" ]; then ++ if [ "$HAVE_MODULE" = 1 ]; then ++ echo "dm_multipath module is loaded" ++ else ++ echo "dm_multipath module is not loaded" ++ fi ++ fi ++ if [ -z "$HAVE_MULTIPATHD" ]; then ++ if /bin/systemctl status multipathd.service > /dev/null 2>&1 ; then ++ HAVE_MULTIPATHD=1 ++ else ++ HAVE_MULTIPATHD=0 ++ fi ++ fi ++ if [ "$HAVE_MULTIPATHD" = 1 ]; then ++ echo "multipathd is running" ++ else ++ echo "multipathd is not running" ++ fi ++ exit 0 ++fi ++ ++if [ -z "$HAVE_BLACKLIST" ]; then ++ cat >> $TMPFILE <<- _EOF_ ++ ++blacklist { ++} ++_EOF_ ++fi ++ ++if [ -z "$HAVE_DEFAULTS" ]; then ++ cat >> $TMPFILE <<- _EOF_ ++ ++defaults { ++} ++_EOF_ ++fi ++ ++if [ "$ENABLE" = 2 ]; then ++ if [ "$HAVE_DISABLE" = 1 ]; then ++ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*devnode[[:space:]][[:space:]]*\"\.\?\*\"/# devnode ".*"/' $TMPFILE ++ fi ++ if [ -z "$HAVE_WWID_DISABLE" ]; then ++ sed -i '/^blacklist[[:space:]]*{/ a\ ++ wwid ".*" ++' $TMPFILE ++ elif [ "$HAVE_WWID_DISABLE" = 0 ]; then ++ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[[:space:]]*wwid[[:space:]][[:space:]]*\"\.\?\*\"/ wwid ".*"/' $TMPFILE ++ fi ++ if [ "$HAVE_EXCEPTIONS" = 1 ]; then ++ sed -i '/^blacklist_exceptions[[:space:]]*{/,/^}/ {/^[[:space:]]*wwid/ d}' $TMPFILE ++ else ++ cat >> $TMPFILE <<- _EOF_ ++ ++blacklist_exceptions { ++} ++_EOF_ ++ fi ++ add_blacklist_exceptions ++elif [ "$ENABLE" = 1 ]; then ++ if [ "$HAVE_DISABLE" = 1 ]; then ++ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*devnode[[:space:]][[:space:]]*\"\.\?\*\"/# devnode ".*"/' $TMPFILE ++ fi ++elif [ "$ENABLE" = 0 ]; then ++ if [ -z "$HAVE_DISABLE" ]; then ++ sed -i '/^blacklist[[:space:]]*{/ a\ ++ devnode ".*" ++' $TMPFILE ++ elif [ "$HAVE_DISABLE" = 0 ]; then ++ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[[:space:]]*devnode[[:space:]][[:space:]]*\"\.\?\*\"/ devnode ".*"/' $TMPFILE ++ fi ++fi ++ ++if [ -n "$FIND" ]; then ++ if [ -z "$HAVE_FIND" ]; then ++ sed -i '/^defaults[[:space:]]*{/ a\ ++ find_multipaths '"$FIND"' ++' $TMPFILE ++ CHANGED_CONFIG=1 ++ elif [ "$FIND" != "$HAVE_FIND" ]; then ++ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:blank:]]*find_multipaths[[:blank:]][[:blank:]]*[^[:blank:]]*/ find_multipaths '"$FIND"'/' $TMPFILE ++ CHANGED_CONFIG=1 ++ fi ++fi ++ ++if [ "$FRIENDLY" = "n" ]; then ++ if [ "$HAVE_FRIENDLY" = 1 ]; then ++ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*user_friendly_names[[:space:]][[:space:]]*\(yes\|1\)/ user_friendly_names no/' $TMPFILE ++ CHANGED_CONFIG=1 ++ fi ++elif [ "$FRIENDLY" = "y" ]; then ++ if [ -z "$HAVE_FRIENDLY" ]; then ++ sed -i '/^defaults[[:space:]]*{/ a\ ++ user_friendly_names yes ++' $TMPFILE ++ CHANGED_CONFIG=1 ++ elif [ "$HAVE_FRIENDLY" = 0 ]; then ++ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*user_friendly_names[[:space:]][[:space:]]*\(no\|0\)/ user_friendly_names yes/' $TMPFILE ++ CHANGED_CONFIG=1 ++ fi ++fi ++ ++if [ "$RECHECK_WWID" = "n" ]; then ++ if [ "$HAVE_RECHECK_WWID" = 1 ]; then ++ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*recheck_wwid[[:space:]][[:space:]]*\(yes\|1\)/ recheck_wwid no/' $TMPFILE ++ CHANGED_CONFIG=1 ++ fi ++elif [ "$RECHECK_WWID" = "y" ]; then ++ if [ -z "$HAVE_RECHECK_WWID" ]; then ++ sed -i '/^defaults[[:space:]]*{/ a\ ++ recheck_wwid yes ++' $TMPFILE ++ CHANGED_CONFIG=1 ++ elif [ "$HAVE_RECHECK_WWID" = 0 ]; then ++ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*recheck_wwid[[:space:]][[:space:]]*\(no\|0\)/ recheck_wwid yes/' $TMPFILE ++ CHANGED_CONFIG=1 ++ fi ++fi ++ ++if [ "$PROPERTY" = "n" ]; then ++ if [ "$HAVE_PROPERTY" = 1 ]; then ++ sed -i '/^blacklist_exceptions[[:space:]]*{/,/^}/ s/^[[:space:]]*property[[:space:]][[:space:]]*\"(SCSI_IDENT_|ID_WWN)\"/# property \"(SCSI_IDENT_|ID_WWN)\"/' $TMPFILE ++ CHANGED_CONFIG=1 ++ fi ++elif [ "$PROPERTY" = "y" ]; then ++ if [ -z "$HAVE_PROPERTY" -a -z "$HAVE_EXCEPTIONS" ]; then ++ cat >> $TMPFILE << _EOF_ ++ ++blacklist_exceptions { ++ property "(SCSI_IDENT_|ID_WWN)" ++} ++_EOF_ ++ CHANGED_CONFIG=1 ++ elif [ -z "$HAVE_PROPERTY" ]; then ++ sed -i '/^blacklist_exceptions[[:space:]]*{/ a\ ++ property "(SCSI_IDENT_|ID_WWN)" ++' $TMPFILE ++ CHANGED_CONFIG=1 ++ elif [ "$HAVE_PROPERTY" = 0 ]; then ++ sed -i '/^blacklist_exceptions[[:space:]]*{/,/^}/ s/^[[:space:]]*#[[:space:]]*property[[:space:]][[:space:]]*\"(SCSI_IDENT_|ID_WWN)\"/ property \"(SCSI_IDENT_|ID_WWN)\"/' $TMPFILE ++ CHANGED_CONFIG=1 ++ fi ++fi ++ ++if [ "$FOREIGN" = "n" ]; then ++ if [ "$HAVE_FOREIGN" = 1 -o "$HAVE_FOREIGN" = 3 ]; then ++ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*enable_foreign/# enable_foreign/' $TMPFILE ++ CHANGED_CONFIG=1 ++ fi ++elif [ "$FOREIGN" = "y" ]; then ++ if [ -z "$HAVE_FOREIGN" ]; then ++ sed -i '/^defaults[[:space:]]*{/ a\ ++ enable_foreign ".*" ++' $TMPFILE ++ CHANGED_CONFIG=1 ++ elif [ "$HAVE_FOREIGN" = 0 -o "$HAVE_FOREIGN" = 2 -o "$HAVE_FOREIGN" = 3 ]; then ++ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*#\?[[:space:]]*enable_foreign.*$/ enable_foreign ".*"/' $TMPFILE ++ CHANGED_CONFIG=1 ++ fi ++fi ++ ++if [ -n "$OPTION_NAME" -a -n "$OPTION_VALUE" ]; then ++ if [ -z "$HAVE_OPTION" ]; then ++ sed -i '/^defaults[[:space:]]*{/ a\ ++ '"$OPTION_NAME"' '"$OPTION_VALUE"' ++' $TMPFILE ++ CHANGED_CONFIG=1 ++ elif [ "$HAVE_OPTION" = 0 ]; then ++ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*'"$OPTION_NAME"'\([[:space:]].*\)\?$/ '"$OPTION_NAME"' '"$OPTION_VALUE"'/' $TMPFILE ++ CHANGED_CONFIG=1 ++ fi ++elif [ -n "$OPTION_NAME" -a -n "$HAVE_OPTION" ]; then ++ sed -i '/^defaults[[:space:]]*{/,/^}/{/^[[:space:]]*'"$OPTION_NAME"'\([[:space:]].*\)\?$/d}' $TMPFILE ++ CHANGED_CONFIG=1 ++fi ++ ++if [ -f "$OUTPUTFILE" ]; then ++ cp $OUTPUTFILE $OUTPUTFILE.old ++ if [ $? != 0 ]; then ++ echo "failed to backup old config file, $OUTPUTFILE not updated" ++ exit 1 ++ fi ++fi ++ ++cp $TMPFILE $OUTPUTFILE ++if [ $? != 0 ]; then ++ echo "failed to copy new config file into place, check $OUTPUTFILE is still OK" ++ exit 1 ++fi ++ ++rm -f $TMPFILE ++ ++if [ "$ENABLE" = 1 ]; then ++ if [ "$HAVE_MODULE" = 0 ]; then ++ modprobe dm_multipath ++ fi ++ if [ "$HAVE_MULTIPATHD" = 0 ]; then ++ systemctl start multipathd.service ++ fi ++elif [ "$ENABLE" = 0 ]; then ++ if [ "$HAVE_MULTIPATHD" = 1 ]; then ++ systemctl stop multipathd.service ++ fi ++elif [ -n "$CHANGED_CONFIG" -a "$HAVE_MULTIPATHD" = 1 ]; then ++ systemctl reload multipathd.service ++fi +diff --git a/multipath/mpathconf.8 b/multipath/mpathconf.8 +new file mode 100644 +index 00000000..ec4e5c56 +--- /dev/null ++++ b/multipath/mpathconf.8 +@@ -0,0 +1,151 @@ ++.TH MPATHCONF 8 "June 2010" "" "Linux Administrator's Manual" ++.SH NAME ++mpathconf - A tool for configuring device-mapper-multipath ++.SH SYNOPSIS ++.B mpathconf ++.RB [\| commands \|] ++.RB [\| options \|] ++.SH DESCRIPTION ++.B mpathconf ++is a utility that creates or modifies ++.B /etc/multipath.conf. ++It can enable or disable multipathing and configure some common options. ++.B mpathconf ++can also load the ++.B dm_multipath ++module, start and stop the ++.B multipathd ++daemon, and configure the ++.B multipathd ++service to start automatically or not. If ++.B mpathconf ++is called with no commands, it will display the current configuration, but ++will not create of modify ++.B /etc/multipath.conf ++ ++The default options for mpathconf are ++.B --with_module ++The ++.B --with_multipathd ++option is not set by default. Enabling multipathing will load the ++.B dm_multipath ++module but it will not immediately start it. This is so ++that users can manually edit their config file if necessary, before starting ++.B multipathd. ++ ++If ++.B /etc/multipath.conf ++already exists, mpathconf will edit it. If it does not exist, mpathconf will ++create a default file with ++.B user_friendly_names ++set and ++.B find_multipaths ++set to \fBon\fP. To disable these, use the ++.B --user_friendly_names n ++and ++.B --find_multipaths off ++options ++.SH COMMANDS ++.TP ++.B --enable ++Removes any line that blacklists all device nodes from the ++.B /etc/multipath.conf ++blacklist section. Also, creates ++.B /etc/multipath.conf ++if it doesn't exist. ++.TP ++.B --disable ++Adds a line that blacklists all device nodes to the ++.B /etc/multipath.conf ++blacklist section. If no blacklist section exists, it will create one. ++.TP ++.B --allow \fB\fP ++Modifies the \fB/etc/multipath/conf\fP blacklist to blacklist all ++wwids and the blacklist_exceptions to whitelist \fB\fP. \fB\fP ++can be in the form of MAJOR:MINOR, a wwid, or the name of a device-mapper ++device, either a multipath device, or any device on stacked on top of one or ++more multipath devices. This command can be used multiple times to allow ++multiple devices. \fBNOTE:\fP This action will create a configuration file that ++mpathconf will not be able to revert back to its previous state. Because ++of this, \fB--outfile\fP is required when using \fB--allow\fP. ++.TP ++.B --user_friendly_names \fP { \fBy\fP | \fBn\fP } ++If set to \fBy\fP, this adds the line ++.B user_friendly_names yes ++to the ++.B /etc/multipath.conf ++defaults section. If set to \fBn\fP, this removes the line, if present. This ++command can be used along with any other command. ++.TP ++.B --recheck_wwid \fP { \fBy\fP | \fBn\fP } ++If set to \fBy\fP, this adds the line ++.B recheck_wwid yes ++to the ++.B /etc/multipath.conf ++defaults section, or sets an existing line to \fByes\fP. If set to \fBn\fP, this ++sets an existing \fBrecheck_wwid\fP line to \fBno\fP. This command can be used ++along with any other command. ++.TP ++.B --find_multipaths\fP { \fBon\fP | \fByes\fP | \fBy\fP | \fBoff\fP | \fBno\fP | \fBn\fP | \fBstrict\fP | \fBgreedy\fP | \fBsmart\fP } ++If set to \fB\fP, this adds the line ++.B find_multipaths ++to the ++.B /etc/multipath.conf ++defaults section. This command can be used along with any other command. ++\fBy\fP and \fBn\fP can be used instead of \fByes\fP and \fBno\fP. ++.TP ++.B --property_blacklist \fP { \fBy\fP | \fBn\fP } ++If set to \fBy\fP, this adds the line ++.B property "(SCSI_IDENT_|ID_WWN)" ++to the ++.B /etc/multipath.conf ++blacklist_exceptions section. If set to \fBn\fP, this removes the line, if ++present. This command can be used along with any other command. ++.TP ++.B --enable_foreign\fP { \fBy\fP | \fBn\fP } ++If set to \fBy\fP, this adds the line ++.B enable_foreign ".*" ++to the ++.B /etc/multipath.conf ++defaults section. if set to \fBn\fP, this removes the line, if present. This ++command can be used along with any other command. ++.TP ++.B --option \fB:[]\fP ++Sets the defaults section option \fB\fP to \fB\fP. If the ++option was not previously set in the defaults section, it is added. If it was ++set, its value is changed to \fB\fP. If \fB\fP is left blank, ++then the option is removed from the defaults section, if was set there. This ++command can be used along with any other command. ++.TP ++.B --outfile \fB\fP ++Write the resulting multipath configuration to \fB\fP instead of ++\fB/etc/multipath.conf\fP. ++.SH OPTIONS ++.TP ++.B --with_module\fP { \fBy\fP | \fBn\fP } ++If set to \fBy\fP, this runs ++.B modprobe dm_multipath ++to install the multipath modules. This option only works with the ++.B --enable ++command. This option is set to \fBy\fP by default. ++.TP ++.B --with_multipathd { \fBy\fP | \fBn\fP } ++If set to \fBy\fP, this runs ++.B service multipathd start ++to start the multipathd daemon on \fB--enable\fP, ++.B service multipathd stop ++to stop the multipathd daemon on \fB--disable\fP, and ++.B service multipathd reload ++to reconfigure multipathd on \fB--user_friendly_names\fP and ++\fB--find_multipaths\fP. ++This option is set to \fBn\fP by default. ++.SH FILES ++.BR /etc/multipath.conf ++.SH "SEE ALSO" ++.BR multipath.conf (5), ++.BR modprobe (8), ++.BR multipath (8), ++.BR multipathd (8), ++.BR service (8), ++.SH AUTHOR ++Benjamin Marzinski diff --git a/0007-RH-add-hp_tur-checker.patch b/0007-RH-add-hp_tur-checker.patch deleted file mode 100644 index bc8d73b..0000000 --- a/0007-RH-add-hp_tur-checker.patch +++ /dev/null @@ -1,274 +0,0 @@ ---- - libmultipath/checkers.h | 3 + - libmultipath/checkers/Makefile | 4 + - libmultipath/checkers/tur.c | 123 +++++++++++++++++++++++++++++++++++++++-- - multipath.conf.annotated | 5 + - 4 files changed, 128 insertions(+), 7 deletions(-) - -Index: multipath-tools-120613/libmultipath/checkers.h -=================================================================== ---- multipath-tools-120613.orig/libmultipath/checkers.h -+++ multipath-tools-120613/libmultipath/checkers.h -@@ -60,6 +60,7 @@ enum path_check_state { - - #define DIRECTIO "directio" - #define TUR "tur" -+#define HP_TUR "hp_tur" - #define HP_SW "hp_sw" - #define RDAC "rdac" - #define EMC_CLARIION "emc_clariion" -@@ -77,6 +78,7 @@ enum path_check_state { - #define CHECKER_MSG_LEN 256 - #define CHECKER_DEV_LEN 256 - #define LIB_CHECKER_NAMELEN 256 -+#define WWID_SIZE 128 - - struct checker { - struct list_head node; -@@ -88,6 +90,7 @@ struct checker { - int disable; - char name[CHECKER_NAME_LEN]; - char message[CHECKER_MSG_LEN]; /* comm with callers */ -+ char wwid[WWID_SIZE]; /* LUN wwid */ - void * context; /* store for persistent data */ - void ** mpcontext; /* store for persistent data shared - multipath-wide. Use MALLOC if -Index: multipath-tools-120613/libmultipath/checkers/Makefile -=================================================================== ---- multipath-tools-120613.orig/libmultipath/checkers/Makefile -+++ multipath-tools-120613/libmultipath/checkers/Makefile -@@ -8,6 +8,7 @@ LIBS= \ - libcheckcciss_tur.so \ - libcheckreadsector0.so \ - libchecktur.so \ -+ libcheckhp_tur.so \ - libcheckdirectio.so \ - libcheckemc_clariion.so \ - libcheckhp_sw.so \ -@@ -23,6 +24,9 @@ libcheckdirectio.so: libsg.o directio.o - libcheck%.so: libsg.o %.o - $(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^ - -+hp_tur.o: tur.c -+ $(CC) $(CFLAGS) -DCHECK_WWID -c -o $@ $< -+ - install: - $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(libdir) - -Index: multipath-tools-120613/libmultipath/checkers/tur.c -=================================================================== ---- multipath-tools-120613.orig/libmultipath/checkers/tur.c -+++ multipath-tools-120613/libmultipath/checkers/tur.c -@@ -24,12 +24,101 @@ - #define TUR_CMD_LEN 6 - #define HEAVY_CHECK_COUNT 10 - -+#ifdef CHECK_WWID -+#define MSG_TUR_UP "HP tur checker reports path is up" -+#define MSG_TUR_DOWN "HP tur checker reports path is down" -+#define MSG_TUR_GHOST "HP tur checker reports path is in standby state" -+#define MSG_TUR_RUNNING "HP tur checker still running" -+#define MSG_TUR_TIMEOUT "HP tur checker timed out" -+#define MSG_TUR_FAILED "HP tur checker failed to initialize" -+#define EVPD 0x01 -+#define PAGE_83 0x83 -+#define INQUIRY_CMD 0x12 -+#define INQUIRY_CMDLEN 6 -+#define SCSI_INQ_BUFF_LEN 96 -+#else - #define MSG_TUR_UP "tur checker reports path is up" - #define MSG_TUR_DOWN "tur checker reports path is down" - #define MSG_TUR_GHOST "tur checker reports path is in standby state" - #define MSG_TUR_RUNNING "tur checker still running" - #define MSG_TUR_TIMEOUT "tur checker timed out" - #define MSG_TUR_FAILED "tur checker failed to initialize" -+#endif -+ -+#ifdef CHECK_WWID -+static int -+do_inq(int fd, unsigned int timeout, char * wwid) -+{ -+ int ret = -1; -+ unsigned char inq_cmd[INQUIRY_CMDLEN] = -+ {INQUIRY_CMD, EVPD, PAGE_83, 0, SCSI_INQ_BUFF_LEN, 0 }; -+ unsigned char sense_buffer[32]; -+ unsigned char resp_buffer[SCSI_INQ_BUFF_LEN]; -+ char *pbuff; -+ -+ int m,k; -+ int retry_tur = 5; -+ struct sg_io_hdr io_hdr; -+ -+retry: -+ memset(resp_buffer, 0, sizeof(resp_buffer)); -+ memset(&io_hdr, 0, sizeof(struct sg_io_hdr)); -+ -+ io_hdr.interface_id = 'S'; -+ io_hdr.cmd_len = sizeof(inq_cmd); -+ io_hdr.mx_sb_len = sizeof(sense_buffer); -+ io_hdr.dxfer_direction = -3; // Data transfer from the device. -+ io_hdr.dxfer_len = sizeof(resp_buffer); -+ io_hdr.dxferp = (unsigned char *)resp_buffer; -+ io_hdr.cmdp = inq_cmd; -+ io_hdr.sbp = sense_buffer; -+ io_hdr.timeout = timeout; // IOCTL timeout value. -+ -+ if (ioctl(fd, SG_IO, &io_hdr) < 0) { -+ condlog(0, "SG_IO ioctl failed: %s", strerror(errno)); -+ return ret; -+ } -+ if (io_hdr.info & SG_INFO_OK_MASK){ -+ int key = 0, asc, ascq; -+ -+ if (io_hdr.host_status == DID_BUS_BUSY || -+ io_hdr.host_status == DID_ERROR || -+ io_hdr.host_status == DID_TRANSPORT_DISRUPTED) { -+ if (--retry_tur) -+ goto retry; -+ } -+ if (io_hdr.sb_len_wr > 3) { -+ if (io_hdr.sbp[0] == 0x72 || io_hdr.sbp[0] == 0x73) { -+ key = io_hdr.sbp[1] & 0x0f; -+ asc = io_hdr.sbp[2]; -+ ascq = io_hdr.sbp[3]; -+ } else if (io_hdr.sb_len_wr > 13 && -+ ((io_hdr.sbp[0] & 0x7f) == 0x70 || -+ (io_hdr.sbp[0] & 0x7f) == 0x71)) { -+ key = io_hdr.sbp[2] & 0x0f; -+ asc = io_hdr.sbp[12]; -+ ascq = io_hdr.sbp[13]; -+ } -+ } -+ if (key == 0x6) { -+ /* Unit Attention, retry */ -+ if (--retry_tur) -+ goto retry; -+ } -+ return ret; -+ } -+ -+ pbuff = (char *) resp_buffer; -+ -+ wwid[0] = '3'; -+ for (m = 8, k = 1; m < 11; ++m, k+=2) -+ sprintf(&wwid[k], "%02x", (unsigned int)pbuff[m] & 0xff); -+ for (m = 11; m < 24; ++m, k+=2) -+ sprintf(&wwid[k], "%02x", (unsigned int)pbuff[m] & 0xff); -+ -+ return (ret = 0); -+} -+#endif - - struct tur_checker_context { - dev_t devt; -@@ -43,6 +132,7 @@ struct tur_checker_context { - pthread_cond_t active; - pthread_spinlock_t hldr_lock; - int holders; -+ char wwid[WWID_SIZE]; - char message[CHECKER_MSG_LEN]; - }; - -@@ -100,12 +190,15 @@ void libcheck_free (struct checker * c) - #define TUR_MSG(msg, fmt, args...) snprintf(msg, CHECKER_MSG_LEN, fmt, ##args); - - int --tur_check(int fd, unsigned int timeout, char *msg) -+tur_check (int fd, unsigned int timeout, char *msg, char *wwid) - { - struct sg_io_hdr io_hdr; - unsigned char turCmdBlk[TUR_CMD_LEN] = { 0x00, 0, 0, 0, 0, 0 }; - unsigned char sense_buffer[32]; - int retry_tur = 5; -+#ifdef CHECK_WWID -+ char new_wwid[WWID_SIZE]; -+#endif - - retry: - memset(&io_hdr, 0, sizeof (struct sg_io_hdr)); -@@ -179,6 +272,24 @@ tur_check(int fd, unsigned int timeout, - TUR_MSG(msg, MSG_TUR_DOWN); - return PATH_DOWN; - } -+#ifdef CHECK_WWID -+ if (!do_inq(fd, timeout, new_wwid)) { -+ -+ if(!strcmp(wwid, "\0")) { -+ strcpy(wwid, new_wwid); -+ goto up; -+ } -+ -+ if (strcmp(wwid , new_wwid)) { -+ condlog(0, -+ "hp_tur: Lun collided. new_wwid %s old_wwid %s", -+ new_wwid, wwid); -+ TUR_MSG(msg, MSG_TUR_DOWN); -+ return PATH_DOWN; -+ } -+ } -+up: -+#endif - TUR_MSG(msg, MSG_TUR_UP); - return PATH_UP; - } -@@ -215,7 +326,7 @@ void *tur_thread(void *ctx) - ct->state = PATH_PENDING; - pthread_mutex_unlock(&ct->lock); - -- state = tur_check(ct->fd, ct->timeout, ct->message); -+ state = tur_check(ct->fd, ct->timeout, ct->message, ct->wwid); - - /* TUR checker done */ - pthread_mutex_lock(&ct->lock); -@@ -275,7 +386,7 @@ libcheck_check (struct checker * c) - ct->devt = sb.st_rdev; - - if (c->sync) -- return tur_check(c->fd, c->timeout, c->message); -+ return tur_check(c->fd, c->timeout, c->message, ct->wwid); - - /* - * Async mode -@@ -319,7 +430,8 @@ libcheck_check (struct checker * c) - pthread_mutex_unlock(&ct->lock); - condlog(3, "%d:%d: tur thread not responding, " - "using sync mode", TUR_DEVT(ct)); -- return tur_check(c->fd, c->timeout, c->message); -+ return tur_check(c->fd, c->timeout, c->message, -+ ct->wwid); - } - /* Start new TUR checker */ - ct->state = PATH_UNCHECKED; -@@ -337,7 +449,8 @@ libcheck_check (struct checker * c) - ct->holders--; - condlog(3, "%d:%d: failed to start tur thread, using" - " sync mode", TUR_DEVT(ct)); -- return tur_check(c->fd, c->timeout, c->message); -+ return tur_check(c->fd, c->timeout, c->message, -+ ct->wwid); - } - pthread_attr_destroy(&attr); - tur_timeout(&tsp); -Index: multipath-tools-120613/multipath.conf.annotated -=================================================================== ---- multipath-tools-120613.orig/multipath.conf.annotated -+++ multipath-tools-120613/multipath.conf.annotated -@@ -96,7 +96,8 @@ - # # name : path_checker, checker - # # scope : multipath & multipathd - # # desc : the default method used to determine the paths' state --# # values : readsector0|tur|emc_clariion|hp_sw|directio|rdac|cciss_tur -+# # values : readsector0|tur|emc_clariion|hp_sw|directio|rdac| -+# cciss_tur|hp_tur - # # default : directio - # # - # path_checker directio -@@ -493,7 +494,7 @@ - # # scope : multipathd & multipathd - # # desc : path checking algorithm to use to check path state - # # values : readsector0|tur|emc_clariion|hp_sw|directio|rdac| --# # cciss_tur -+# # cciss_tur|hp_tur - # # - # path_checker directio - # diff --git a/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch b/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch new file mode 100644 index 0000000..cef8b56 --- /dev/null +++ b/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch @@ -0,0 +1,151 @@ +From d6ad888bad3850bb0a342ebcdc9fd78773eb3b2a Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Fri, 17 Oct 2014 11:20:34 -0500 +Subject: [PATCH] RH: add wwids from kernel cmdline mpath.wwids with -A + +This patch adds another option to multipath, "-A", which reads +/proc/cmdline for mpath.wwid= options, and adds any wwids it finds +to /etc/multipath/wwids. While this isn't usually important during +normal operation, since these wwids should already be added, it can be +helpful during installation, to make sure that multipath can claim +devices as its own, before LVM or something else makes use of them. The +patch also execs "/sbin/multipath -A" before running multipathd in +multipathd.service + +Signed-off-by: Benjamin Marzinski +--- + multipath/main.c | 54 ++++++++++++++++++++++++++++++-- + multipath/multipath.8.in | 7 ++++- + multipathd/multipathd.service.in | 1 + + 3 files changed, 59 insertions(+), 3 deletions(-) + +diff --git a/multipath/main.c b/multipath/main.c +index 31012874..a667c2ee 100644 +--- a/multipath/main.c ++++ b/multipath/main.c +@@ -111,7 +111,7 @@ usage (char * progname) + fprintf (stderr, " %s [-v level] [-R retries] -F\n", progname); + fprintf (stderr, " %s [-v level] [-l|-ll] [device]\n", progname); + fprintf (stderr, " %s [-v level] [-a|-w] device\n", progname); +- fprintf (stderr, " %s [-v level] -W\n", progname); ++ fprintf (stderr, " %s [-v level] [-A|-W]\n", progname); + fprintf (stderr, " %s [-v level] [-i] [-c|-C] device\n", progname); + fprintf (stderr, " %s [-v level] [-i] [-u|-U]\n", progname); + fprintf (stderr, " %s [-h|-t|-T]\n", progname); +@@ -125,6 +125,8 @@ usage (char * progname) + " -f flush a multipath device map\n" + " -F flush all multipath device maps\n" + " -a add a device wwid to the wwids file\n" ++ " -A add devices from kernel command line mpath.wwids\n" ++ " parameters to wwids file\n" + " -c check if a device should be a path in a multipath device\n" + " -C check if a multipath device has usable paths\n" + " -q allow queue_if_no_path when multipathd is not running\n" +@@ -440,6 +442,50 @@ static void cleanup_vecs(void) + free_pathvec(vecs.pathvec, FREE_PATHS); + } + ++static int remember_cmdline_wwid(void) ++{ ++ FILE *f = NULL; ++ char buf[LINE_MAX], *next, *ptr; ++ int ret = 0; ++ ++ f = fopen("/proc/cmdline", "re"); ++ if (!f) { ++ condlog(0, "can't open /proc/cmdline : %s", strerror(errno)); ++ return -1; ++ } ++ ++ if (!fgets(buf, sizeof(buf), f)) { ++ if (ferror(f)) ++ condlog(0, "read of /proc/cmdline failed : %s", ++ strerror(errno)); ++ else ++ condlog(0, "couldn't read /proc/cmdline"); ++ fclose(f); ++ return -1; ++ } ++ fclose(f); ++ next = buf; ++ while((ptr = strstr(next, "mpath.wwid="))) { ++ ptr += 11; ++ next = strpbrk(ptr, " \t\n"); ++ if (next) { ++ *next = '\0'; ++ next++; ++ } ++ if (strlen(ptr)) { ++ if (remember_wwid(ptr) != 0) ++ ret = -1; ++ } ++ else { ++ condlog(0, "empty mpath.wwid kernel command line option"); ++ ret = -1; ++ } ++ if (!next) ++ break; ++ } ++ return ret; ++} ++ + static int + configure (struct config *conf, enum mpath_cmds cmd, + enum devtypes dev_type, char *devpath) +@@ -851,7 +897,7 @@ main (int argc, char *argv[]) + condlog(1, "failed to register cleanup handler for vecs: %m"); + if (atexit(cleanup_bindings)) + condlog(1, "failed to register cleanup handler for bindings: %m"); +- while ((arg = getopt(argc, argv, ":adDcChl::eFfM:v:p:b:BrR:itTquUwW")) != EOF ) { ++ while ((arg = getopt(argc, argv, ":aAdDcChl::eFfM:v:p:b:BrR:itTquUwW")) != EOF ) { + switch(arg) { + case 'v': + if (!isdigit(optarg[0])) { +@@ -922,6 +968,10 @@ main (int argc, char *argv[]) + case 'T': + cmd = CMD_DUMP_CONFIG; + break; ++ case 'A': ++ if (remember_cmdline_wwid() != 0) ++ exit(RTVL_FAIL); ++ exit(RTVL_OK); + case 'h': + usage(argv[0]); + exit(RTVL_OK); +diff --git a/multipath/multipath.8.in b/multipath/multipath.8.in +index b88e9a4c..edd742aa 100644 +--- a/multipath/multipath.8.in ++++ b/multipath/multipath.8.in +@@ -64,7 +64,7 @@ multipath \- Device mapper target autoconfig. + .B multipath + .RB [\| \-v\ \c + .IR level \|] +-.B -W ++.RB [\| \-A | \-W \|] + . + .LP + .B multipath +@@ -146,6 +146,11 @@ device mapper, path checkers ...). + Add the WWID for the specified device to the WWIDs file. + . + .TP ++.B \-A ++Add the WWIDs from any kernel command line \fImpath.wwid\fR parameters to the ++WWIDs file. ++. ++.TP + .B \-w + Remove the WWID for the specified device from the WWIDs file. + . +diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in +index ab166435..1ec08c6e 100644 +--- a/multipathd/multipathd.service.in ++++ b/multipathd/multipathd.service.in +@@ -19,6 +19,7 @@ StartLimitBurst=3 + [Service] + Type=notify + NotifyAccess=main ++ExecStartPre=-@BINDIR@/multipath -A + ExecStart=@BINDIR@/multipathd -d -s + ExecReload=@BINDIR@/multipathd reconfigure + Restart=on-failure diff --git a/0008-RH-reset-default-find_mutipaths-value-to-off.patch b/0008-RH-reset-default-find_mutipaths-value-to-off.patch new file mode 100644 index 0000000..fdc90d4 --- /dev/null +++ b/0008-RH-reset-default-find_mutipaths-value-to-off.patch @@ -0,0 +1,41 @@ +From 064d761121e7e2c7b63ab280e341d8010a413119 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 7 Jun 2018 17:43:52 -0500 +Subject: [PATCH] RH: reset default find_mutipaths value to off + +Upstream has changed to default find_multipaths to "strict". For now +Redhat will retain the previous default of "off". + +Co-authored-by: Paul Donohue +Signed-off-by: Benjamin Marzinski +--- + libmultipath/defaults.h | 2 +- + multipath/multipath.conf.5.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h +index 134b690a..e2fe7ac4 100644 +--- a/libmultipath/defaults.h ++++ b/libmultipath/defaults.h +@@ -24,7 +24,7 @@ + #define DEFAULT_NO_PATH_RETRY NO_PATH_RETRY_UNDEF + #define DEFAULT_VERBOSITY 2 + #define DEFAULT_REASSIGN_MAPS 0 +-#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_STRICT ++#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_OFF + #define DEFAULT_FAST_IO_FAIL 5 + #define DEFAULT_DEV_LOSS_TMO 600 + #define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_ON +diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in +index ba291e11..b8389db3 100644 +--- a/multipath/multipath.conf.5.in ++++ b/multipath/multipath.conf.5.in +@@ -1227,7 +1227,7 @@ as non-multipath and passed on to upper layers. + \fBNote:\fR this may cause delays during device detection if + there are single-path devices which aren\'t blacklisted. + .TP +-The default is: \fBstrict\fR ++The default is: \fBoff\fR + .RE + . + . diff --git a/0008-RH-revert-partition-changes.patch b/0008-RH-revert-partition-changes.patch deleted file mode 100644 index c563b0e..0000000 --- a/0008-RH-revert-partition-changes.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- - kpartx/dos.c | 2 -- - kpartx/kpartx.c | 9 ++++++--- - 2 files changed, 6 insertions(+), 5 deletions(-) - -Index: multipath-tools-130222/kpartx/dos.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/dos.c -+++ multipath-tools-130222/kpartx/dos.c -@@ -98,8 +98,6 @@ read_dos_pt(int fd, struct slice all, st - break; - } - if (is_extended(p.sys_type)) { -- sp[i].size = 2; /* extended partitions only get two -- sectors mapped for LILO to install */ - n += read_extended_partition(fd, &p, i, sp+n, ns-n); - } - } -Index: multipath-tools-130222/kpartx/kpartx.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.c -+++ multipath-tools-130222/kpartx/kpartx.c -@@ -516,6 +516,7 @@ main(int argc, char **argv){ - d = c; - while (c) { - for (j = 0; j < n; j++) { -+ uint64_t start; - int k = slices[j].container - 1; - - if (slices[j].size == 0) -@@ -541,9 +542,11 @@ main(int argc, char **argv){ - } - strip_slash(partname); - -- if (safe_sprintf(params, "%s %" PRIu64, -- device, -- slices[j].start)) { -+ start = slices[j].start - slices[k].start; -+ if (safe_sprintf(params, "%d:%d %" PRIu64, -+ slices[k].major, -+ slices[k].minor, -+ start)) { - fprintf(stderr, "params too small\n"); - exit(1); - } diff --git a/0009-RH-RHEL5-style-partitions.patch b/0009-RH-RHEL5-style-partitions.patch deleted file mode 100644 index a2691bb..0000000 --- a/0009-RH-RHEL5-style-partitions.patch +++ /dev/null @@ -1,327 +0,0 @@ ---- - kpartx/bsd.c | 35 --------------- - kpartx/dos.c | 7 +-- - kpartx/kpartx.c | 123 +++++++------------------------------------------------- - kpartx/kpartx.h | 1 - kpartx/sun.c | 35 --------------- - 5 files changed, 24 insertions(+), 177 deletions(-) - -Index: multipath-tools-130222/kpartx/bsd.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/bsd.c -+++ multipath-tools-130222/kpartx/bsd.c -@@ -50,10 +50,10 @@ int - read_bsd_pt(int fd, struct slice all, struct slice *sp, int ns) { - struct bsd_disklabel *l; - struct bsd_partition *p; -- unsigned int offset = all.start, end; -+ unsigned int offset = all.start; - int max_partitions; - char *bp; -- int n = 0, i, j; -+ int n = 0; - - bp = getblock(fd, offset+1); /* 1 sector suffices */ - if (bp == NULL) -@@ -79,36 +79,5 @@ read_bsd_pt(int fd, struct slice all, st - break; - } - } -- /* -- * Convention has it that the bsd disklabel will always have -- * the 'c' partition spanning the entire disk. -- * So we have to check for contained slices. -- */ -- for(i = 0; i < n; i++) { -- if (sp[i].size == 0) -- continue; -- -- end = sp[i].start + sp[i].size; -- for(j = 0; j < n; j ++) { -- if ( i == j ) -- continue; -- if (sp[j].size == 0) -- continue; -- -- if (sp[i].start < sp[j].start) { -- if (end > sp[j].start && -- end < sp[j].start + sp[j].size) { -- /* Invalid slice */ -- fprintf(stderr, -- "bsd_disklabel: slice %d overlaps with %d\n", i , j); -- sp[i].size = 0; -- } -- } else { -- if (end <= sp[j].start + sp[j].size) { -- sp[i].container = j + 1; -- } -- } -- } -- } - return n; - } -Index: multipath-tools-130222/kpartx/dos.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/dos.c -+++ multipath-tools-130222/kpartx/dos.c -@@ -16,7 +16,7 @@ is_extended(int type) { - } - - static int --read_extended_partition(int fd, struct partition *ep, int en, -+read_extended_partition(int fd, struct partition *ep, - struct slice *sp, int ns) - { - struct partition p; -@@ -53,7 +53,6 @@ read_extended_partition(int fd, struct p - if (n < ns) { - sp[n].start = here + le32_to_cpu(p.start_sect); - sp[n].size = le32_to_cpu(p.nr_sects); -- sp[n].container = en + 1; - n++; - } else { - fprintf(stderr, -@@ -98,7 +97,9 @@ read_dos_pt(int fd, struct slice all, st - break; - } - if (is_extended(p.sys_type)) { -- n += read_extended_partition(fd, &p, i, sp+n, ns-n); -+ n += read_extended_partition(fd, &p, sp+n, ns-n); -+ /* hide the extended partition itself */ -+ sp[i].size = 2; - } - } - return n; -Index: multipath-tools-130222/kpartx/kpartx.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.c -+++ multipath-tools-130222/kpartx/kpartx.c -@@ -192,7 +192,7 @@ get_hotplug_device(void) - - int - main(int argc, char **argv){ -- int i, j, m, n, op, off, arg, c, d, ro=0; -+ int i, j, m, n, op, off, arg, ro=0; - int fd = -1; - struct slice all; - struct pt *ptp; -@@ -381,49 +381,30 @@ main(int argc, char **argv){ - else - continue; - -+ /* -+ * test for overlap, as in the case of an extended partition -+ * zero their size to avoid mapping -+ */ -+ for (j = 0; j < n; j++) { -+ for (m = j + 1; m < n; m++) { -+ if (slices[m].start > slices[j].start && -+ slices[m].start < slices[j].start + -+ slices[j].size) -+ slices[j].size = 0; -+ } -+ } -+ - switch(what) { - case LIST: -- for (j = 0, c = 0, m = 0; j < n; j++) { -+ for (j = 0; j < n; j++) { - if (slices[j].size == 0) - continue; -- if (slices[j].container > 0) { -- c++; -- continue; -- } -- -- slices[j].minor = m++; - - printf("%s%s%d : 0 %" PRIu64 " %s %" PRIu64"\n", - mapname, delim, j+1, - slices[j].size, device, - slices[j].start); - } -- /* Loop to resolve contained slices */ -- d = c; -- while (c) { -- for (j = 0; j < n; j++) { -- uint64_t start; -- int k = slices[j].container - 1; -- -- if (slices[j].size == 0) -- continue; -- if (slices[j].minor > 0) -- continue; -- if (slices[j].container == 0) -- continue; -- slices[j].minor = m++; -- -- start = slices[j].start - slices[k].start; -- printf("%s%s%d : 0 %" PRIu64 " /dev/dm-%d %" PRIu64 "\n", -- mapname, delim, j+1, -- slices[j].size, -- slices[k].minor, start); -- c--; -- } -- /* Terminate loop if nothing more to resolve */ -- if (d == c) -- break; -- } - - break; - -@@ -462,16 +443,10 @@ main(int argc, char **argv){ - case ADD: - case UPDATE: - /* ADD and UPDATE share the same code that adds new partitions. */ -- for (j = 0, c = 0; j < n; j++) { -+ for (j = 0; j < n; j++) { - if (slices[j].size == 0) - continue; - -- /* Skip all contained slices */ -- if (slices[j].container > 0) { -- c++; -- continue; -- } -- - if (safe_sprintf(partname, "%s%s%d", - mapname, delim, j+1)) { - fprintf(stderr, "partname too small\n"); -@@ -512,72 +487,6 @@ main(int argc, char **argv){ - slices[j].minor, slices[j].size, - DM_TARGET, params); - } -- /* Loop to resolve contained slices */ -- d = c; -- while (c) { -- for (j = 0; j < n; j++) { -- uint64_t start; -- int k = slices[j].container - 1; -- -- if (slices[j].size == 0) -- continue; -- -- /* Skip all existing slices */ -- if (slices[j].minor > 0) -- continue; -- -- /* Skip all simple slices */ -- if (slices[j].container == 0) -- continue; -- -- /* Check container slice */ -- if (slices[k].size == 0) -- fprintf(stderr, "Invalid slice %d\n", -- k); -- -- if (safe_sprintf(partname, "%s%s%d", -- mapname, delim, j+1)) { -- fprintf(stderr, "partname too small\n"); -- exit(1); -- } -- strip_slash(partname); -- -- start = slices[j].start - slices[k].start; -- if (safe_sprintf(params, "%d:%d %" PRIu64, -- slices[k].major, -- slices[k].minor, -- start)) { -- fprintf(stderr, "params too small\n"); -- exit(1); -- } -- -- op = (dm_map_present(partname) ? -- DM_DEVICE_RELOAD : DM_DEVICE_CREATE); -- -- dm_addmap(op, partname, DM_TARGET, params, -- slices[j].size, ro, uuid, j+1, -- buf.st_mode & 0777, -- buf.st_uid, buf.st_gid, -- &cookie); -- -- if (op == DM_DEVICE_RELOAD) -- dm_simplecmd(DM_DEVICE_RESUME, -- partname, 1, -- &cookie); -- -- dm_devn(partname, &slices[j].major, -- &slices[j].minor); -- -- if (verbose) -- printf("add map %s : 0 %" PRIu64 " %s %s\n", -- partname, slices[j].size, -- DM_TARGET, params); -- c--; -- } -- /* Terminate loop */ -- if (d == c) -- break; -- } - - if (what == ADD) { - /* Skip code that removes devmappings for deleted partitions */ -Index: multipath-tools-130222/kpartx/kpartx.h -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.h -+++ multipath-tools-130222/kpartx/kpartx.h -@@ -24,7 +24,6 @@ - struct slice { - uint64_t start; - uint64_t size; -- int container; - int major; - int minor; - }; -Index: multipath-tools-130222/kpartx/sun.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/sun.c -+++ multipath-tools-130222/kpartx/sun.c -@@ -62,8 +62,8 @@ int - read_sun_pt(int fd, struct slice all, struct slice *sp, int ns) { - struct sun_disk_label *l; - struct sun_raw_part *s; -- unsigned int offset = all.start, end; -- int i, j, n; -+ unsigned int offset = all.start; -+ int i, n; - char *bp; - - bp = getblock(fd, offset); -@@ -95,37 +95,6 @@ read_sun_pt(int fd, struct slice all, st - break; - } - } -- /* -- * Convention has it that the SUN disklabel will always have -- * the 'c' partition spanning the entire disk. -- * So we have to check for contained slices. -- */ -- for(i = 0; i < SUN_DISK_MAXPARTITIONS; i++) { -- if (sp[i].size == 0) -- continue; -- -- end = sp[i].start + sp[i].size; -- for(j = 0; j < SUN_DISK_MAXPARTITIONS; j ++) { -- if ( i == j ) -- continue; -- if (sp[j].size == 0) -- continue; -- -- if (sp[i].start < sp[j].start) { -- if (end > sp[j].start && -- end < sp[j].start + sp[j].size) { -- /* Invalid slice */ -- fprintf(stderr, -- "sun_disklabel: slice %d overlaps with %d\n", i , j); -- sp[i].size = 0; -- } -- } else { -- if (end <= sp[j].start + sp[j].size) { -- sp[i].container = j + 1; -- } -- } -- } -- } - return n; - } - diff --git a/0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch b/0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch new file mode 100644 index 0000000..8065e9f --- /dev/null +++ b/0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch @@ -0,0 +1,84 @@ +From 335b8eb2773b07a602e84e14c1f3e289a9b25b5a Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 11 Apr 2019 13:25:42 -0500 +Subject: [PATCH] RH: attempt to get ANA info via sysfs first + +When the ANA prioritizer is run, first see if the "ana_state" sysfs file +exists, and if it does, try to read the state from there. If that fails, +fallback to using an ioctl. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/prioritizers/ana.c | 31 +++++++++++++++++++++++++++++-- + 1 file changed, 29 insertions(+), 2 deletions(-) + +diff --git a/libmultipath/prioritizers/ana.c b/libmultipath/prioritizers/ana.c +index 34527b22..4eaa3cc3 100644 +--- a/libmultipath/prioritizers/ana.c ++++ b/libmultipath/prioritizers/ana.c +@@ -23,6 +23,7 @@ + #include "prio.h" + #include "util.h" + #include "structs.h" ++#include "sysfs.h" + + enum { + ANA_ERR_GETCTRL_FAILED = 1, +@@ -35,6 +36,7 @@ enum { + ANA_ERR_GETNS_FAILED, + ANA_ERR_NO_MEMORY, + ANA_ERR_NO_INFORMATION, ++ ANA_ERR_INVALID_STATE, + }; + + static const char *ana_errmsg[] = { +@@ -48,6 +50,7 @@ static const char *ana_errmsg[] = { + [ANA_ERR_GETNS_FAILED] = "couldn't get namespace info", + [ANA_ERR_NO_MEMORY] = "out of memory", + [ANA_ERR_NO_INFORMATION] = "invalid fd", ++ [ANA_ERR_INVALID_STATE] = "invalid state", + }; + + static const char *anas_string[] = { +@@ -106,6 +109,27 @@ static int get_ana_state(__u32 nsid, __u32 anagrpid, void *ana_log, + return -ANA_ERR_GETANAS_NOTFOUND; + } + ++static int get_ana_info_sysfs(struct path *pp) ++{ ++ char state[32]; ++ ++ if (!pp->udev || sysfs_attr_get_value(pp->udev, "ana_state", state, ++ sizeof(state)) <= 0) ++ return -ANA_ERR_NO_INFORMATION; ++ ++ if (strcmp(state, "optimized") == 0) ++ return NVME_ANA_OPTIMIZED; ++ if (strcmp(state, "non-optimized") == 0) ++ return NVME_ANA_NONOPTIMIZED; ++ if (strcmp(state, "inaccessible") == 0) ++ return NVME_ANA_INACCESSIBLE; ++ if (strcmp(state, "persistent-loss") == 0) ++ return NVME_ANA_PERSISTENT_LOSS; ++ if (strcmp(state, "change") == 0) ++ return NVME_ANA_CHANGE; ++ return -ANA_ERR_INVALID_STATE; ++} ++ + static int get_ana_info(struct path * pp) + { + int rc; +@@ -208,8 +232,11 @@ int getprio(struct path *pp, __attribute__((unused)) char *args) + + if (pp->fd < 0) + rc = -ANA_ERR_NO_INFORMATION; +- else +- rc = get_ana_info(pp); ++ else { ++ rc = get_ana_info_sysfs(pp); ++ if (rc < 0) ++ rc = get_ana_info(pp); ++ } + + switch (rc) { + case NVME_ANA_OPTIMIZED: diff --git a/0010-RH-dont-remove-map-on-enomem.patch b/0010-RH-dont-remove-map-on-enomem.patch deleted file mode 100644 index 1740c10..0000000 --- a/0010-RH-dont-remove-map-on-enomem.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- - multipathd/main.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -990,7 +990,8 @@ mpvec_garbage_collector (struct vectors - return; - - vector_foreach_slot (vecs->mpvec, mpp, i) { -- if (mpp && mpp->alias && !dm_map_present(mpp->alias)) { -+ if (mpp && mpp->alias && !dm_map_present(mpp->alias) && -+ errno != ENOMEM) { - condlog(2, "%s: remove dead map", mpp->alias); - remove_map_and_stop_waiter(mpp, vecs, 1); - i--; diff --git a/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch b/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch new file mode 100644 index 0000000..f7bca92 --- /dev/null +++ b/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch @@ -0,0 +1,96 @@ +From 137c96d16b6bb03d8a52854e152db4ee36b7d9e4 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 25 Mar 2021 13:05:10 -0500 +Subject: [PATCH] RH: make parse_vpd_pg83 match scsi_id output + +Red Hat sets ID_SERIAL based on the result of scsi_id, instead of using +the result of sg_inq and 55-scsi-sg3_id.rules. Make parse_vpd_pg83 match +that. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/discovery.c | 12 ++---------- + tests/vpd.c | 6 ++++++ + 2 files changed, 8 insertions(+), 10 deletions(-) + +diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c +index 31db8758..21cfcc73 100644 +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -1225,13 +1225,9 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, + good_len = 8; + break; + case 2: +- /* IEEE Extended: Prio 6 */ +- new_prio = 6; +- good_len = 8; +- break; + case 3: +- /* IEEE Locally assigned: Prio 1 */ +- new_prio = 1; ++ /* IEEE Extended or Locally assigned: Prio 6 */ ++ new_prio = 6; + good_len = 8; + break; + default: +@@ -1249,10 +1245,6 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, + break; + case 0x8: + /* SCSI Name: Prio 3 */ +- invalid = (d[3] < 4 || (memcmp(d + 4, "eui.", 4) && +- memcmp(d + 4, "naa.", 4) && +- memcmp(d + 4, "iqn.", 4))); +- new_prio = 3; + break; + case 0x1: + /* T-10 Vendor ID: Prio 2 */ +diff --git a/tests/vpd.c b/tests/vpd.c +index e3212e61..cdb111bb 100644 +--- a/tests/vpd.c ++++ b/tests/vpd.c +@@ -232,11 +232,13 @@ static const char * const str_prefix[] = { + [STR_IQN] = "iqn.", + }; + ++#if 0 + static const char byte0[] = { + [STR_EUI] = '2', + [STR_NAA] = '3', + [STR_IQN] = '8', + }; ++#endif + + /** + * create_scsi_string_desc() - create a SCSI name string descriptor. +@@ -767,6 +769,7 @@ make_test_vpd_naa(2, 18); + make_test_vpd_naa(2, 17); + make_test_vpd_naa(2, 16); + ++#if 0 + /* SCSI Name string: EUI64, WWID size: 17 */ + make_test_vpd_str(0, 20, 18) + make_test_vpd_str(0, 20, 17) +@@ -802,6 +805,7 @@ make_test_vpd_str(18, 20, 18) + make_test_vpd_str(18, 20, 17) + make_test_vpd_str(18, 20, 16) + make_test_vpd_str(18, 20, 15) ++#endif + + static int test_vpd(void) + { +@@ -910,6 +914,7 @@ static int test_vpd(void) + cmocka_unit_test(test_vpd_naa_2_18), + cmocka_unit_test(test_vpd_naa_2_17), + cmocka_unit_test(test_vpd_naa_2_16), ++/* + cmocka_unit_test(test_vpd_str_0_20_18), + cmocka_unit_test(test_vpd_str_0_20_17), + cmocka_unit_test(test_vpd_str_0_20_16), +@@ -934,6 +939,7 @@ static int test_vpd(void) + cmocka_unit_test(test_vpd_str_18_20_17), + cmocka_unit_test(test_vpd_str_18_20_16), + cmocka_unit_test(test_vpd_str_18_20_15), ++*/ + }; + return cmocka_run_group_tests(tests, setup, teardown); + } diff --git a/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch b/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch new file mode 100644 index 0000000..3fe7c25 --- /dev/null +++ b/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch @@ -0,0 +1,25 @@ +From 374755791536be4870ab2e93ae36549cbaaeb800 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Fri, 25 Mar 2022 18:12:06 -0500 +Subject: [PATCH] RH: add scsi device handlers to modules-load.d + +Make scsi_dh_alua scsi_dh_emc and scsi_dh_rdac get loaded in early boot. + +Signed-off-by: Benjamin Marzinski +--- + Makefile.inc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.inc b/Makefile.inc +index 03aee175..936a622f 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -16,7 +16,7 @@ READLINE := + + # List of scsi device handler modules to load on boot, e.g. + # SCSI_DH_MODULES_PRELOAD := scsi_dh_alua scsi_dh_rdac +-SCSI_DH_MODULES_PRELOAD := ++SCSI_DH_MODULES_PRELOAD := scsi_dh_alua scsi_dh_emc scsi_dh_rdac + + EXTRAVERSION := $(shell rev=$$(git rev-parse --short=7 HEAD 2>/dev/null); echo $${rev:+-g$$rev}) + diff --git a/0011-RH-deprecate-uid-gid-mode.patch b/0011-RH-deprecate-uid-gid-mode.patch deleted file mode 100644 index 9270d9d..0000000 --- a/0011-RH-deprecate-uid-gid-mode.patch +++ /dev/null @@ -1,90 +0,0 @@ ---- - multipath.conf.annotated | 53 ----------------------------------------------- - multipath.conf.synthetic | 3 -- - 2 files changed, 56 deletions(-) - -Index: multipath-tools-120123/multipath.conf.annotated -=================================================================== ---- multipath-tools-120123.orig/multipath.conf.annotated -+++ multipath-tools-120123/multipath.conf.annotated -@@ -186,32 +186,6 @@ - # user_friendly_names no - # - # # --# # name : mode --# # scope : multipath & multipathd --# # desc : The mode to use for the multipath device nodes, in octal. --# # values : 0000 - 0777 --# # default : determined by the process --# mode 0644 --# --# # --# # name : uid --# # scope : multipath & multipathd --# # desc : The user id to use for the multipath device nodes. You --# # may use either the numeric or symbolic uid --# # values : --# # default : determined by the process --# uid 0 --# --# # --# # name : gid --# # scope : multipath & multipathd --# # desc : The group id to user for the multipath device nodes. You --# # may use either the numeric or symbolic gid --# # values : --# # default : determined by the process --# gid disk --# --# # - # # name : checker_timeout - # # scope : multipath & multipathd - # # desc : The timeout to use for path checkers that issue scsi -@@ -388,33 +362,6 @@ - # # - # flush_on_last_del yes - # --# # --# # name : mode --# # scope : multipath & multipathd --# # desc : The mode to use for the multipath device nodes, in --# # octal. --# # values : 0000 - 0777 --# # default : determined by the process --# mode 0644 --# --# # --# # name : uid --# # scope : multipath & multipathd --# # desc : The user id to use for the multipath device nodes. --# # You may use either the numeric or symbolic uid --# # values : --# # default : determined by the process --# uid 0 --# --# # --# # name : gid --# # scope : multipath & multipathd --# # desc : The group id to user for the multipath device nodes. --# # You may use either the numeric or symbolic gid --# # values : --# # default : determined by the process --# gid 0 --# - # } - # multipath { - # wwid 1DEC_____321816758474 -Index: multipath-tools-120123/multipath.conf.synthetic -=================================================================== ---- multipath-tools-120123.orig/multipath.conf.synthetic -+++ multipath-tools-120123/multipath.conf.synthetic -@@ -18,9 +18,6 @@ - # no_path_retry fail - # queue_without_daemon no - # user_friendly_names no --# mode 644 --# uid 0 --# gid disk - #} - #blacklist { - # wwid 26353900f02796769 diff --git a/0012-RH-compile-with-libreadline-support.patch b/0012-RH-compile-with-libreadline-support.patch new file mode 100644 index 0000000..0964c42 --- /dev/null +++ b/0012-RH-compile-with-libreadline-support.patch @@ -0,0 +1,26 @@ +From cc15379130e8aa068e97c64afd46be212b456d4f Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Tue, 15 Nov 2022 18:03:33 -0600 +Subject: [PATCH] RH: compile with libreadline support + +Since the license issue has been resolved, and there are problems with +the command completion with libedit, use libreadline. + +Signed-off-by: Benjamin Marzinski +--- + Makefile.inc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.inc b/Makefile.inc +index 936a622f..f475f70f 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -12,7 +12,7 @@ + # Readline library to use, libedit, libreadline, or empty + # Caution: Using libreadline may make the multipathd binary undistributable, + # see https://github.com/opensvc/multipath-tools/issues/36 +-READLINE := ++READLINE := libreadline + + # List of scsi device handler modules to load on boot, e.g. + # SCSI_DH_MODULES_PRELOAD := scsi_dh_alua scsi_dh_rdac diff --git a/0012-RH-kpartx-msg.patch b/0012-RH-kpartx-msg.patch deleted file mode 100644 index 7584c84..0000000 --- a/0012-RH-kpartx-msg.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - kpartx/lopart.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/kpartx/lopart.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/lopart.c -+++ multipath-tools-130222/kpartx/lopart.c -@@ -205,13 +205,13 @@ find_unused_loop_device (void) - fprintf(stderr, - "mount: Could not find any loop device, and, according to %s,\n" - " this kernel does not know about the loop device.\n" -- " (If so, then recompile or `insmod loop.o'.)", -+ " (If so, then recompile or `modprobe loop'.)", - PROC_DEVICES); - - else - fprintf(stderr, - "mount: Could not find any loop device. Maybe this kernel does not know\n" -- " about the loop device (then recompile or `insmod loop.o'), or\n" -+ " about the loop device (then recompile or `modprobe loop'), or\n" - " maybe /dev/loop# has the wrong major number?"); - - } else diff --git a/0013-RH-Add-mpathcleanup.patch b/0013-RH-Add-mpathcleanup.patch new file mode 100644 index 0000000..d1a8e84 --- /dev/null +++ b/0013-RH-Add-mpathcleanup.patch @@ -0,0 +1,186 @@ +From 2ef5bd86052ba0b22f4d3a16e69cdf268d90a53a Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Fri, 7 Jul 2023 15:25:59 -0500 +Subject: [PATCH] RH: Add mpathcleanup + +mpathcleanup is a program that will remove a multipath device as well as +all of the scsi path devices that make it up. + +Signed-off-by: Benjamin Marzinski +--- + multipath/Makefile | 2 + + multipath/mpathcleanup | 145 +++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 147 insertions(+) + create mode 100755 multipath/mpathcleanup + +diff --git a/multipath/Makefile b/multipath/Makefile +index 3dc241cc..47e82234 100644 +--- a/multipath/Makefile ++++ b/multipath/Makefile +@@ -25,6 +25,7 @@ install: + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) + $(Q)$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/ + $(Q)$(INSTALL_PROGRAM) -m 755 mpathconf $(DESTDIR)$(bindir)/ ++ $(Q)$(INSTALL_PROGRAM) -m 755 mpathcleanup $(DESTDIR)$(bindir)/ + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir) + $(Q)$(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir) + $(Q)$(INSTALL_PROGRAM) -m 644 99-z-dm-mpath-late.rules $(DESTDIR)$(udevrulesdir) +@@ -49,6 +50,7 @@ endif + uninstall: + $(Q)$(RM) $(DESTDIR)$(bindir)/$(EXEC) + $(Q)$(RM) $(DESTDIR)$(bindir)/mpathconf ++ $(Q)$(RM) $(DESTDIR)$(bindir)/mpathcleanup + $(Q)$(RM) $(DESTDIR)$(udevrulesdir)/11-dm-mpath.rules + $(Q)$(RM) $(DESTDIR)$(udevrulesdir)/99-z-dm-mpath-late.rules + $(Q)$(RM) $(DESTDIR)$(modulesloaddir)/multipath.conf +diff --git a/multipath/mpathcleanup b/multipath/mpathcleanup +new file mode 100755 +index 00000000..6fd921e4 +--- /dev/null ++++ b/multipath/mpathcleanup +@@ -0,0 +1,145 @@ ++#!/bin/bash ++# ++# Copyright (C) 2023 Red Hat, Inc. All rights reserved. ++# ++# This file is part of the device-mapper-multipath package. ++# ++# This copyrighted material is made available to anyone wishing to use, ++# modify, copy, or redistribute it subject to the terms and conditions ++# of the GNU General Public License v.2. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software Foundation, ++# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ ++unset PROGRAM FLUSH DEVICE DEVNAME MAJOR MINOR PATHDEVS PATHDEV HAVE_MULTIPATHD QUEUEING ++ ++function usage ++{ ++ echo "usage: $PROGRAM [-h] [--flush] " ++ echo "" ++ echo "remove a multipath device and its scsi path devices" ++ echo "" ++ echo "options:" ++ echo " -h, --help show this help message and exit" ++ echo " --flush disable queuing on the multipath device and" ++ echo " flush the path devices before removing" ++} ++ ++function parse_args ++{ ++ while [ -n "$1" ]; do ++ case $1 in ++ --flush) ++ FLUSH=1 ++ shift ++ ;; ++ --help | -h) ++ usage ++ exit 1 ++ ;; ++ *) ++ if [ -n "$DEVICE" ]; then ++ usage ++ exit 1 ++ fi ++ DEVICE=$1 ++ shift ++ ;; ++ esac ++ done ++} ++ ++function validate_device ++{ ++ if [ -z "$DEVICE" ]; then ++ usage ++ exit 1 ++ fi ++ if [[ "$DEVICE" =~ ^[[:digit:]]+:[[:digit:]]+$ ]]; then ++ MAJOR=${DEVICE%%:*} ++ MINOR=${DEVICE##*:} ++ DEVNAME=`dmsetup ls --target multipath | grep "($MAJOR, $MINOR)$" | awk '{print $1}'` ++ else ++ DEVNAME=`dmsetup ls --target multipath | awk '{print $1}' | grep "^$DEVICE$"` ++ fi ++ if [ -z "$DEVNAME" ]; then ++ DEVNAME=`multipath -v 1 -l $DEVICE 2>/dev/null` ++ if [ -z "$DEVNAME" ]; then ++ echo "$DEVICE is not a multipath device" ++ exit 1 ++ fi ++ # verify that this is not a native nvme multipath device ++ dmsetup ls --target multipath | awk '{print $1}' | grep -q "^$DEVNAME$" ++ if test $? -eq 1; then ++ echo "$DEVICE is not a device-mapper multipath device" ++ exit 1 ++ fi ++ fi ++ if [ -z "$MINOR" ]; then ++ MINOR=`dmsetup info -c --noheadings -o minor $DEVNAME` ++ fi ++} ++ ++function get_paths ++{ ++ PATHDEVS=`ls /sys/block/dm-$MINOR/slaves` ++ for PATHDEV in $PATHDEVS; do ++ if [[ ! "$PATHDEV" =~ ^sd[a-z]+$ ]]; then ++ echo "$PATHDEV is not a scsi device. $PROGRAM only works with scsi devices" ++ exit 1 ++ fi ++ done ++} ++ ++function remove_devs ++{ ++ pidof multipathd > /dev/null ++ HAVE_MULTIPATHD=$? ++ multipath -v2 -l "$DEVNAME" | grep features | grep -q queue_if_no_path ++ QUEUEING=$? ++ if [ -n "$FLUSH" ] && [ "$QUEUEING" -eq 0 ]; then ++ if test $HAVE_MULTIPATHD -eq 0; then ++ multipathd disablequeueing map "$DEVNAME" > /dev/null ++ else ++ dmsetup message "$DEVNAME" 0 fail_if_no_path ++ fi ++ sleep 1 ++ fi ++ if test $HAVE_MULTIPATHD -eq 0; then ++ multipath -f "$DEVNAME" ++ else ++ multipathd -Df "$DEVNAME" ++ fi ++ if test $? -eq 1; then ++ echo "$DEVICE cannot be removed" ++ exit 1 ++ fi ++ for PATHDEV in $PATHDEVS; do ++ if [ -n "$FLUSH" ]; then ++ blockdev --flushbufs /dev/"$PATHDEV" ++ fi ++ echo 1 > /sys/block/"$PATHDEV"/device/delete ++ done ++} ++ ++function verify_removal ++{ ++ multipath -v 1 -d $DEVNAME | grep -q "^$DEVNAME$" ++ if test $? -eq 0; then ++ echo "$DEVICE removed but path devices still exist" ++ exit 1 ++ fi ++ multipath -v 1 -l $DEVNAME | grep -q "^$DEVNAME$" ++ if test $? -eq 0; then ++ echo "$DEVICE removal succeeded, but device still exists" ++ exit 1 ++ fi ++} ++ ++PROGRAM="$0" ++parse_args "$@" ++validate_device ++get_paths ++remove_devs ++verify_removal diff --git a/0013-RHBZ-883981-cleanup-rpmdiff-issues.patch b/0013-RHBZ-883981-cleanup-rpmdiff-issues.patch deleted file mode 100644 index 03bce17..0000000 --- a/0013-RHBZ-883981-cleanup-rpmdiff-issues.patch +++ /dev/null @@ -1,148 +0,0 @@ ---- - Makefile.inc | 9 +++++---- - kpartx/Makefile | 2 +- - libmpathpersist/Makefile | 4 ++-- - libmultipath/Makefile | 1 + - libmultipath/checkers/Makefile | 2 +- - libmultipath/prioritizers/Makefile | 2 +- - multipath/Makefile | 2 +- - multipathd/Makefile | 5 +++-- - 8 files changed, 15 insertions(+), 12 deletions(-) - -Index: multipath-tools-130222/Makefile.inc -=================================================================== ---- multipath-tools-130222.orig/Makefile.inc -+++ multipath-tools-130222/Makefile.inc -@@ -23,15 +23,15 @@ endif - - prefix = - exec_prefix = $(prefix) --bindir = $(exec_prefix)/sbin -+bindir = $(exec_prefix)/usr/sbin - libudevdir = ${prefix}/lib/udev - multipathdir = $(TOPDIR)/libmultipath - mandir = $(prefix)/usr/share/man/man8 - man5dir = $(prefix)/usr/share/man/man5 - man3dir = $(prefix)/usr/share/man/man3 - rcdir = $(prefix)/etc/rc.d/init.d --syslibdir = $(prefix)/$(LIB) --libdir = $(prefix)/$(LIB)/multipath -+syslibdir = $(prefix)/usr/$(LIB) -+libdir = $(prefix)/usr/$(LIB)/multipath - unitdir = $(prefix)/lib/systemd/system - mpathpersistdir = $(TOPDIR)/libmpathpersist - -@@ -42,8 +42,9 @@ ifndef RPM_OPT_FLAGS - RPM_OPT_FLAGS = -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 - endif - -+LDFLAGS += -Wl,-z,relro - OPTFLAGS = $(RPM_OPT_FLAGS) -Wunused -Wstrict-prototypes --CFLAGS = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" -+CFLAGS = $(OPTFLAGS) -DLIB_STRING=\"${LIB}\" - SHARED_FLAGS = -shared - - %.o: %.c -Index: multipath-tools-130222/multipathd/Makefile -=================================================================== ---- multipath-tools-130222.orig/multipathd/Makefile -+++ multipath-tools-130222/multipathd/Makefile -@@ -5,9 +5,10 @@ include ../Makefile.inc - # - # basic flags setting - # --CFLAGS += -I$(multipathdir) -I$(mpathpersistdir) -+CFLAGS += -fPIE -DPIE -I$(multipathdir) -I$(mpathpersistdir) - LDFLAGS += -lpthread -ldevmapper -lreadline -ludev -ldl \ -- -L$(multipathdir) -lmultipath -L$(mpathpersistdir) -lmpathpersist -+ -L$(multipathdir) -lmultipath -L$(mpathpersistdir) -lmpathpersist \ -+ -Wl,-z,now -pie - - # - # debuging stuff -Index: multipath-tools-130222/kpartx/Makefile -=================================================================== ---- multipath-tools-130222.orig/kpartx/Makefile -+++ multipath-tools-130222/kpartx/Makefile -@@ -4,7 +4,7 @@ - # - include ../Makefile.inc - --CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -+CFLAGS += -fPIC -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 - - LIBDM_API_COOKIE = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_set_cookie' /usr/include/libdevmapper.h) - -Index: multipath-tools-130222/libmpathpersist/Makefile -=================================================================== ---- multipath-tools-130222.orig/libmpathpersist/Makefile -+++ multipath-tools-130222/libmpathpersist/Makefile -@@ -10,7 +10,7 @@ DEVLIB = libmpathpersist.so - LIBS = $(DEVLIB).$(SONAME) - - --CFLAGS += -I$(multipathdir) -I$(mpathpersistdir) -+CFLAGS += -fPIC -I$(multipathdir) -I$(mpathpersistdir) - LIBDEPS += -lpthread -ldevmapper -ldl -L$(multipathdir) -lmultipath - - OBJS = mpath_persist.o mpath_updatepr.o mpath_pr_ioctl.o -@@ -19,7 +19,7 @@ all: $(LIBS) - - - $(LIBS): -- $(CC) -Wall -fPIC -c $(CFLAGS) *.c -+ $(CC) -Wall -c $(CFLAGS) *.c - $(CC) -shared $(LIBDEPS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS) - ln -s $(LIBS) $(DEVLIB) - $(GZIP) mpath_persistent_reserve_in.3 > mpath_persistent_reserve_in.3.gz -Index: multipath-tools-130222/libmultipath/Makefile -=================================================================== ---- multipath-tools-130222.orig/libmultipath/Makefile -+++ multipath-tools-130222/libmultipath/Makefile -@@ -8,6 +8,7 @@ SONAME=0 - DEVLIB = libmultipath.so - LIBS = $(DEVLIB).$(SONAME) - LIBDEPS = -lpthread -ldl -ldevmapper -ludev -+CFLAGS += -fPIC - - OBJS = memory.o parser.o vector.o devmapper.o \ - hwtable.o blacklist.o util.o dmparser.o config.o \ -Index: multipath-tools-130222/libmultipath/checkers/Makefile -=================================================================== ---- multipath-tools-130222.orig/libmultipath/checkers/Makefile -+++ multipath-tools-130222/libmultipath/checkers/Makefile -@@ -14,7 +14,7 @@ LIBS= \ - libcheckhp_sw.so \ - libcheckrdac.so - --CFLAGS += -I.. -+CFLAGS += -fPIC -I.. - - all: $(LIBS) - -Index: multipath-tools-130222/libmultipath/prioritizers/Makefile -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/Makefile -+++ multipath-tools-130222/libmultipath/prioritizers/Makefile -@@ -17,7 +17,7 @@ LIBS = \ - libprioweightedpath.so \ - libprioiet.so - --CFLAGS += -I.. -+CFLAGS += -fPIC -I.. - - all: $(LIBS) - -Index: multipath-tools-130222/multipath/Makefile -=================================================================== ---- multipath-tools-130222.orig/multipath/Makefile -+++ multipath-tools-130222/multipath/Makefile -@@ -6,7 +6,7 @@ include ../Makefile.inc - - OBJS = main.o - --CFLAGS += -I$(multipathdir) -+CFLAGS += -fPIC -I$(multipathdir) - LDFLAGS += -lpthread -ldevmapper -ldl -L$(multipathdir) -lmultipath - - EXEC = multipath diff --git a/0014-RH-handle-other-sector-sizes.patch b/0014-RH-handle-other-sector-sizes.patch deleted file mode 100644 index d07e0d8..0000000 --- a/0014-RH-handle-other-sector-sizes.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- - kpartx/gpt.c | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -Index: multipath-tools-120821/kpartx/gpt.c -=================================================================== ---- multipath-tools-120821.orig/kpartx/gpt.c -+++ multipath-tools-120821/kpartx/gpt.c -@@ -637,6 +637,7 @@ read_gpt_pt (int fd, struct slice all, s - uint32_t i; - int n = 0; - int last_used_index=-1; -+ int sector_size_mul = get_sector_size(fd)/512; - - if (!find_valid_gpt (fd, &gpt, &ptes) || !gpt || !ptes) { - if (gpt) -@@ -652,9 +653,11 @@ read_gpt_pt (int fd, struct slice all, s - sp[n].size = 0; - n++; - } else { -- sp[n].start = __le64_to_cpu(ptes[i].starting_lba); -- sp[n].size = __le64_to_cpu(ptes[i].ending_lba) - -- __le64_to_cpu(ptes[i].starting_lba) + 1; -+ sp[n].start = sector_size_mul * -+ __le64_to_cpu(ptes[i].starting_lba); -+ sp[n].size = sector_size_mul * -+ (__le64_to_cpu(ptes[i].ending_lba) - -+ __le64_to_cpu(ptes[i].starting_lba) + 1); - last_used_index=n; - n++; - } diff --git a/0015-RH-fix-output-buffer.patch b/0015-RH-fix-output-buffer.patch deleted file mode 100644 index ffbbaad..0000000 --- a/0015-RH-fix-output-buffer.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- - libmultipath/print.c | 31 +++++++++++++++++++++++++++---- - 1 file changed, 27 insertions(+), 4 deletions(-) - -Index: multipath-tools-130222/libmultipath/print.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.c -+++ multipath-tools-130222/libmultipath/print.c -@@ -8,6 +8,8 @@ - #include - #include - #include -+#include -+#include - - #include "checkers.h" - #include "vector.h" -@@ -24,6 +26,7 @@ - #include "switchgroup.h" - #include "devmapper.h" - #include "uevent.h" -+#include "debug.h" - - #define MAX(x,y) (x > y) ? x : y - #define TAIL (line + len - 1 - c) -@@ -754,12 +757,32 @@ snprint_pathgroup (char * line, int len, - extern void - print_multipath_topology (struct multipath * mpp, int verbosity) - { -- char buff[MAX_LINE_LEN * MAX_LINES] = {}; -+ int resize; -+ char *buff = NULL; -+ char *old = NULL; -+ int len, maxlen = MAX_LINE_LEN * MAX_LINES; - -- memset(&buff[0], 0, MAX_LINE_LEN * MAX_LINES); -- snprint_multipath_topology(&buff[0], MAX_LINE_LEN * MAX_LINES, -- mpp, verbosity); -+ buff = MALLOC(maxlen); -+ do { -+ if (!buff) { -+ if (old) -+ FREE(old); -+ condlog(0, "couldn't allocate memory for list: %s\n", -+ strerror(errno)); -+ return; -+ } -+ -+ len = snprint_multipath_topology(buff, maxlen, mpp, verbosity); -+ resize = (len == maxlen - 1); -+ -+ if (resize) { -+ maxlen *= 2; -+ old = buff; -+ buff = REALLOC(buff, maxlen); -+ } -+ } while (resize); - printf("%s", buff); -+ FREE(buff); - } - - extern int diff --git a/0016-RH-dont-print-ghost-messages.patch b/0016-RH-dont-print-ghost-messages.patch deleted file mode 100644 index 3387424..0000000 --- a/0016-RH-dont-print-ghost-messages.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- - libmultipath/discovery.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -898,7 +898,8 @@ get_state (struct path * pp, int daemon) - c->timeout = DEF_TIMEOUT; - state = checker_check(c); - condlog(3, "%s: state = %s", pp->dev, checker_state_name(state)); -- if (state != PATH_UP && strlen(checker_message(c))) -+ if (state != PATH_UP && state != PATH_GHOST && -+ strlen(checker_message(c))) - condlog(3, "%s: checker msg is \"%s\"", - pp->dev, checker_message(c)); - return state; diff --git a/0018-RH-fix-factorize.patch b/0018-RH-fix-factorize.patch deleted file mode 100644 index 1dfcab5..0000000 --- a/0018-RH-fix-factorize.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmultipath/config.c | 2 ++ - 1 file changed, 2 insertions(+) - -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -437,6 +437,8 @@ restart: - merge_hwe(hwe2, hwe1); - if (hwe_strmatch(hwe2, hwe1) == 0) { - vector_del_slot(hw, i); -+ free_hwe(hwe1); -+ n -= 1; - /* - * Play safe here; we have modified - * the original vector so the outer diff --git a/0019-RH-fix-sockets.patch b/0019-RH-fix-sockets.patch deleted file mode 100644 index 8639e20..0000000 --- a/0019-RH-fix-sockets.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- - libmpathpersist/mpath_updatepr.c | 3 ++- - libmultipath/uxsock.c | 4 ++-- - 2 files changed, 4 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/libmpathpersist/mpath_updatepr.c -=================================================================== ---- multipath-tools-130222.orig/libmpathpersist/mpath_updatepr.c -+++ multipath-tools-130222/libmpathpersist/mpath_updatepr.c -@@ -14,6 +14,7 @@ - #include - #include "memory.h" - #include "../libmultipath/uxsock.h" -+#include "../libmultipath/defaults.h" - - unsigned long mem_allocated; /* Total memory used in Bytes */ - -@@ -25,7 +26,7 @@ int update_prflag(char * arg1, char * ar - size_t len; - int ret = 0; - -- fd = ux_socket_connect("/var/run/multipathd.sock"); -+ fd = ux_socket_connect(DEFAULT_SOCKET); - if (fd == -1) { - condlog (0, "ux socket connect error"); - return 1 ; -Index: multipath-tools-130222/libmultipath/uxsock.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/uxsock.c -+++ multipath-tools-130222/libmultipath/uxsock.c -@@ -31,7 +31,7 @@ int ux_socket_connect(const char *name) - memset(&addr, 0, sizeof(addr)); - addr.sun_family = AF_LOCAL; - addr.sun_path[0] = '\0'; -- len = strlen(name) + 1; -+ len = strlen(name) + 1 + sizeof(sa_family_t); - strncpy(&addr.sun_path[1], name, len); - - fd = socket(AF_LOCAL, SOCK_STREAM, 0); -@@ -62,7 +62,7 @@ int ux_socket_listen(const char *name) - memset(&addr, 0, sizeof(addr)); - addr.sun_family = AF_LOCAL; - addr.sun_path[0] = '\0'; -- len = strlen(name) + 1; -+ len = strlen(name) + 1 + sizeof(sa_family_t); - strncpy(&addr.sun_path[1], name, len); - - if (bind(fd, (struct sockaddr *)&addr, len) == -1) { diff --git a/0020-RHBZ-907360-static-pthread-init.patch b/0020-RHBZ-907360-static-pthread-init.patch deleted file mode 100644 index bafa5ce..0000000 --- a/0020-RHBZ-907360-static-pthread-init.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- - libmultipath/uevent.c | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) - -Index: multipath-tools-130222/libmultipath/uevent.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/uevent.c -+++ multipath-tools-130222/libmultipath/uevent.c -@@ -53,8 +53,10 @@ typedef int (uev_trigger)(struct uevent - - pthread_t uevq_thr; - LIST_HEAD(uevq); --pthread_mutex_t uevq_lock, *uevq_lockp = &uevq_lock; --pthread_cond_t uev_cond, *uev_condp = &uev_cond; -+pthread_mutex_t uevq_lock = PTHREAD_MUTEX_INITIALIZER; -+pthread_mutex_t *uevq_lockp = &uevq_lock; -+pthread_cond_t uev_cond = PTHREAD_COND_INITIALIZER; -+pthread_cond_t *uev_condp = &uev_cond; - uev_trigger *my_uev_trigger; - void * my_trigger_data; - int servicing_uev; -@@ -409,10 +411,6 @@ int uevent_listen(void) - * thereby not getting to empty the socket's receive buffer queue - * often enough. - */ -- INIT_LIST_HEAD(&uevq); -- -- pthread_mutex_init(uevq_lockp, NULL); -- pthread_cond_init(uev_condp, NULL); - pthread_cleanup_push(uevq_stop, NULL); - - monitor = udev_monitor_new_from_netlink(conf->udev, "udev"); -@@ -525,8 +523,6 @@ out: - if (need_failback) - err = failback_listen(); - pthread_cleanup_pop(1); -- pthread_mutex_destroy(uevq_lockp); -- pthread_cond_destroy(uev_condp); - return err; - } - diff --git a/0021-RHBZ-919119-respect-kernel-cmdline.patch b/0021-RHBZ-919119-respect-kernel-cmdline.patch deleted file mode 100644 index cea1e48..0000000 --- a/0021-RHBZ-919119-respect-kernel-cmdline.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- - multipath/multipath.rules | 2 ++ - multipathd/multipathd.service | 1 + - 2 files changed, 3 insertions(+) - -Index: multipath-tools-130222/multipath/multipath.rules -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.rules -+++ multipath-tools-130222/multipath/multipath.rules -@@ -2,6 +2,8 @@ - # so name them after their devmap name - SUBSYSTEM!="block", GOTO="end_mpath" - -+IMPORT{cmdline}="nompath" -+ENV{nompath}=="?*", GOTO="end_mpath" - ENV{MPATH_SBIN_PATH}="/sbin" - TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin" - -Index: multipath-tools-130222/multipathd/multipathd.service -=================================================================== ---- multipath-tools-130222.orig/multipathd/multipathd.service -+++ multipath-tools-130222/multipathd/multipathd.service -@@ -3,6 +3,7 @@ Description=Device-Mapper Multipath Devi - Before=iscsi.service iscsid.service lvm2-activation-early.service - After=syslog.target - ConditionPathExists=/etc/multipath.conf -+ConditionKernelCommandLine=!nompath - DefaultDependencies=no - Conflicts=shutdown.target - diff --git a/0022-RH-multipathd-check-wwids.patch b/0022-RH-multipathd-check-wwids.patch deleted file mode 100644 index b6e8f42..0000000 --- a/0022-RH-multipathd-check-wwids.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- - multipathd/main.c | 1 + - 1 file changed, 1 insertion(+) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -1363,6 +1363,7 @@ configure (struct vectors * vecs, int st - - sync_maps_state(mpvec); - vector_foreach_slot(mpvec, mpp, i){ -+ remember_wwid(mpp->wwid); - update_map_pr(mpp); - } - diff --git a/0023-RH-multipath-wipe-wwid.patch b/0023-RH-multipath-wipe-wwid.patch deleted file mode 100644 index 6de04bf..0000000 --- a/0023-RH-multipath-wipe-wwid.patch +++ /dev/null @@ -1,239 +0,0 @@ ---- - libmultipath/discovery.c | 3 + - libmultipath/wwids.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++ - libmultipath/wwids.h | 1 - multipath/main.c | 26 ++++++++++++-- - multipath/multipath.8 | 5 ++ - 5 files changed, 115 insertions(+), 6 deletions(-) - -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -53,7 +53,8 @@ store_pathinfo (vector pathvec, vector h - goto out; - } - pp->udev = udev_device_ref(udevice); -- err = pathinfo(pp, hwtable, flag | DI_BLACKLIST); -+ err = pathinfo(pp, hwtable, -+ (conf->dry_run == 3)? flag : (flag | DI_BLACKLIST)); - if (err) - goto out; - -Index: multipath-tools-130222/libmultipath/wwids.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.c -+++ multipath-tools-130222/libmultipath/wwids.c -@@ -82,6 +82,92 @@ write_out_wwid(int fd, char *wwid) { - } - - int -+do_remove_wwid(int fd, char *str) { -+ char buf[4097]; -+ char *ptr; -+ off_t start = 0; -+ int bytes; -+ -+ while (1) { -+ if (lseek(fd, start, SEEK_SET) < 0) { -+ condlog(0, "wwid file read lseek failed : %s", -+ strerror(errno)); -+ return -1; -+ } -+ bytes = read(fd, buf, 4096); -+ if (bytes < 0) { -+ if (errno == EINTR || errno == EAGAIN) -+ continue; -+ condlog(0, "failed to read from wwids file : %s", -+ strerror(errno)); -+ return -1; -+ } -+ if (!bytes) /* didn't find wwid to remove */ -+ return 1; -+ buf[bytes] = '\0'; -+ ptr = strstr(buf, str); -+ if (ptr != NULL) { -+ condlog(3, "found '%s'", str); -+ if (lseek(fd, start + (ptr - buf), SEEK_SET) < 0) { -+ condlog(0, "write lseek failed : %s", -+ strerror(errno)); -+ return -1; -+ } -+ while (1) { -+ if (write(fd, "#", 1) < 0) { -+ if (errno == EINTR || errno == EAGAIN) -+ continue; -+ condlog(0, "failed to write to wwids file : %s", strerror(errno)); -+ return -1; -+ } -+ return 0; -+ } -+ } -+ ptr = strrchr(buf, '\n'); -+ if (ptr == NULL) { /* shouldn't happen, assume it is EOF */ -+ condlog(4, "couldn't find newline, assuming end of file"); -+ return 1; -+ } -+ start = start + (ptr - buf) + 1; -+ } -+} -+ -+ -+int -+remove_wwid(char *wwid) { -+ int fd, len, can_write; -+ char *str; -+ int ret = -1; -+ -+ len = strlen(wwid) + 4; /* two slashes the newline and a zero byte */ -+ str = malloc(len); -+ if (str == NULL) { -+ condlog(0, "can't allocate memory to remove wwid : %s", -+ strerror(errno)); -+ return -1; -+ } -+ if (snprintf(str, len, "/%s/\n", wwid) >= len) { -+ condlog(0, "string overflow trying to remove wwid"); -+ goto out; -+ } -+ condlog(3, "removing line '%s' from wwids file", str); -+ fd = open_file(conf->wwids_file, &can_write, WWIDS_FILE_HEADER); -+ if (fd < 0) -+ goto out; -+ if (!can_write) { -+ condlog(0, "cannot remove wwid. wwids file is read-only"); -+ goto out_file; -+ } -+ ret = do_remove_wwid(fd, str); -+ -+out_file: -+ close(fd); -+out: -+ free(str); -+ return ret; -+} -+ -+int - check_wwids_file(char *wwid, int write_wwid) - { - int fd, can_write, found, ret; -Index: multipath-tools-130222/libmultipath/wwids.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.h -+++ multipath-tools-130222/libmultipath/wwids.h -@@ -15,5 +15,6 @@ - int should_multipath(struct path *pp, vector pathvec); - int remember_wwid(char *wwid); - int check_wwids_file(char *wwid, int write_wwid); -+int remove_wwid(char *wwid); - - #endif /* _WWIDS_H */ -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -83,7 +83,7 @@ usage (char * progname) - { - fprintf (stderr, VERSION_STRING); - fprintf (stderr, "Usage:\n"); -- fprintf (stderr, " %s [-c] [-d] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); -+ fprintf (stderr, " %s [-c|-w] [-d] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); - fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname); - fprintf (stderr, " %s -F [-v lvl]\n", progname); - fprintf (stderr, " %s -t\n", progname); -@@ -104,6 +104,7 @@ usage (char * progname) - " -B treat the bindings file as read only\n" \ - " -p policy failover|multibus|group_by_serial|group_by_prio\n" \ - " -b fil bindings file location\n" \ -+ " -w remove a device from the wwids file\n" \ - " -p pol force all maps to specified path grouping policy :\n" \ - " . failover one path per priority group\n" \ - " . multibus all paths in one priority group\n" \ -@@ -212,7 +213,6 @@ get_dm_mpvec (vector curmp, vector pathv - - if (!conf->dry_run) - reinstate_paths(mpp); -- remember_wwid(mpp->wwid); - } - return 0; - } -@@ -262,7 +262,7 @@ configure (void) - /* - * if we have a blacklisted device parameter, exit early - */ -- if (dev && conf->dev_type == DEV_DEVNODE && -+ if (dev && conf->dev_type == DEV_DEVNODE && conf->dry_run != 3 && - (filter_devnode(conf->blist_devnode, - conf->elist_devnode, dev) > 0)) { - if (conf->dry_run == 2) -@@ -284,6 +284,17 @@ configure (void) - condlog(3, "scope is nul"); - goto out; - } -+ if (conf->dry_run == 3) { -+ r = remove_wwid(refwwid); -+ if (r == 0) -+ printf("wwid '%s' removed\n", refwwid); -+ else if (r == 1) { -+ printf("wwid '%s' not in wwids file\n", -+ refwwid); -+ r = 0; -+ } -+ goto out; -+ } - condlog(3, "scope limited to %s", refwwid); - if (conf->dry_run == 2) { - if (check_wwids_file(refwwid, 0) == 0){ -@@ -439,7 +450,7 @@ main (int argc, char *argv[]) - if (dm_prereq()) - exit(1); - -- while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:Brtq")) != EOF ) { -+ while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:Brtqw")) != EOF ) { - switch(arg) { - case 1: printf("optarg : %s\n",optarg); - break; -@@ -504,6 +515,9 @@ main (int argc, char *argv[]) - case 'h': - usage(argv[0]); - exit(0); -+ case 'w': -+ conf->dry_run = 3; -+ break; - case ':': - fprintf(stderr, "Missing option argument\n"); - usage(argv[0]); -@@ -555,6 +569,10 @@ main (int argc, char *argv[]) - condlog(0, "the -c option requires a path to check"); - goto out; - } -+ if (conf->dry_run == 3 && !conf->dev) { -+ condlog(0, "the -w option requires a device"); -+ goto out; -+ } - if (conf->remove == FLUSH_ONE) { - if (conf->dev_type == DEV_DEVMAP) { - r = dm_suspend_and_flush_map(conf->dev); -Index: multipath-tools-130222/multipath/multipath.8 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.8 -+++ multipath-tools-130222/multipath/multipath.8 -@@ -8,7 +8,7 @@ multipath \- Device mapper target autoco - .RB [\| \-b\ \c - .IR bindings_file \|] - .RB [\| \-d \|] --.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r \|] -+.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-w \|] - .RB [\| \-p\ \c - .BR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|] - .RB [\| device \|] -@@ -68,6 +68,9 @@ check if a block device should be a path - .B \-q - allow device tables with queue_if_no_path when multipathd is not running - .TP -+.B \-w -+remove the wwid for the specified device from the wwids file -+.TP - .BI \-p " policy" - force new maps to use the specified policy: - .RS 1.2i diff --git a/0024-RH-multipath-wipe-wwids.patch b/0024-RH-multipath-wipe-wwids.patch deleted file mode 100644 index b91836c..0000000 --- a/0024-RH-multipath-wipe-wwids.patch +++ /dev/null @@ -1,164 +0,0 @@ ---- - libmultipath/wwids.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ - libmultipath/wwids.h | 1 + - multipath/main.c | 29 +++++++++++++++++++++++++++-- - multipath/multipath.8 | 5 ++++- - 4 files changed, 76 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/libmultipath/wwids.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.c -+++ multipath-tools-130222/libmultipath/wwids.c -@@ -82,6 +82,50 @@ write_out_wwid(int fd, char *wwid) { - } - - int -+replace_wwids(vector mp) -+{ -+ int i, fd, can_write; -+ struct multipath * mpp; -+ size_t len; -+ int ret = -1; -+ -+ fd = open_file(conf->wwids_file, &can_write, WWIDS_FILE_HEADER); -+ if (fd < 0) -+ goto out; -+ if (!can_write) { -+ condlog(0, "cannot replace wwids. wwids file is read-only"); -+ goto out_file; -+ } -+ if (ftruncate(fd, 0) < 0) { -+ condlog(0, "cannot truncate wwids file : %s", strerror(errno)); -+ goto out_file; -+ } -+ len = strlen(WWIDS_FILE_HEADER); -+ if (write_all(fd, WWIDS_FILE_HEADER, len) != len) { -+ condlog(0, "Can't write wwid file header : %s", -+ strerror(errno)); -+ /* cleanup partially written header */ -+ if (ftruncate(fd, 0) < 0) -+ condlog(0, "Cannot truncate header : %s", -+ strerror(errno)); -+ goto out_file; -+ } -+ if (!mp || !mp->allocated) { -+ ret = 0; -+ goto out_file; -+ } -+ vector_foreach_slot(mp, mpp, i) { -+ if (write_out_wwid(fd, mpp->wwid) < 0) -+ goto out_file; -+ } -+ ret = 0; -+out_file: -+ close(fd); -+out: -+ return ret; -+} -+ -+int - do_remove_wwid(int fd, char *str) { - char buf[4097]; - char *ptr; -Index: multipath-tools-130222/libmultipath/wwids.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.h -+++ multipath-tools-130222/libmultipath/wwids.h -@@ -16,5 +16,6 @@ int should_multipath(struct path *pp, ve - int remember_wwid(char *wwid); - int check_wwids_file(char *wwid, int write_wwid); - int remove_wwid(char *wwid); -+int replace_wwids(vector mp); - - #endif /* _WWIDS_H */ -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -83,7 +83,7 @@ usage (char * progname) - { - fprintf (stderr, VERSION_STRING); - fprintf (stderr, "Usage:\n"); -- fprintf (stderr, " %s [-c|-w] [-d] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); -+ fprintf (stderr, " %s [-c|-w|-W] [-d] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); - fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname); - fprintf (stderr, " %s -F [-v lvl]\n", progname); - fprintf (stderr, " %s -t\n", progname); -@@ -105,6 +105,7 @@ usage (char * progname) - " -p policy failover|multibus|group_by_serial|group_by_prio\n" \ - " -b fil bindings file location\n" \ - " -w remove a device from the wwids file\n" \ -+ " -W reset the wwids file include only the current devices\n" \ - " -p pol force all maps to specified path grouping policy :\n" \ - " . failover one path per priority group\n" \ - " . multibus all paths in one priority group\n" \ -@@ -450,7 +451,7 @@ main (int argc, char *argv[]) - if (dm_prereq()) - exit(1); - -- while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:Brtqw")) != EOF ) { -+ while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:BrtqwW")) != EOF ) { - switch(arg) { - case 1: printf("optarg : %s\n",optarg); - break; -@@ -518,6 +519,9 @@ main (int argc, char *argv[]) - case 'w': - conf->dry_run = 3; - break; -+ case 'W': -+ conf->dry_run = 4; -+ break; - case ':': - fprintf(stderr, "Missing option argument\n"); - usage(argv[0]); -@@ -573,6 +577,27 @@ main (int argc, char *argv[]) - condlog(0, "the -w option requires a device"); - goto out; - } -+ if (conf->dry_run == 4) { -+ struct multipath * mpp; -+ int i; -+ vector curmp; -+ -+ curmp = vector_alloc(); -+ if (!curmp) { -+ condlog(0, "can't allocate memory for mp list"); -+ goto out; -+ } -+ if (dm_get_maps(curmp) == 0) -+ r = replace_wwids(curmp); -+ if (r == 0) -+ printf("successfully reset wwids\n"); -+ vector_foreach_slot_backwards(curmp, mpp, i) { -+ vector_del_slot(curmp, i); -+ free_multipath(mpp, KEEP_PATHS); -+ } -+ vector_free(curmp); -+ goto out; -+ } - if (conf->remove == FLUSH_ONE) { - if (conf->dev_type == DEV_DEVMAP) { - r = dm_suspend_and_flush_map(conf->dev); -Index: multipath-tools-130222/multipath/multipath.8 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.8 -+++ multipath-tools-130222/multipath/multipath.8 -@@ -8,7 +8,7 @@ multipath \- Device mapper target autoco - .RB [\| \-b\ \c - .IR bindings_file \|] - .RB [\| \-d \|] --.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-w \|] -+.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-w | \-W \|] - .RB [\| \-p\ \c - .BR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|] - .RB [\| device \|] -@@ -71,6 +71,9 @@ allow device tables with queue_if_no_pat - .B \-w - remove the wwid for the specified device from the wwids file - .TP -+.B \-W -+reset the wwids file to only include the current multipath devices -+.TP - .BI \-p " policy" - force new maps to use the specified policy: - .RS 1.2i diff --git a/0025-UPBZ-916668_add_maj_min.patch b/0025-UPBZ-916668_add_maj_min.patch deleted file mode 100644 index 615533d..0000000 --- a/0025-UPBZ-916668_add_maj_min.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- - multipathd/main.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -537,7 +537,8 @@ rescan: - goto fail_map; - - if (retries >= 0) { -- condlog(2, "%s path added to devmap %s", pp->dev, mpp->alias); -+ condlog(2, "%s [%s]: path added to devmap %s", -+ pp->dev, pp->dev_t, mpp->alias); - return 0; - } - else -@@ -642,8 +643,8 @@ ev_remove_path (struct path *pp, struct - } - sync_map_state(mpp); - -- condlog(2, "%s: path removed from map %s", -- pp->dev, mpp->alias); -+ condlog(2, "%s [%s]: path removed from map %s", -+ pp->dev, pp->dev_t, mpp->alias); - } - } - diff --git a/0026-fix-checker-time.patch b/0026-fix-checker-time.patch deleted file mode 100644 index e05ef58..0000000 --- a/0026-fix-checker-time.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- - multipathd/main.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -1226,11 +1226,10 @@ check_path (struct vectors * vecs, struc - pp->checkint = 2 * pp->checkint; - else - pp->checkint = conf->max_checkint; -- -- pp->tick = pp->checkint; -- condlog(4, "%s: delay next check %is", -- pp->dev_t, pp->tick); - } -+ pp->tick = pp->checkint; -+ condlog(4, "%s: delay next check %is", -+ pp->dev_t, pp->tick); - } - } - else if (newstate == PATH_DOWN) { diff --git a/0027-RH-get-wwid.patch b/0027-RH-get-wwid.patch deleted file mode 100644 index 04217b4..0000000 --- a/0027-RH-get-wwid.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmultipath/structs_vec.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/structs_vec.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs_vec.c -+++ multipath-tools-130222/libmultipath/structs_vec.c -@@ -106,7 +106,7 @@ orphan_paths (vector pathvec, struct mul - static void - set_multipath_wwid (struct multipath * mpp) - { -- if (mpp->wwid) -+ if (strlen(mpp->wwid)) - return; - - dm_get_uuid(mpp->alias, mpp->wwid); diff --git a/0028-RHBZ-929078-refresh-udev-dev.patch b/0028-RHBZ-929078-refresh-udev-dev.patch deleted file mode 100644 index c14ddb5..0000000 --- a/0028-RHBZ-929078-refresh-udev-dev.patch +++ /dev/null @@ -1,55 +0,0 @@ ---- - libmultipath/discovery.c | 2 +- - multipathd/main.c | 19 ++++++++++++++++++- - 2 files changed, 19 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -1034,7 +1034,7 @@ pathinfo (struct path *pp, vector hwtabl - } - } - -- if (path_state == PATH_UP && (mask & DI_WWID) && !strlen(pp->wwid)) -+ if ((mask & DI_WWID) && !strlen(pp->wwid)) - get_uid(pp); - if (mask & DI_BLACKLIST && mask & DI_WWID) { - if (filter_wwid(conf->blist_wwid, conf->elist_wwid, -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -376,7 +376,7 @@ static int - uev_add_path (struct uevent *uev, struct vectors * vecs) - { - struct path *pp; -- int ret; -+ int ret, i; - - condlog(2, "%s: add path (uevent)", uev->kernel); - if (strstr(uev->kernel, "..") != NULL) { -@@ -393,6 +393,23 @@ uev_add_path (struct uevent *uev, struct - uev->kernel); - if (pp->mpp) - return 0; -+ if (!strlen(pp->wwid)) { -+ udev_device_unref(pp->udev); -+ pp->udev = udev_device_ref(uev->udev); -+ ret = pathinfo(pp, conf->hwtable, -+ DI_ALL | DI_BLACKLIST); -+ if (ret == 2) { -+ i = find_slot(vecs->pathvec, (void *)pp); -+ if (i != -1) -+ vector_del_slot(vecs->pathvec, i); -+ free_path(pp); -+ return 0; -+ } else if (ret == 1) { -+ condlog(0, "%s: failed to reinitialize path", -+ uev->kernel); -+ return 1; -+ } -+ } - } else { - /* - * get path vital state diff --git a/0029-RH-no-prio-put-msg.patch b/0029-RH-no-prio-put-msg.patch deleted file mode 100644 index 6ebdae0..0000000 --- a/0029-RH-no-prio-put-msg.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- - libmultipath/prio.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/prio.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prio.c -+++ multipath-tools-130222/libmultipath/prio.c -@@ -162,7 +162,10 @@ void prio_put (struct prio * dst) - if (!dst) - return; - -- src = prio_lookup(dst->name); -+ if (!strlen(dst->name)) -+ src = NULL; -+ else -+ src = prio_lookup(dst->name); - memset(dst, 0x0, sizeof(struct prio)); - free_prio(src); - } diff --git a/0030-RHBZ-916528-override-queue-no-daemon.patch b/0030-RHBZ-916528-override-queue-no-daemon.patch deleted file mode 100644 index e663ded..0000000 --- a/0030-RHBZ-916528-override-queue-no-daemon.patch +++ /dev/null @@ -1,200 +0,0 @@ ---- - libmultipath/dict.c | 10 ++++------ - libmultipath/structs.h | 2 +- - multipathd/cli.c | 3 +++ - multipathd/cli.h | 2 ++ - multipathd/cli_handlers.c | 18 ++++++++++++++++++ - multipathd/cli_handlers.h | 2 ++ - multipathd/main.c | 2 ++ - multipathd/multipathd.init.redhat | 14 ++++++++++---- - 8 files changed, 42 insertions(+), 11 deletions(-) - -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -438,14 +438,11 @@ def_queue_without_daemon(vector strvec) - if (!buff) - return 1; - -- if (!strncmp(buff, "off", 3) || !strncmp(buff, "no", 2) || -- !strncmp(buff, "0", 1)) -- conf->queue_without_daemon = QUE_NO_DAEMON_OFF; -- else if (!strncmp(buff, "on", 2) || !strncmp(buff, "yes", 3) || -+ if (!strncmp(buff, "on", 2) || !strncmp(buff, "yes", 3) || - !strncmp(buff, "1", 1)) - conf->queue_without_daemon = QUE_NO_DAEMON_ON; - else -- conf->queue_without_daemon = QUE_NO_DAEMON_UNDEF; -+ conf->queue_without_daemon = QUE_NO_DAEMON_OFF; - - free(buff); - return 0; -@@ -2670,8 +2667,9 @@ snprint_def_queue_without_daemon (char * - case QUE_NO_DAEMON_OFF: - return snprintf(buff, len, "\"no\""); - case QUE_NO_DAEMON_ON: -- case QUE_NO_DAEMON_UNDEF: - return snprintf(buff, len, "\"yes\""); -+ case QUE_NO_DAEMON_FORCE: -+ return snprintf(buff, len, "\"forced\""); - } - return 0; - } -Index: multipath-tools-130222/libmultipath/structs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.h -+++ multipath-tools-130222/libmultipath/structs.h -@@ -67,9 +67,9 @@ enum pgstates { - }; - - enum queue_without_daemon_states { -- QUE_NO_DAEMON_UNDEF, - QUE_NO_DAEMON_OFF, - QUE_NO_DAEMON_ON, -+ QUE_NO_DAEMON_FORCE, - }; - - enum pgtimeouts { -Index: multipath-tools-130222/multipathd/cli.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli.c -+++ multipath-tools-130222/multipathd/cli.c -@@ -162,6 +162,7 @@ load_keys (void) - r += add_key(keys, "resize", RESIZE, 0); - r += add_key(keys, "reset", RESET, 0); - r += add_key(keys, "reload", RELOAD, 0); -+ r += add_key(keys, "forcequeueing", FORCEQ, 0); - r += add_key(keys, "disablequeueing", DISABLEQ, 0); - r += add_key(keys, "restorequeueing", RESTOREQ, 0); - r += add_key(keys, "paths", PATHS, 0); -@@ -459,6 +460,8 @@ cli_init (void) { - add_handler(GETPRSTATUS+MAP, NULL); - add_handler(SETPRSTATUS+MAP, NULL); - add_handler(UNSETPRSTATUS+MAP, NULL); -+ add_handler(FORCEQ+DAEMON, NULL); -+ add_handler(RESTOREQ+DAEMON, NULL); - - return 0; - } -Index: multipath-tools-130222/multipathd/cli.h -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli.h -+++ multipath-tools-130222/multipathd/cli.h -@@ -10,6 +10,7 @@ enum { - __RESIZE, - __RESET, - __RELOAD, -+ __FORCEQ, - __DISABLEQ, - __RESTOREQ, - __PATHS, -@@ -45,6 +46,7 @@ enum { - #define RESIZE (1 << __RESIZE) - #define RESET (1 << __RESET) - #define RELOAD (1 << __RELOAD) -+#define FORCEQ (1 << __FORCEQ) - #define DISABLEQ (1 << __DISABLEQ) - #define RESTOREQ (1 << __RESTOREQ) - #define PATHS (1 << __PATHS) -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -628,6 +628,24 @@ cli_resize(void *v, char **reply, int *l - } - - int -+cli_force_no_daemon_q(void * v, char ** reply, int * len, void * data) -+{ -+ condlog(2, "force queue_without_daemon (operator)"); -+ if (conf->queue_without_daemon == QUE_NO_DAEMON_OFF) -+ conf->queue_without_daemon = QUE_NO_DAEMON_FORCE; -+ return 0; -+} -+ -+int -+cli_restore_no_daemon_q(void * v, char ** reply, int * len, void * data) -+{ -+ condlog(2, "restore queue_without_daemon (operator)"); -+ if (conf->queue_without_daemon == QUE_NO_DAEMON_FORCE) -+ conf->queue_without_daemon = QUE_NO_DAEMON_OFF; -+ return 0; -+} -+ -+int - cli_restore_queueing(void *v, char **reply, int *len, void *data) - { - struct vectors * vecs = (struct vectors *)data; -Index: multipath-tools-130222/multipathd/cli_handlers.h -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.h -+++ multipath-tools-130222/multipathd/cli_handlers.h -@@ -28,6 +28,8 @@ int cli_suspend(void * v, char ** reply, - int cli_resume(void * v, char ** reply, int * len, void * data); - int cli_reinstate(void * v, char ** reply, int * len, void * data); - int cli_fail(void * v, char ** reply, int * len, void * data); -+int cli_force_no_daemon_q(void * v, char ** reply, int * len, void * data); -+int cli_restore_no_daemon_q(void * v, char ** reply, int * len, void * data); - int cli_quit(void * v, char ** reply, int * len, void * data); - int cli_shutdown(void * v, char ** reply, int * len, void * data); - int cli_reassign (void * v, char ** reply, int * len, void * data); -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -904,6 +904,8 @@ uxlsnrloop (void * ap) - set_handler_callback(GETPRSTATUS+MAP, cli_getprstatus); - set_handler_callback(SETPRSTATUS+MAP, cli_setprstatus); - set_handler_callback(UNSETPRSTATUS+MAP, cli_unsetprstatus); -+ set_handler_callback(FORCEQ+DAEMON, cli_force_no_daemon_q); -+ set_handler_callback(RESTOREQ+DAEMON, cli_restore_no_daemon_q); - - umask(077); - uxsock_listen(&uxsock_trigger, ap); -Index: multipath-tools-130222/multipathd/multipathd.init.redhat -=================================================================== ---- multipath-tools-130222.orig/multipathd/multipathd.init.redhat -+++ multipath-tools-130222/multipathd/multipathd.init.redhat -@@ -81,23 +81,28 @@ force_stop() { - echo - } - --stop() { -+check_root() { - root_dev=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/mtab) - dm_num=`dmsetup info -c --noheadings -o minor $root_dev 2> /dev/null` - if [ $? -eq 0 ]; then - root_dm_device="dm-$dm_num" - [ -d $syspath/$root_dm_device ] && teardown_slaves $syspath/$root_dm_device - fi -+} - -- force_stop -+force_queue_without_daemon() { -+ $DAEMON forcequeueing daemon - } - - restart() { -- stop -+ force_queue_without_daemon -+ check_root -+ force_stop - start - } - - force_restart() { -+ force_queue_without_daemon - force_stop - start - } -@@ -115,7 +120,8 @@ start) - start - ;; - stop) -- stop -+ check_root -+ force_stop - ;; - force-stop) - force_stop diff --git a/0031-RHBZ-957188-kpartx-use-dm-name.patch b/0031-RHBZ-957188-kpartx-use-dm-name.patch deleted file mode 100644 index 282c517..0000000 --- a/0031-RHBZ-957188-kpartx-use-dm-name.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - kpartx/kpartx.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/kpartx/kpartx.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.c -+++ multipath-tools-130222/kpartx/kpartx.c -@@ -348,7 +348,7 @@ main(int argc, char **argv){ - if (delim == NULL) { - delim = malloc(DELIM_SIZE); - memset(delim, 0, DELIM_SIZE); -- set_delimiter(device, delim); -+ set_delimiter(mapname, delim); - } - - fd = open(device, O_RDONLY); diff --git a/0032-RHBZ-956464-mpathconf-defaults.patch b/0032-RHBZ-956464-mpathconf-defaults.patch deleted file mode 100644 index d63c32e..0000000 --- a/0032-RHBZ-956464-mpathconf-defaults.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- - multipath/mpathconf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/multipath/mpathconf -=================================================================== ---- multipath-tools-130222.orig/multipath/mpathconf -+++ multipath-tools-130222/multipath/mpathconf -@@ -31,8 +31,8 @@ function usage - echo "Commands:" - echo "Enable: --enable " - echo "Disable: --disable" -- echo "Set user_friendly_names (Default n): --user_friendly_names " -- echo "Set find_multipaths (Default n): --find_multipaths " -+ echo "Set user_friendly_names (Default y): --user_friendly_names " -+ echo "Set find_multipaths (Default y): --find_multipaths " - echo "Load the dm-multipath modules on enable (Default y): --with_module " - echo "start/stop/reload multipathd (Default n): --with_multipathd " - echo "" diff --git a/0033-RHBZ-829963-e-series-conf.patch b/0033-RHBZ-829963-e-series-conf.patch deleted file mode 100644 index d8fc119..0000000 --- a/0033-RHBZ-829963-e-series-conf.patch +++ /dev/null @@ -1,44 +0,0 @@ -This patch provides hwtable updates for NETAPP/LSI/ENGENIO E-Series arrays, -utilizing new features to detect TPGS support, automatically. - -Signed-off-by: Sean Stewart - ---- ---- - libmultipath/hwtable.c | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/libmultipath/hwtable.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/hwtable.c -+++ multipath-tools-130222/libmultipath/hwtable.c -@@ -1046,9 +1046,13 @@ static struct hwentry default_hw[] = { - .checker_name = RDAC, - .prio_name = PRIO_RDAC, - }, -- /* LSI/Engenio/NetApp E-Series RDAC storage */ -+ /* LSI/Engenio/NetApp E-Series RDAC storage -+ * -+ * Maintainer : Sean Stewart -+ * Mail : sean.stewart@netapp.com -+ */ - { -- .vendor = "(LSI|ENGENIO)", -+ .vendor = "(NETAPP|LSI|ENGENIO)", - .product = "INF-01-00", - .bl_product = "Universal Xport", - .features = "2 pg_init_retries 50", -@@ -1056,10 +1060,12 @@ static struct hwentry default_hw[] = { - .pgpolicy = GROUP_BY_PRIO, - .pgfailback = -FAILBACK_IMMEDIATE, - .rr_weight = RR_WEIGHT_NONE, -- .no_path_retry = 15, -+ .no_path_retry = 30, - .checker_name = RDAC, - .prio_name = PRIO_RDAC, - .prio_args = NULL, -+ .detect_prio = DETECT_PRIO_ON, -+ .retain_hwhandler = RETAIN_HWHANDLER_ON, - }, - { - .vendor = "STK", diff --git a/0034-RHBZ-851416-mpathconf-display.patch b/0034-RHBZ-851416-mpathconf-display.patch deleted file mode 100644 index e9e00ce..0000000 --- a/0034-RHBZ-851416-mpathconf-display.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- - multipath/mpathconf | 21 +++++++++++++++------ - 1 file changed, 15 insertions(+), 6 deletions(-) - -Index: multipath-tools-130222/multipath/mpathconf -=================================================================== ---- multipath-tools-130222.orig/multipath/mpathconf -+++ multipath-tools-130222/multipath/mpathconf -@@ -159,7 +159,7 @@ if [ -z "$MODULE" -o "$MODULE" = "y" ]; - fi - - if [ "$MULTIPATHD" = "y" ]; then -- if service multipathd status > /dev/null ; then -+ if /bin/systemctl status multipathd.service > /dev/null 2>&1 ; then - HAVE_MULTIPATHD=1 - else - HAVE_MULTIPATHD=0 -@@ -210,8 +210,17 @@ if [ -n "$SHOW_STATUS" ]; then - echo "dm_multipath module is not loaded" - fi - fi -- if [ -n "$HAVE_MULTIPATHD" ]; then -- service multipathd status -+ if [ -z "$HAVE_MULTIPATHD" ]; then -+ if /bin/systemctl status multipathd.service > /dev/null 2>&1 ; then -+ HAVE_MULTIPATHD=1 -+ else -+ HAVE_MULTIPATHD=0 -+ fi -+ fi -+ if [ "$HAVE_MULTIPATHD" = 1 ]; then -+ echo "multipathd is running" -+ else -+ echo "multipathd is not running" - fi - exit 0 - fi -@@ -301,12 +310,12 @@ if [ "$ENABLE" = 1 ]; then - modprobe dm_multipath - fi - if [ "$HAVE_MULTIPATHD" = 0 ]; then -- service multipathd start -+ systemctl start multipathd.service - fi - elif [ "$ENABLE" = 0 ]; then - if [ "$HAVE_MULTIPATHD" = 1 ]; then -- service multipathd stop -+ systemctl stop multipathd.service - fi - elif [ -n "$CHANGED_CONFIG" -a "$HAVE_MULTIPATHD" = 1 ]; then -- service multipathd reload -+ systemctl reload multipathd.service - fi diff --git a/0035-RHBZ-891921-list-mpp.patch b/0035-RHBZ-891921-list-mpp.patch deleted file mode 100644 index b0bb7a2..0000000 --- a/0035-RHBZ-891921-list-mpp.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- - libmultipath/print.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -Index: multipath-tools-130222/libmultipath/print.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.c -+++ multipath-tools-130222/libmultipath/print.c -@@ -422,6 +422,16 @@ snprint_path_serial (char * buff, size_t - } - - static int -+snprint_path_mpp (char * buff, size_t len, struct path * pp) -+{ -+ if (!pp->mpp) -+ return snprintf(buff, len, "[orphan]"); -+ if (!pp->mpp->alias) -+ return snprintf(buff, len, "[unknown]"); -+ return snprint_str(buff, len, pp->mpp->alias); -+} -+ -+static int - snprint_path_checker (char * buff, size_t len, struct path * pp) - { - struct checker * c = &pp->checker; -@@ -464,6 +474,7 @@ struct path_data pd[] = { - {'p', "pri", 0, snprint_pri}, - {'S', "size", 0, snprint_path_size}, - {'z', "serial", 0, snprint_path_serial}, -+ {'m', "multipath", 0, snprint_path_mpp}, - {0, NULL, 0 , NULL} - }; - diff --git a/0036-RHBZ-949239-load-multipath-module.patch b/0036-RHBZ-949239-load-multipath-module.patch deleted file mode 100644 index 04a6f68..0000000 --- a/0036-RHBZ-949239-load-multipath-module.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- - multipathd/multipathd.service | 1 + - 1 file changed, 1 insertion(+) - -Index: multipath-tools-130222/multipathd/multipathd.service -=================================================================== ---- multipath-tools-130222.orig/multipathd/multipathd.service -+++ multipath-tools-130222/multipathd/multipathd.service -@@ -10,6 +10,7 @@ Conflicts=shutdown.target - [Service] - Type=forking - PIDFile=/var/run/multipathd.pid -+ExecStartPre=/sbin/modprobe dm-multipath - ExecStart=/sbin/multipathd - ExecReload=/sbin/multipathd reconfigure - #ExecStop=/path/to/scrip delete-me if not necessary diff --git a/0037-RHBZ-768873-fix-rename.patch b/0037-RHBZ-768873-fix-rename.patch deleted file mode 100644 index 7e05bd0..0000000 --- a/0037-RHBZ-768873-fix-rename.patch +++ /dev/null @@ -1,87 +0,0 @@ ---- - libmultipath/devmapper.c | 45 --------------------------------------------- - libmultipath/devmapper.h | 1 - - libmultipath/propsel.c | 2 -- - 3 files changed, 48 deletions(-) - -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -917,51 +917,6 @@ out: - return r; - } - --extern char * --dm_get_name(char *uuid) --{ -- struct dm_task *dmt; -- struct dm_info info; -- char *prefixed_uuid, *name = NULL; -- const char *nametmp; -- -- dmt = dm_task_create(DM_DEVICE_INFO); -- if (!dmt) -- return NULL; -- -- prefixed_uuid = MALLOC(UUID_PREFIX_LEN + strlen(uuid) + 1); -- if (!prefixed_uuid) { -- condlog(0, "cannot create prefixed uuid : %s", -- strerror(errno)); -- goto freeout; -- } -- sprintf(prefixed_uuid, UUID_PREFIX "%s", uuid); -- if (!dm_task_set_uuid(dmt, prefixed_uuid)) -- goto freeout; -- -- if (!dm_task_run(dmt)) -- goto freeout; -- -- if (!dm_task_get_info(dmt, &info) || !info.exists) -- goto freeout; -- -- nametmp = dm_task_get_name(dmt); -- if (nametmp && strlen(nametmp)) { -- name = MALLOC(strlen(nametmp) + 1); -- if (name) -- strcpy(name, nametmp); -- } else { -- condlog(2, "%s: no device-mapper name found", uuid); -- } -- --freeout: -- if (prefixed_uuid) -- FREE(prefixed_uuid); -- dm_task_destroy(dmt); -- -- return name; --} -- - int - dm_geteventnr (char *name) - { -Index: multipath-tools-130222/libmultipath/devmapper.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.h -+++ multipath-tools-130222/libmultipath/devmapper.h -@@ -40,7 +40,6 @@ int dm_remove_partmaps (const char * map - int dm_get_uuid(char *name, char *uuid); - int dm_get_info (char * mapname, struct dm_info ** dmi); - int dm_rename (char * old, char * new); --char * dm_get_name(char * uuid); - int dm_reassign(const char * mapname); - int dm_reassign_table(const char *name, char *old, char *new); - int dm_setgeometry(struct multipath *mpp); -Index: multipath-tools-130222/libmultipath/propsel.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.c -+++ multipath-tools-130222/libmultipath/propsel.c -@@ -263,8 +263,6 @@ select_alias (struct multipath * mp) - conf->bindings_file, mp->alias_prefix, conf->bindings_read_only); - } - if (mp->alias == NULL) -- mp->alias = dm_get_name(mp->wwid); -- if (mp->alias == NULL) - mp->alias = STRDUP(mp->wwid); - } - diff --git a/0038-RHBZ-799860-netapp-config.patch b/0038-RHBZ-799860-netapp-config.patch deleted file mode 100644 index 3b91f9b..0000000 --- a/0038-RHBZ-799860-netapp-config.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- - libmultipath/hwtable.c | 1 + - 1 file changed, 1 insertion(+) - -Index: multipath-tools-130222/libmultipath/hwtable.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/hwtable.c -+++ multipath-tools-130222/libmultipath/hwtable.c -@@ -794,6 +794,7 @@ static struct hwentry default_hw[] = { - .prio_name = PRIO_ONTAP, - .prio_args = NULL, - .retain_hwhandler = RETAIN_HWHANDLER_ON, -+ .user_friendly_names = USER_FRIENDLY_NAMES_OFF, - .detect_prio = DETECT_PRIO_ON, - }, - /* diff --git a/0039-RH-detect-prio-fix.patch b/0039-RH-detect-prio-fix.patch deleted file mode 100644 index 941a570..0000000 --- a/0039-RH-detect-prio-fix.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- - libmultipath/propsel.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/libmultipath/propsel.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.c -+++ multipath-tools-130222/libmultipath/propsel.c -@@ -384,10 +384,17 @@ select_getuid (struct path * pp) - void - detect_prio(struct path * pp) - { -+ int ret; - struct prio *p = &pp->prio; - -- if (get_target_port_group_support(pp->fd) > 0) -- prio_get(p, PRIO_ALUA, DEFAULT_PRIO_ARGS); -+ if (get_target_port_group_support(pp->fd) <= 0) -+ return; -+ ret = get_target_port_group(pp->fd); -+ if (ret < 0) -+ return; -+ if (get_asymmetric_access_state(pp->fd, ret) < 0) -+ return; -+ prio_get(p, PRIO_ALUA, DEFAULT_PRIO_ARGS); - } - - extern int diff --git a/0040-RH-bindings-fix.patch b/0040-RH-bindings-fix.patch deleted file mode 100644 index c56f352..0000000 --- a/0040-RH-bindings-fix.patch +++ /dev/null @@ -1,101 +0,0 @@ ---- - libmultipath/alias.c | 39 ++++++++++++++++++++++++++++++--------- - 1 file changed, 30 insertions(+), 9 deletions(-) - -Index: multipath-tools-130222/libmultipath/alias.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/alias.c -+++ multipath-tools-130222/libmultipath/alias.c -@@ -46,11 +46,11 @@ format_devname(char *name, int id, int l - memset(name,0, len); - strcpy(name, prefix); - for (pos = len - 1; pos >= prefix_len; pos--) { -+ id--; - name[pos] = 'a' + id % 26; - if (id < 26) - break; - id /= 26; -- id--; - } - memmove(name + prefix_len, name + pos, len - pos); - name[prefix_len + len - pos] = '\0'; -@@ -66,13 +66,22 @@ scan_devname(char *alias, char *prefix) - if (!prefix || strncmp(alias, prefix, strlen(prefix))) - return -1; - -+ if (strlen(alias) == strlen(prefix)) -+ return -1; -+ -+ if (strlen(alias) > strlen(prefix) + 7) -+ /* id of 'aaaaaaaa' overflows int */ -+ return -1; -+ - c = alias + strlen(prefix); - while (*c != '\0' && *c != ' ' && *c != '\t') { -+ if (*c < 'a' || *c > 'z') -+ return -1; - i = *c - 'a'; - n = ( n * 26 ) + i; -+ if (n < 0) -+ return -1; - c++; -- if (*c < 'a' || *c > 'z') -- break; - n++; - } - -@@ -84,7 +93,9 @@ lookup_binding(FILE *f, char *map_wwid, - { - char buf[LINE_MAX]; - unsigned int line_nr = 0; -- int id = 0; -+ int id = 1; -+ int biggest_id = 1; -+ int smallest_bigger_id = INT_MAX; - - *map_alias = NULL; - -@@ -100,8 +111,12 @@ lookup_binding(FILE *f, char *map_wwid, - if (!alias) /* blank line */ - continue; - curr_id = scan_devname(alias, prefix); -- if (curr_id >= id) -- id = curr_id + 1; -+ if (curr_id == id) -+ id++; -+ if (curr_id > biggest_id) -+ biggest_id = curr_id; -+ if (curr_id > id && curr_id < smallest_bigger_id) -+ smallest_bigger_id = curr_id; - wwid = strtok(NULL, " \t"); - if (!wwid){ - condlog(3, -@@ -116,11 +131,17 @@ lookup_binding(FILE *f, char *map_wwid, - if (*map_alias == NULL) - condlog(0, "Cannot copy alias from bindings " - "file : %s", strerror(errno)); -- return id; -+ return 0; - } - } - condlog(3, "No matching wwid [%s] in bindings file.", map_wwid); -- return id; -+ if (id < 0) { -+ condlog(0, "no more available user_friendly_names"); -+ return 0; -+ } -+ if (id < smallest_bigger_id) -+ return id; -+ return biggest_id + 1; - } - - static int -@@ -254,7 +275,7 @@ get_user_friendly_alias(char *wwid, char - return NULL; - } - -- if (!alias && can_write && !bindings_read_only) -+ if (!alias && can_write && !bindings_read_only && id) - alias = allocate_binding(fd, wwid, id, prefix); - - fclose(f); diff --git a/0041-RH-check-for-erofs.patch b/0041-RH-check-for-erofs.patch deleted file mode 100644 index d29d78d..0000000 --- a/0041-RH-check-for-erofs.patch +++ /dev/null @@ -1,121 +0,0 @@ ---- - libmultipath/configure.c | 7 ------ - libmultipath/devmapper.c | 53 ++++++++++++++++++++++------------------------- - libmultipath/devmapper.h | 2 - - 3 files changed, 25 insertions(+), 37 deletions(-) - -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -384,24 +384,17 @@ domap (struct multipath * mpp, char * pa - - r = dm_addmap_create(mpp, params); - -- if (!r) -- r = dm_addmap_create_ro(mpp, params); -- - lock_multipath(mpp, 0); - break; - - case ACT_RELOAD: - r = dm_addmap_reload(mpp, params); -- if (!r) -- r = dm_addmap_reload_ro(mpp, params); - if (r) - r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias); - break; - - case ACT_RESIZE: - r = dm_addmap_reload(mpp, params); -- if (!r) -- r = dm_addmap_reload_ro(mpp, params); - if (r) - r = dm_simplecmd_flush(DM_DEVICE_RESUME, mpp->alias, 1); - break; -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -298,42 +298,39 @@ dm_addmap (int task, const char *target, - return r; - } - --static int --_dm_addmap_create (struct multipath *mpp, char * params, int ro) { -- int r; -- r = dm_addmap(DM_DEVICE_CREATE, TGT_MPATH, mpp, params, 1, ro); -- /* -- * DM_DEVICE_CREATE is actually DM_DEV_CREATE + DM_TABLE_LOAD. -- * Failing the second part leaves an empty map. Clean it up. -- */ -- if (!r && dm_map_present(mpp->alias)) { -- condlog(3, "%s: failed to load map (a path might be in use)", -- mpp->alias); -- dm_flush_map_nosync(mpp->alias); -+extern int -+dm_addmap_create (struct multipath *mpp, char * params) { -+ int ro; -+ -+ for (ro = 0; ro <= 1; ro++) { -+ int err; -+ -+ if (dm_addmap(DM_DEVICE_CREATE, TGT_MPATH, mpp, params, 1, ro)) -+ return 1; -+ /* -+ * DM_DEVICE_CREATE is actually DM_DEV_CREATE + DM_TABLE_LOAD. -+ * Failing the second part leaves an empty map. Clean it up. -+ */ -+ err = errno; -+ if (dm_map_present(mpp->alias)) { -+ condlog(3, "%s: failed to load map (a path might be in use)", mpp->alias); -+ dm_flush_map_nosync(mpp->alias); -+ } -+ if (err != EROFS) -+ break; - } -- return r; -+ return 0; - } - - #define ADDMAP_RW 0 - #define ADDMAP_RO 1 - - extern int --dm_addmap_create (struct multipath *mpp, char *params) { -- return _dm_addmap_create(mpp, params, ADDMAP_RW); --} -- --extern int --dm_addmap_create_ro (struct multipath *mpp, char *params) { -- return _dm_addmap_create(mpp, params, ADDMAP_RO); --} -- --extern int - dm_addmap_reload (struct multipath *mpp, char *params) { -- return dm_addmap(DM_DEVICE_RELOAD, TGT_MPATH, mpp, params, 0, ADDMAP_RW); --} -- --extern int --dm_addmap_reload_ro (struct multipath *mpp, char *params) { -+ if (dm_addmap(DM_DEVICE_RELOAD, TGT_MPATH, mpp, params, 0, ADDMAP_RW)) -+ return 1; -+ if (errno != EROFS) -+ return 0; - return dm_addmap(DM_DEVICE_RELOAD, TGT_MPATH, mpp, params, 0, ADDMAP_RO); - } - -Index: multipath-tools-130222/libmultipath/devmapper.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.h -+++ multipath-tools-130222/libmultipath/devmapper.h -@@ -12,9 +12,7 @@ int dm_drv_version (unsigned int * versi - int dm_simplecmd_flush (int, const char *, int); - int dm_simplecmd_noflush (int, const char *); - int dm_addmap_create (struct multipath *mpp, char *params); --int dm_addmap_create_ro (struct multipath *mpp, char *params); - int dm_addmap_reload (struct multipath *mpp, char *params); --int dm_addmap_reload_ro (struct multipath *mpp, char *params); - int dm_map_present (const char *); - int dm_get_map(char *, unsigned long long *, char *); - int dm_get_status(char *, char *); diff --git a/0042-UP-fix-signal-handling.patch b/0042-UP-fix-signal-handling.patch deleted file mode 100644 index 4b4b40b..0000000 --- a/0042-UP-fix-signal-handling.patch +++ /dev/null @@ -1,493 +0,0 @@ ---- - libmultipath/file.c | 4 +- - libmultipath/lock.c | 9 ---- - libmultipath/lock.h | 1 - libmultipath/log_pthread.c | 22 ----------- - libmultipath/waiter.c | 2 - - multipathd/cli_handlers.c | 4 +- - multipathd/main.c | 90 ++++++++++++++++++++------------------------- - multipathd/main.h | 3 + - multipathd/uxlsnr.c | 21 +++++++--- - multipathd/uxlsnr.h | 3 + - 10 files changed, 65 insertions(+), 94 deletions(-) - -Index: multipath-tools-130222/libmultipath/file.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/file.c -+++ multipath-tools-130222/libmultipath/file.c -@@ -98,7 +98,7 @@ lock_file(int fd, char *file_name) - sigaddset(&set, SIGALRM); - - sigaction(SIGALRM, &act, &oldact); -- sigprocmask(SIG_UNBLOCK, &set, &oldset); -+ pthread_sigmask(SIG_UNBLOCK, &set, &oldset); - - alarm(FILE_TIMEOUT); - err = fcntl(fd, F_SETLKW, &lock); -@@ -112,7 +112,7 @@ lock_file(int fd, char *file_name) - condlog(0, "%s is locked. Giving up.", file_name); - } - -- sigprocmask(SIG_SETMASK, &oldset, NULL); -+ pthread_sigmask(SIG_SETMASK, &oldset, NULL); - sigaction(SIGALRM, &oldact, NULL); - return err; - } -Index: multipath-tools-130222/libmultipath/lock.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/lock.c -+++ multipath-tools-130222/libmultipath/lock.c -@@ -1,16 +1,7 @@ - #include --#include - #include "lock.h" - #include - --void block_signal (int signum, sigset_t *old) --{ -- sigset_t set; -- sigemptyset(&set); -- sigaddset(&set, signum); -- pthread_sigmask(SIG_BLOCK, &set, old); --} -- - void cleanup_lock (void * data) - { - unlock ((*(struct mutex_lock *)data)); -Index: multipath-tools-130222/libmultipath/lock.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/lock.h -+++ multipath-tools-130222/libmultipath/lock.h -@@ -29,6 +29,5 @@ struct mutex_lock { - #endif - - void cleanup_lock (void * data); --void block_signal(int signum, sigset_t *old); - - #endif /* _LOCK_H */ -Index: multipath-tools-130222/libmultipath/log_pthread.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/log_pthread.c -+++ multipath-tools-130222/libmultipath/log_pthread.c -@@ -22,26 +22,13 @@ pthread_cond_t logev_cond; - - int logq_running; - --static void --sigusr1 (int sig) --{ -- pthread_mutex_lock(&logq_lock); -- log_reset("multipathd"); -- pthread_mutex_unlock(&logq_lock); --} -- - void log_safe (int prio, const char * fmt, va_list ap) - { -- sigset_t old; -- - if (log_thr == (pthread_t)0) { - syslog(prio, fmt, ap); - return; - } - -- block_signal(SIGUSR1, &old); -- block_signal(SIGHUP, NULL); -- - pthread_mutex_lock(&logq_lock); - log_enqueue(prio, fmt, ap); - pthread_mutex_unlock(&logq_lock); -@@ -49,8 +36,6 @@ void log_safe (int prio, const char * fm - pthread_mutex_lock(&logev_lock); - pthread_cond_signal(&logev_cond); - pthread_mutex_unlock(&logev_lock); -- -- pthread_sigmask(SIG_SETMASK, &old, NULL); - } - - void log_thread_flush (void) -@@ -81,15 +66,8 @@ static void flush_logqueue (void) - - static void * log_thread (void * et) - { -- struct sigaction sig; - int running; - -- sig.sa_handler = sigusr1; -- sigemptyset(&sig.sa_mask); -- sig.sa_flags = 0; -- if (sigaction(SIGUSR1, &sig, NULL) < 0) -- logdbg(stderr, "Cannot set signal handler"); -- - pthread_mutex_lock(&logev_lock); - logq_running = 1; - pthread_mutex_unlock(&logev_lock); -Index: multipath-tools-130222/libmultipath/waiter.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/waiter.c -+++ multipath-tools-130222/libmultipath/waiter.c -@@ -157,8 +157,6 @@ void *waitevent (void *et) - waiter = (struct event_thread *)et; - pthread_cleanup_push(free_waiter, et); - -- block_signal(SIGUSR1, NULL); -- block_signal(SIGHUP, NULL); - while (1) { - r = waiteventloop(waiter); - -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -939,8 +939,8 @@ int - cli_shutdown (void * v, char ** reply, int * len, void * data) - { - condlog(3, "shutdown (operator)"); -- -- return exit_daemon(0); -+ exit_daemon(); -+ return 0; - } - - int -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - #include - - /* -@@ -52,6 +53,7 @@ - #include - #include - #include -+#include - - #include "main.h" - #include "pidfile.h" -@@ -81,13 +83,11 @@ struct mpath_event_param - - unsigned int mpath_mx_alloc_len; - --pthread_cond_t exit_cond = PTHREAD_COND_INITIALIZER; --pthread_mutex_t exit_mutex = PTHREAD_MUTEX_INITIALIZER; -- - int logsink; - enum daemon_status running_state; - pid_t daemon_pid; - -+static sem_t exit_sem; - /* - * global copy of vecs for use in sig handlers - */ -@@ -838,9 +838,6 @@ out: - static void * - ueventloop (void * ap) - { -- block_signal(SIGUSR1, NULL); -- block_signal(SIGHUP, NULL); -- - if (uevent_listen()) - condlog(0, "error starting uevent listener"); - -@@ -850,9 +847,6 @@ ueventloop (void * ap) - static void * - uevqloop (void * ap) - { -- block_signal(SIGUSR1, NULL); -- block_signal(SIGHUP, NULL); -- - if (uevent_dispatch(&uev_trigger, ap)) - condlog(0, "error starting uevent dispatcher"); - -@@ -861,9 +855,6 @@ uevqloop (void * ap) - static void * - uxlsnrloop (void * ap) - { -- block_signal(SIGUSR1, NULL); -- block_signal(SIGHUP, NULL); -- - if (cli_init()) - return NULL; - -@@ -913,18 +904,10 @@ uxlsnrloop (void * ap) - return NULL; - } - --int --exit_daemon (int status) -+void -+exit_daemon (void) - { -- if (status != 0) -- fprintf(stderr, "bad exit status. see daemon.log\n"); -- -- if (running_state != DAEMON_SHUTDOWN) { -- pthread_mutex_lock(&exit_mutex); -- pthread_cond_signal(&exit_cond); -- pthread_mutex_unlock(&exit_mutex); -- } -- return status; -+ sem_post(&exit_sem); - } - - const char * -@@ -1287,7 +1270,6 @@ checkerloop (void *ap) - struct path *pp; - int count = 0; - unsigned int i; -- sigset_t old; - - mlockall(MCL_CURRENT | MCL_FUTURE); - vecs = (struct vectors *)ap; -@@ -1301,7 +1283,6 @@ checkerloop (void *ap) - } - - while (1) { -- block_signal(SIGHUP, &old); - pthread_cleanup_push(cleanup_lock, &vecs->lock); - lock(vecs->lock); - pthread_testcancel(); -@@ -1325,7 +1306,6 @@ checkerloop (void *ap) - } - - lock_cleanup_pop(vecs->lock); -- pthread_sigmask(SIG_SETMASK, &old, NULL); - sleep(1); - } - return NULL; -@@ -1485,36 +1465,56 @@ signal_set(int signo, void (*func) (int) - return (osig.sa_handler); - } - -+void -+handle_signals(void) -+{ -+ if (reconfig_sig && running_state == DAEMON_RUNNING) { -+ condlog(2, "reconfigure (signal)"); -+ pthread_cleanup_push(cleanup_lock, -+ &gvecs->lock); -+ lock(gvecs->lock); -+ pthread_testcancel(); -+ reconfigure(gvecs); -+ lock_cleanup_pop(gvecs->lock); -+ } -+ if (log_reset_sig) { -+ condlog(2, "reset log (signal)"); -+ pthread_mutex_lock(&logq_lock); -+ log_reset("multipathd"); -+ pthread_mutex_unlock(&logq_lock); -+ } -+ reconfig_sig = 0; -+ log_reset_sig = 0; -+} -+ - static void - sighup (int sig) - { -- condlog(2, "reconfigure (SIGHUP)"); -- -- if (running_state != DAEMON_RUNNING) -- return; -- -- reconfigure(gvecs); -- --#ifdef _DEBUG_ -- dbg_free_final(NULL); --#endif -+ reconfig_sig = 1; - } - - static void - sigend (int sig) - { -- exit_daemon(0); -+ exit_daemon(); - } - - static void - sigusr1 (int sig) - { -- condlog(3, "SIGUSR1 received"); -+ log_reset_sig = 1; - } - - static void - signal_init(void) - { -+ sigset_t set; -+ -+ sigemptyset(&set); -+ sigaddset(&set, SIGHUP); -+ sigaddset(&set, SIGUSR1); -+ pthread_sigmask(SIG_BLOCK, &set, NULL); -+ - signal_set(SIGHUP, sighup); - signal_set(SIGUSR1, sigusr1); - signal_set(SIGINT, sigend); -@@ -1587,10 +1587,11 @@ child (void * param) - struct vectors * vecs; - struct multipath * mpp; - int i; -- sigset_t set; - int rc, pid_rc; - - mlockall(MCL_CURRENT | MCL_FUTURE); -+ sem_init(&exit_sem, 0, 0); -+ signal_init(); - - setup_thread_attr(&misc_attr, 64 * 1024, 1); - setup_thread_attr(&waiter_attr, 32 * 1024, 1); -@@ -1650,7 +1651,6 @@ child (void * param) - if (!vecs) - exit(1); - -- signal_init(); - setscheduler(); - set_oom_adj(); - -@@ -1693,25 +1693,17 @@ child (void * param) - } - pthread_attr_destroy(&misc_attr); - -- pthread_mutex_lock(&exit_mutex); - /* Startup complete, create logfile */ - pid_rc = pidfile_create(DEFAULT_PIDFILE, daemon_pid); - /* Ignore errors, we can live without */ - - running_state = DAEMON_RUNNING; -- pthread_cond_wait(&exit_cond, &exit_mutex); -- /* Need to block these to avoid deadlocking */ -- sigemptyset(&set); -- sigaddset(&set, SIGTERM); -- sigaddset(&set, SIGINT); -- pthread_sigmask(SIG_BLOCK, &set, NULL); - - /* - * exit path - */ -+ while(sem_wait(&exit_sem) != 0); /* Do nothing */ - running_state = DAEMON_SHUTDOWN; -- pthread_sigmask(SIG_UNBLOCK, &set, NULL); -- block_signal(SIGHUP, NULL); - lock(vecs->lock); - if (conf->queue_without_daemon == QUE_NO_DAEMON_OFF) - vector_foreach_slot(vecs->mpvec, mpp, i) -Index: multipath-tools-130222/multipathd/main.h -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.h -+++ multipath-tools-130222/multipathd/main.h -@@ -16,7 +16,7 @@ struct prin_resp; - - extern pid_t daemon_pid; - --int exit_daemon(int); -+void exit_daemon(void); - const char * daemon_status(void); - int reconfigure (struct vectors *); - int ev_add_path (struct path *, struct vectors *); -@@ -35,5 +35,6 @@ int mpath_pr_event_handle(struct path *p - void * mpath_pr_event_handler_fn (void * ); - int update_map_pr(struct multipath *mpp); - void * mpath_pr_event_handler_fn (void * pathp ); -+void handle_signals(void); - - #endif /* MAIN_H */ -Index: multipath-tools-130222/multipathd/uxlsnr.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/uxlsnr.c -+++ multipath-tools-130222/multipathd/uxlsnr.c -@@ -8,6 +8,7 @@ - /* - * A simple domain socket listener - */ -+#define _GNU_SOURCE - #include - #include - #include -@@ -19,20 +20,21 @@ - #include - #include - #include -- -+#include - #include -- - #include - #include - #include - #include -+#include - #include - #include - -+#include "main.h" - #include "cli.h" - #include "uxlsnr.h" - --#define SLEEP_TIME 5000 -+struct timespec sleep_time = {5, 0}; - - struct client { - int fd; -@@ -42,6 +44,8 @@ struct client { - static struct client *clients; - static unsigned num_clients; - struct pollfd *polls; -+volatile sig_atomic_t reconfig_sig = 0; -+volatile sig_atomic_t log_reset_sig = 0; - - /* - * handle a new client joining -@@ -104,6 +108,7 @@ void * uxsock_listen(int (*uxsock_trigge - int rlen; - char *inbuf; - char *reply; -+ sigset_t mask; - - ux_sock = ux_socket_listen(DEFAULT_SOCKET); - -@@ -115,7 +120,9 @@ void * uxsock_listen(int (*uxsock_trigge - pthread_cleanup_push(uxsock_cleanup, NULL); - - polls = (struct pollfd *)MALLOC(0); -- -+ pthread_sigmask(SIG_SETMASK, NULL, &mask); -+ sigdelset(&mask, SIGHUP); -+ sigdelset(&mask, SIGUSR1); - while (1) { - struct client *c; - int i, poll_count; -@@ -132,11 +139,13 @@ void * uxsock_listen(int (*uxsock_trigge - } - - /* most of our life is spent in this call */ -- poll_count = poll(polls, i, SLEEP_TIME); -+ poll_count = ppoll(polls, i, &sleep_time, &mask); - - if (poll_count == -1) { -- if (errno == EINTR) -+ if (errno == EINTR) { -+ handle_signals(); - continue; -+ } - - /* something went badly wrong! */ - condlog(0, "poll"); -Index: multipath-tools-130222/multipathd/uxlsnr.h -=================================================================== ---- multipath-tools-130222.orig/multipathd/uxlsnr.h -+++ multipath-tools-130222/multipathd/uxlsnr.h -@@ -4,5 +4,8 @@ - void * uxsock_listen(int (*uxsock_trigger) - (char *, char **, int *, void *), - void * trigger_data); -+ -+extern volatile sig_atomic_t reconfig_sig; -+extern volatile sig_atomic_t log_reset_sig; - #endif - diff --git a/0043-RH-signal-waiter.patch b/0043-RH-signal-waiter.patch deleted file mode 100644 index a1a63ea..0000000 --- a/0043-RH-signal-waiter.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- - libmultipath/waiter.c | 9 +++++++++ - multipathd/main.c | 8 ++++++++ - 2 files changed, 17 insertions(+) - -Index: multipath-tools-130222/libmultipath/waiter.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/waiter.c -+++ multipath-tools-130222/libmultipath/waiter.c -@@ -57,6 +57,7 @@ void stop_waiter_thread (struct multipat - thread = mpp->waiter; - mpp->waiter = (pthread_t)0; - pthread_cancel(thread); -+ pthread_kill(thread, SIGUSR2); - } - - /* -@@ -65,6 +66,7 @@ void stop_waiter_thread (struct multipat - */ - int waiteventloop (struct event_thread *waiter) - { -+ sigset_t set, oldset; - int event_nr; - int r; - -@@ -97,8 +99,15 @@ int waiteventloop (struct event_thread * - dm_task_no_open_count(waiter->dmt); - - /* wait */ -+ sigemptyset(&set); -+ sigaddset(&set, SIGUSR2); -+ pthread_sigmask(SIG_UNBLOCK, &set, &oldset); -+ -+ pthread_testcancel(); - r = dm_task_run(waiter->dmt); -+ pthread_testcancel(); - -+ pthread_sigmask(SIG_SETMASK, &oldset, NULL); - dm_task_destroy(waiter->dmt); - waiter->dmt = NULL; - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -1506,6 +1506,12 @@ sigusr1 (int sig) - } - - static void -+sigusr2 (int sig) -+{ -+ condlog(3, "SIGUSR2 received"); -+} -+ -+static void - signal_init(void) - { - sigset_t set; -@@ -1513,10 +1519,12 @@ signal_init(void) - sigemptyset(&set); - sigaddset(&set, SIGHUP); - sigaddset(&set, SIGUSR1); -+ sigaddset(&set, SIGUSR2); - pthread_sigmask(SIG_BLOCK, &set, NULL); - - signal_set(SIGHUP, sighup); - signal_set(SIGUSR1, sigusr1); -+ signal_set(SIGUSR2, sigusr2); - signal_set(SIGINT, sigend); - signal_set(SIGTERM, sigend); - signal(SIGPIPE, SIG_IGN); diff --git a/0044-RHBZ-976688-fix-wipe-wwids.patch b/0044-RHBZ-976688-fix-wipe-wwids.patch deleted file mode 100644 index 6f70574..0000000 --- a/0044-RHBZ-976688-fix-wipe-wwids.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- - libmultipath/wwids.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -Index: multipath-tools-130222/libmultipath/wwids.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.c -+++ multipath-tools-130222/libmultipath/wwids.c -@@ -4,6 +4,7 @@ - #include - #include - #include -+#include - - #include "checkers.h" - #include "vector.h" -@@ -100,6 +101,11 @@ replace_wwids(vector mp) - condlog(0, "cannot truncate wwids file : %s", strerror(errno)); - goto out_file; - } -+ if (lseek(fd, 0, SEEK_SET) < 0) { -+ condlog(0, "cannot seek to the start of the file : %s", -+ strerror(errno)); -+ goto out_file; -+ } - len = strlen(WWIDS_FILE_HEADER); - if (write_all(fd, WWIDS_FILE_HEADER, len) != len) { - condlog(0, "Can't write wwid file header : %s", diff --git a/0045-RHBZ-977297-man-page-fix.patch b/0045-RHBZ-977297-man-page-fix.patch deleted file mode 100644 index 3ede0ce..0000000 --- a/0045-RHBZ-977297-man-page-fix.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- - multipath/multipath.conf.5 | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -136,7 +136,7 @@ per-multipath option in the configuratio - 1 priority group per target node name. Target node names are fetched - in /sys/class/fc_transport/target*/node_name. - .TP --Default value is \fImultibus\fR. -+Default value is \fIfailover\fR. - .RE - .TP - .B uid_attribute -@@ -182,7 +182,7 @@ Generate a random priority between 1 and - Generate the path priority based on the regular expression and the - priority provided as argument. requires prio_args keyword. - .TP --Default value is \fBnone\fR. -+Default value is \fBconst\fR. - .RE - .TP - .B prio_args -@@ -270,7 +270,7 @@ The number of IO to route to a path befo - the same path group. This is only for BIO based multipath. Default is - .I 1000 - .TP --.B rr_min_io_q -+.B rr_min_io_rq - The number of IO requests to route to a path before switching to the - next in the same path group. This is only for request based multipath. - Default is diff --git a/0046-RHBZ-883981-move-udev-rules.patch b/0046-RHBZ-883981-move-udev-rules.patch deleted file mode 100644 index 4e5bc85..0000000 --- a/0046-RHBZ-883981-move-udev-rules.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- - multipath/Makefile | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/multipath/Makefile -=================================================================== ---- multipath-tools-130222.orig/multipath/Makefile -+++ multipath-tools-130222/multipath/Makefile -@@ -23,8 +23,8 @@ install: - $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/ - $(INSTALL_PROGRAM) -m 755 mpathconf $(DESTDIR)$(bindir)/ -- $(INSTALL_PROGRAM) -d $(DESTDIR)/lib/udev/rules.d -- $(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/lib/udev/rules.d/62-multipath.rules -+ $(INSTALL_PROGRAM) -d $(DESTDIR)/usr/lib/udev/rules.d -+ $(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/usr/lib/udev/rules.d/62-multipath.rules - $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir) - $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir) - $(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir) -@@ -32,7 +32,7 @@ install: - $(INSTALL_PROGRAM) -m 644 mpathconf.8.gz $(DESTDIR)$(mandir) - - uninstall: -- rm $(DESTDIR)/lib/udev/rules.d/62-multipath.rules -+ rm $(DESTDIR)/usr/lib/udev/rules.d/62-multipath.rules - rm $(DESTDIR)$(bindir)/$(EXEC) - rm $(DESTDIR)$(bindir)/mpathconf - rm $(DESTDIR)$(mandir)/$(EXEC).8.gz diff --git a/0047-RHBZ-980777-kpartx-read-only-loop-devs.patch b/0047-RHBZ-980777-kpartx-read-only-loop-devs.patch deleted file mode 100644 index ed79e22..0000000 --- a/0047-RHBZ-980777-kpartx-read-only-loop-devs.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- - kpartx/kpartx.c | 3 +-- - kpartx/lopart.c | 2 +- - 2 files changed, 2 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/kpartx/kpartx.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.c -+++ multipath-tools-130222/kpartx/kpartx.c -@@ -204,7 +204,6 @@ main(int argc, char **argv){ - char * delim = NULL; - char *uuid = NULL; - char *mapname = NULL; -- int loopro = 0; - int hotplug = 0; - int loopcreated = 0; - struct stat buf; -@@ -315,7 +314,7 @@ main(int argc, char **argv){ - if (!loopdev) { - loopdev = find_unused_loop_device(); - -- if (set_loop(loopdev, device, 0, &loopro)) { -+ if (set_loop(loopdev, device, 0, &ro)) { - fprintf(stderr, "can't set up loop\n"); - exit (1); - } -Index: multipath-tools-130222/kpartx/lopart.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/lopart.c -+++ multipath-tools-130222/kpartx/lopart.c -@@ -230,7 +230,7 @@ set_loop (const char *device, const char - - if ((ffd = open (file, mode)) < 0) { - -- if (!*loopro && errno == EROFS) -+ if (!*loopro && (errno == EROFS || errno == EACCES)) - ffd = open (file, mode = O_RDONLY); - - if (ffd < 0) { diff --git a/0048-RH-print-defaults.patch b/0048-RH-print-defaults.patch deleted file mode 100644 index be1ce57..0000000 --- a/0048-RH-print-defaults.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- - libmultipath/dict.c | 4 ---- - 1 file changed, 4 deletions(-) - -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -2468,16 +2468,12 @@ snprint_def_verbosity (char * buff, int - static int - snprint_def_max_polling_interval (char * buff, int len, void * data) - { -- if (conf->max_checkint == MAX_CHECKINT(conf->checkint)) -- return 0; - return snprintf(buff, len, "%i", conf->max_checkint); - } - - static int - snprint_reassign_maps (char * buff, int len, void * data) - { -- if (conf->reassign_maps == DEFAULT_REASSIGN_MAPS) -- return 0; - return snprintf(buff, len, "\"%s\"", - conf->reassign_maps?"yes":"no"); - } diff --git a/0049-RH-remove-ID_FS_TYPE.patch b/0049-RH-remove-ID_FS_TYPE.patch deleted file mode 100644 index 732f50f..0000000 --- a/0049-RH-remove-ID_FS_TYPE.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - multipath/multipath.rules | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/multipath/multipath.rules -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.rules -+++ multipath-tools-130222/multipath/multipath.rules -@@ -11,7 +11,7 @@ ACTION=="add", ENV{DEVTYPE}!="partition" - ENV{DM_MULTIPATH_DEVICE_PATH}!="1", \ - TEST=="/etc/multipath.conf", \ - PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -c $tempnode", \ -- ENV{DM_MULTIPATH_DEVICE_PATH}="1" -+ ENV{DM_MULTIPATH_DEVICE_PATH}="1" ENV{ID_FS_TYPE}="mpath_member" - - ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{DEVTYPE}!="partition", \ - RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}" diff --git a/0050-RH-listing-speedup.patch b/0050-RH-listing-speedup.patch deleted file mode 100644 index 4742634..0000000 --- a/0050-RH-listing-speedup.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - multipath/main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -311,7 +311,7 @@ configure (void) - /* - * get a path list - */ -- if (conf->dev) -+ if (conf->dev && !conf->list) - di_flag = DI_WWID; - - if (conf->list > 1) diff --git a/0051-UP-fix-cli-resize.patch b/0051-UP-fix-cli-resize.patch deleted file mode 100644 index f278607..0000000 --- a/0051-UP-fix-cli-resize.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c -index 7b1cb62..4b860bb 100644 ---- a/multipathd/cli_handlers.c -+++ b/multipathd/cli_handlers.c -@@ -603,7 +603,18 @@ cli_resize(void *v, char **reply, int *len, void *data) - } - - pgp = VECTOR_SLOT(mpp->pg, 0); -+ -+ if (!pgp){ -+ condlog(0, "%s: couldn't get path group. cannot resize", -+ mapname); -+ return 1; -+ } - pp = VECTOR_SLOT(pgp->paths, 0); -+ -+ if (!pp){ -+ condlog(0, "%s: couldn't get path. cannot resize", mapname); -+ return 1; -+ } - if (!pp->udev || sysfs_get_size(pp, &size)) { - condlog(0, "%s: couldn't get size for sysfs. cannot resize", - mapname); diff --git a/0052-RH-fix-bad-derefs.patch b/0052-RH-fix-bad-derefs.patch deleted file mode 100644 index db5f1db..0000000 --- a/0052-RH-fix-bad-derefs.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- - multipathd/cli_handlers.c | 3 ++- - multipathd/main.c | 12 ++++++------ - 2 files changed, 8 insertions(+), 7 deletions(-) - -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -632,7 +632,8 @@ cli_resize(void *v, char **reply, int *l - return 1; - - dm_lib_release(); -- setup_multipath(vecs, mpp); -+ if (setup_multipath(vecs, mpp) != 0) -+ return 1; - sync_map_state(mpp); - - return 0; -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -134,7 +134,6 @@ coalesce_maps(struct vectors *vecs, vect - struct multipath * ompp; - vector ompv = vecs->mpvec; - unsigned int i; -- int j; - - vector_foreach_slot (ompv, ompp, i) { - if (!find_mp_by_wwid(nmpv, ompp->wwid)) { -@@ -148,16 +147,17 @@ coalesce_maps(struct vectors *vecs, vect - /* - * may be just because the device is open - */ -+ if (setup_multipath(vecs, ompp) != 0) { -+ i--; -+ continue; -+ } - if (!vector_alloc_slot(nmpv)) - return 1; - - vector_set_slot(nmpv, ompp); -- setup_multipath(vecs, ompp); - -- if ((j = find_slot(ompv, (void *)ompp)) != -1) -- vector_del_slot(ompv, j); -- -- continue; -+ vector_del_slot(ompv, i); -+ i--; - } - else { - dm_lib_release(); diff --git a/0053-UP-fix-failback.patch b/0053-UP-fix-failback.patch deleted file mode 100644 index 936655d..0000000 --- a/0053-UP-fix-failback.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- - libmultipath/dict.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -1126,11 +1126,11 @@ hw_failback_handler(vector strvec) - - buff = set_value(strvec); - -- if (strlen(buff) == 6 && !strcmp(buff, "\"manual\"")) -+ if (strlen(buff) == 6 && !strcmp(buff, "manual")) - hwe->pgfailback = -FAILBACK_MANUAL; -- else if (strlen(buff) == 9 && !strcmp(buff, "\"immediate\"")) -+ else if (strlen(buff) == 9 && !strcmp(buff, "immediate")) - hwe->pgfailback = -FAILBACK_IMMEDIATE; -- else if (strlen(buff) == 10 && !strcmp(buff, "\"followover\"")) -+ else if (strlen(buff) == 10 && !strcmp(buff, "followover")) - hwe->pgfailback = -FAILBACK_FOLLOWOVER; - else - hwe->pgfailback = atoi(buff); diff --git a/0054-UP-keep-udev-ref.patch b/0054-UP-keep-udev-ref.patch deleted file mode 100644 index e42d716..0000000 --- a/0054-UP-keep-udev-ref.patch +++ /dev/null @@ -1,308 +0,0 @@ ---- - libmpathpersist/mpath_persist.c | 7 ++++--- - libmpathpersist/mpath_persist.h | 2 +- - libmpathpersist/mpath_pr_ioctl.c | 5 +++-- - libmultipath/config.c | 9 +++------ - libmultipath/config.h | 2 +- - mpathpersist/Makefile | 2 +- - mpathpersist/main.c | 11 +++++++---- - multipath/Makefile | 2 +- - multipath/main.c | 12 ++++++++---- - multipathd/main.c | 11 ++++++++--- - 10 files changed, 37 insertions(+), 26 deletions(-) - -Index: multipath-tools-130222/libmpathpersist/mpath_persist.c -=================================================================== ---- multipath-tools-130222.orig/libmpathpersist/mpath_persist.c -+++ multipath-tools-130222/libmpathpersist/mpath_persist.c -@@ -1,4 +1,3 @@ --#include "mpath_persist.h" - #include - #include - #include -@@ -8,6 +7,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -20,6 +20,7 @@ - #include - #include - -+#include "mpath_persist.h" - #include "mpathpr.h" - #include "mpath_pr_ioctl.h" - -@@ -32,9 +33,9 @@ - - - int --mpath_lib_init (void) -+mpath_lib_init (struct udev *udev) - { -- if (load_config(DEFAULT_CONFIGFILE)){ -+ if (load_config(DEFAULT_CONFIGFILE, udev)){ - condlog(0, "Failed to initialize multipath config."); - return 1; - } -Index: multipath-tools-130222/libmpathpersist/mpath_persist.h -=================================================================== ---- multipath-tools-130222.orig/libmpathpersist/mpath_persist.h -+++ multipath-tools-130222/libmpathpersist/mpath_persist.h -@@ -174,7 +174,7 @@ struct prout_param_descriptor { /* PROU - * - * RETURNS: 0->Success, 1->Failed. - */ --extern int mpath_lib_init (void ); -+extern int mpath_lib_init (struct udev *udev); - - - /* -Index: multipath-tools-130222/libmpathpersist/mpath_pr_ioctl.c -=================================================================== ---- multipath-tools-130222.orig/libmpathpersist/mpath_pr_ioctl.c -+++ multipath-tools-130222/libmpathpersist/mpath_pr_ioctl.c -@@ -10,8 +10,9 @@ - #include - #include - #include --#include "mpath_pr_ioctl.h" --#include -+#include -+#include "mpath_pr_ioctl.h" -+#include - - #include - -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -467,9 +467,6 @@ free_config (struct config * conf) - if (conf->dev) - FREE(conf->dev); - -- if (conf->udev) -- udev_unref(conf->udev); -- - if (conf->multipath_dir) - FREE(conf->multipath_dir); - -@@ -519,12 +516,12 @@ free_config (struct config * conf) - } - - int --load_config (char * file) -+load_config (char * file, struct udev *udev) - { - if (!conf) - conf = alloc_config(); - -- if (!conf) -+ if (!conf || !udev) - return 1; - - /* -@@ -533,7 +530,7 @@ load_config (char * file) - if (!conf->verbosity) - conf->verbosity = DEFAULT_VERBOSITY; - -- conf->udev = udev_new(); -+ conf->udev = udev; - dm_drv_version(conf->version, TGT_MPATH); - conf->dev_type = DEV_NONE; - conf->minio = DEFAULT_MINIO; -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -159,7 +159,7 @@ void free_mptable (vector mptable); - - int store_hwe (vector hwtable, struct hwentry *); - --int load_config (char * file); -+int load_config (char * file, struct udev * udev); - struct config * alloc_config (void); - void free_config (struct config * conf); - -Index: multipath-tools-130222/mpathpersist/main.c -=================================================================== ---- multipath-tools-130222.orig/mpathpersist/main.c -+++ multipath-tools-130222/mpathpersist/main.c -@@ -7,6 +7,7 @@ - #include - #include - #include -+#include - #include - #include "main.h" - #include -@@ -68,7 +69,8 @@ int main (int argc, char * argv[]) - int noisy = 0; - int num_transport =0; - void *resp = NULL; -- struct transportid * tmp; -+ struct transportid * tmp; -+ struct udev *udev = NULL; - - if (optind == argc) - { -@@ -84,8 +86,8 @@ int main (int argc, char * argv[]) - exit (1); - } - -- -- mpath_lib_init(); -+ udev = udev_new(); -+ mpath_lib_init(udev); - memset(transportids,0,MPATH_MX_TIDS); - - while (1) -@@ -461,12 +463,13 @@ int main (int argc, char * argv[]) - if (res < 0) - { - mpath_lib_exit(); -+ udev_unref(udev); - return MPATH_PR_FILE_ERROR; - } - - out : - mpath_lib_exit(); -- -+ udev_unref(udev); - return (ret >= 0) ? ret : MPATH_PR_OTHER; - } - -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -435,6 +436,7 @@ convert_dev(char *dev) - int - main (int argc, char *argv[]) - { -+ struct udev *udev; - int arg; - extern char *optarg; - extern int optind; -@@ -445,7 +447,9 @@ main (int argc, char *argv[]) - exit(1); - } - -- if (load_config(DEFAULT_CONFIGFILE)) -+ udev = udev_new(); -+ -+ if (load_config(DEFAULT_CONFIGFILE, udev)) - exit(1); - - if (dm_prereq()) -@@ -560,11 +564,11 @@ main (int argc, char *argv[]) - - if (init_checkers()) { - condlog(0, "failed to initialize checkers"); -- exit(1); -+ goto out; - } - if (init_prio()) { - condlog(0, "failed to initialize prioritizers"); -- exit(1); -+ goto out; - } - dm_init(); - -@@ -628,7 +632,7 @@ out: - */ - free_config(conf); - conf = NULL; -- -+ udev_unref(udev); - #ifdef _DEBUG_ - dbg_free_final(NULL); - #endif -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -93,6 +93,8 @@ static sem_t exit_sem; - */ - struct vectors * gvecs; - -+struct udev * udev; -+ - static int - need_switch_pathgroup (struct multipath * mpp, int refresh) - { -@@ -1408,7 +1410,7 @@ reconfigure (struct vectors * vecs) - vecs->pathvec = NULL; - conf = NULL; - -- if (!load_config(DEFAULT_CONFIGFILE)) { -+ if (!load_config(DEFAULT_CONFIGFILE, udev)) { - conf->verbosity = old->verbosity; - conf->daemon = 1; - configure(vecs, 1); -@@ -1601,6 +1603,8 @@ child (void * param) - sem_init(&exit_sem, 0, 0); - signal_init(); - -+ udev = udev_new(); -+ - setup_thread_attr(&misc_attr, 64 * 1024, 1); - setup_thread_attr(&waiter_attr, 32 * 1024, 1); - -@@ -1615,7 +1619,7 @@ child (void * param) - condlog(2, "--------start up--------"); - condlog(2, "read " DEFAULT_CONFIGFILE); - -- if (load_config(DEFAULT_CONFIGFILE)) -+ if (load_config(DEFAULT_CONFIGFILE, udev)) - exit(1); - - if (init_checkers()) { -@@ -1765,7 +1769,8 @@ child (void * param) - */ - free_config(conf); - conf = NULL; -- -+ udev_unref(udev); -+ udev = NULL; - #ifdef _DEBUG_ - dbg_free_final(NULL); - #endif -Index: multipath-tools-130222/mpathpersist/Makefile -=================================================================== ---- multipath-tools-130222.orig/mpathpersist/Makefile -+++ multipath-tools-130222/mpathpersist/Makefile -@@ -5,7 +5,7 @@ include ../Makefile.inc - OBJS = main.o - - CFLAGS += -I$(multipathdir) -I$(mpathpersistdir) --LDFLAGS += -lpthread -ldevmapper -L$(mpathpersistdir) -lmpathpersist -L$(multipathdir) -lmultipath -+LDFLAGS += -lpthread -ldevmapper -L$(mpathpersistdir) -lmpathpersist -L$(multipathdir) -lmultipath -ludev - - EXEC = mpathpersist - -Index: multipath-tools-130222/multipath/Makefile -=================================================================== ---- multipath-tools-130222.orig/multipath/Makefile -+++ multipath-tools-130222/multipath/Makefile -@@ -7,7 +7,7 @@ include ../Makefile.inc - OBJS = main.o - - CFLAGS += -fPIC -I$(multipathdir) --LDFLAGS += -lpthread -ldevmapper -ldl -L$(multipathdir) -lmultipath -+LDFLAGS += -lpthread -ldevmapper -ldl -L$(multipathdir) -lmultipath -ludev - - EXEC = multipath - diff --git a/0055-UP-handle-quiesced-paths.patch b/0055-UP-handle-quiesced-paths.patch deleted file mode 100644 index 0556a61..0000000 --- a/0055-UP-handle-quiesced-paths.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- - libmultipath/discovery.c | 1 + - 1 file changed, 1 insertion(+) - -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -799,6 +799,7 @@ path_offline (struct path * pp) - condlog(3, "%s: path state = %s", pp->dev, buff); - - if (!strncmp(buff, "offline", 7) || -+ !strncmp(buff, "quiesce", 7) || - !strncmp(buff, "transport-offline", 17)) { - pp->offline = 1; - return PATH_DOWN; diff --git a/0056-UP-alua-prio-fix.patch b/0056-UP-alua-prio-fix.patch deleted file mode 100644 index 0ac41ab..0000000 --- a/0056-UP-alua-prio-fix.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmultipath/prioritizers/alua.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/prioritizers/alua.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/alua.c -+++ multipath-tools-130222/libmultipath/prioritizers/alua.c -@@ -108,7 +108,7 @@ int getprio (struct path * pp, char * ar - default: - rc = 0; - } -- if (priopath) -+ if (priopath && aas != AAS_OPTIMIZED) - rc += 80; - } else { - switch(-rc) { diff --git a/0057-UP-fix-tmo.patch b/0057-UP-fix-tmo.patch deleted file mode 100644 index 0bfc46b..0000000 --- a/0057-UP-fix-tmo.patch +++ /dev/null @@ -1,329 +0,0 @@ ---- - libmultipath/discovery.c | 109 +++++++++++++++++++++++++++++++++++++---------- - libmultipath/sysfs.c | 86 +++++++++++++++++++++++++++++++------ - libmultipath/sysfs.h | 2 - 3 files changed, 161 insertions(+), 36 deletions(-) - -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -162,7 +162,6 @@ declare_sysfs_get_str(cutype); - declare_sysfs_get_str(vendor); - declare_sysfs_get_str(model); - declare_sysfs_get_str(rev); --declare_sysfs_get_str(state); - declare_sysfs_get_str(dev); - - int -@@ -315,9 +314,14 @@ static void - sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp) - { - struct udev_device *rport_dev = NULL; -- char value[11]; -+ char value[16]; - char rport_id[32]; -+ int delay_fast_io_fail = 0; -+ int current_dev_loss = 0; -+ int ret; - -+ if (!mpp->dev_loss && mpp->fast_io_fail == MP_FAST_IO_FAIL_UNSET) -+ return; - sprintf(rport_id, "rport-%d:%d-%d", - pp->sg_id.host_no, pp->sg_id.channel, pp->sg_id.transport_id); - rport_dev = udev_device_new_from_subsystem_sysname(conf->udev, -@@ -330,33 +334,85 @@ sysfs_set_rport_tmo(struct multipath *mp - condlog(4, "target%d:%d:%d -> %s", pp->sg_id.host_no, - pp->sg_id.channel, pp->sg_id.scsi_id, rport_id); - -- snprintf(value, 11, "%u", mpp->dev_loss); -- if (mpp->dev_loss && -- sysfs_attr_set_value(rport_dev, "dev_loss_tmo", value, 11) <= 0) { -- if ((mpp->fast_io_fail == MP_FAST_IO_FAIL_UNSET || -- mpp->fast_io_fail == MP_FAST_IO_FAIL_OFF) -- && mpp->dev_loss > 600) { -- condlog(3, "%s: limiting dev_loss_tmo to 600, since " -- "fast_io_fail is not set", mpp->alias); -- snprintf(value, 11, "%u", 600); -- if (sysfs_attr_set_value(rport_dev, "dev_loss_tmo", -- value, 11) <= 0) -- condlog(0, "%s failed to set dev_loss_tmo", -- mpp->alias); -+ memset(value, 0, 16); -+ if (mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) { -+ ret = sysfs_attr_get_value(rport_dev, "dev_loss_tmo", -+ value, 16); -+ if (ret <= 0) { -+ condlog(0, "%s: failed to read dev_loss_tmo value, " -+ "error %d", rport_id, -ret); - goto out; - } -+ if (sscanf(value, "%u\n", ¤t_dev_loss) != 1) { -+ condlog(0, "%s: Cannot parse dev_loss_tmo " -+ "attribute '%s'", rport_id, value); -+ goto out; -+ } -+ if ((mpp->dev_loss && -+ mpp->fast_io_fail >= (int)mpp->dev_loss) || -+ (!mpp->dev_loss && -+ mpp->fast_io_fail >= (int)current_dev_loss)) { -+ condlog(3, "%s: limiting fast_io_fail_tmo to %d, since " -+ "it must be less than dev_loss_tmo", -+ rport_id, mpp->dev_loss - 1); -+ if (mpp->dev_loss) -+ mpp->fast_io_fail = mpp->dev_loss - 1; -+ else -+ mpp->fast_io_fail = current_dev_loss - 1; -+ } -+ if (mpp->fast_io_fail >= (int)current_dev_loss) -+ delay_fast_io_fail = 1; -+ } -+ if (mpp->dev_loss > 600 && -+ (mpp->fast_io_fail == MP_FAST_IO_FAIL_OFF || -+ mpp->fast_io_fail == MP_FAST_IO_FAIL_UNSET)) { -+ condlog(3, "%s: limiting dev_loss_tmo to 600, since " -+ "fast_io_fail is unset or off", rport_id); -+ mpp->dev_loss = 600; - } -- if (mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET){ -+ if (mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) { - if (mpp->fast_io_fail == MP_FAST_IO_FAIL_OFF) - sprintf(value, "off"); - else if (mpp->fast_io_fail == MP_FAST_IO_FAIL_ZERO) - sprintf(value, "0"); -+ else if (delay_fast_io_fail) -+ snprintf(value, 16, "%u", current_dev_loss - 1); - else -- snprintf(value, 11, "%u", mpp->fast_io_fail); -- if (sysfs_attr_set_value(rport_dev, "fast_io_fail_tmo", -- value, 11) <= 0) { -- condlog(0, "%s failed to set fast_io_fail_tmo", -- mpp->alias); -+ snprintf(value, 16, "%u", mpp->fast_io_fail); -+ ret = sysfs_attr_set_value(rport_dev, "fast_io_fail_tmo", -+ value, strlen(value)); -+ if (ret <= 0) { -+ if (ret == -EBUSY) -+ condlog(3, "%s: rport blocked", rport_id); -+ else -+ condlog(0, "%s: failed to set fast_io_fail_tmo to %s, error %d", -+ rport_id, value, -ret); -+ goto out; -+ } -+ } -+ if (mpp->dev_loss) { -+ snprintf(value, 16, "%u", mpp->dev_loss); -+ ret = sysfs_attr_set_value(rport_dev, "dev_loss_tmo", -+ value, strlen(value)); -+ if (ret <= 0) { -+ if (ret == -EBUSY) -+ condlog(3, "%s: rport blocked", rport_id); -+ else -+ condlog(0, "%s: failed to set dev_loss_tmo to %s, error %d", -+ rport_id, value, -ret); -+ goto out; -+ } -+ } -+ if (delay_fast_io_fail) { -+ snprintf(value, 16, "%u", mpp->fast_io_fail); -+ ret = sysfs_attr_set_value(rport_dev, "fast_io_fail_tmo", -+ value, strlen(value)); -+ if (ret <= 0) { -+ if (ret == -EBUSY) -+ condlog(3, "%s: rport blocked", rport_id); -+ else -+ condlog(0, "%s: failed to set fast_io_fail_tmo to %s, error %d", -+ rport_id, value, -ret); - } - } - out: -@@ -394,7 +450,7 @@ sysfs_set_session_tmo(struct multipath * - } else { - snprintf(value, 11, "%u", mpp->fast_io_fail); - if (sysfs_attr_set_value(session_dev, "recovery_tmo", -- value, 11)) { -+ value, 11) <= 0) { - condlog(3, "%s: Failed to set recovery_tmo, " - " error %d", pp->dev, errno); - } -@@ -752,6 +808,9 @@ cciss_sysfs_pathinfo (struct path * pp) - static int - common_sysfs_pathinfo (struct path * pp) - { -+ if (!pp) -+ return 1; -+ - if (!pp->udev) { - condlog(4, "%s: udev not initialised", pp->dev); - return 1; -@@ -793,7 +852,8 @@ path_offline (struct path * pp) - return PATH_DOWN; - } - -- if (sysfs_get_state(parent, buff, SCSI_STATE_SIZE)) -+ memset(buff, 0x0, SCSI_STATE_SIZE); -+ if (sysfs_attr_get_value(parent, "state", buff, SCSI_STATE_SIZE) <= 0) - return PATH_DOWN; - - condlog(3, "%s: path state = %s", pp->dev, buff); -@@ -983,6 +1043,9 @@ pathinfo (struct path *pp, vector hwtabl - { - int path_state; - -+ if (!pp) -+ return 1; -+ - condlog(3, "%s: mask = 0x%x", pp->dev, mask); - - /* -Index: multipath-tools-130222/libmultipath/sysfs.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/sysfs.c -+++ multipath-tools-130222/libmultipath/sysfs.c -@@ -38,7 +38,12 @@ - #include "debug.h" - #include "devmapper.h" - --ssize_t sysfs_attr_set_value(struct udev_device *dev, const char *attr_name, -+/* -+ * When we modify an attribute value we cannot rely on libudev for now, -+ * as libudev lacks the capability to update an attribute value. -+ * So for modified attributes we need to implement our own function. -+ */ -+ssize_t sysfs_attr_get_value(struct udev_device *dev, const char *attr_name, - char * value, size_t value_len) - { - char devpath[PATH_SIZE]; -@@ -54,28 +59,83 @@ ssize_t sysfs_attr_set_value(struct udev - condlog(4, "open '%s'", devpath); - if (stat(devpath, &statbuf) != 0) { - condlog(4, "stat '%s' failed: %s", devpath, strerror(errno)); -- return 0; -+ return -errno; - } - - /* skip directories */ -- if (S_ISDIR(statbuf.st_mode)) -- return 0; -+ if (S_ISDIR(statbuf.st_mode)) { -+ condlog(4, "%s is a directory", devpath); -+ return -EISDIR; -+ } - - /* skip non-writeable files */ -- if ((statbuf.st_mode & S_IWUSR) == 0) -+ if ((statbuf.st_mode & S_IRUSR) == 0) { -+ condlog(4, "%s is not readable", devpath); -+ return -EPERM; -+ } -+ -+ /* read attribute value */ -+ fd = open(devpath, O_RDONLY); -+ if (fd < 0) { -+ condlog(4, "attribute '%s' can not be opened: %s", -+ devpath, strerror(errno)); -+ return -errno; -+ } -+ size = read(fd, value, value_len); -+ if (size < 0) { -+ condlog(4, "read from %s failed: %s", devpath, strerror(errno)); -+ size = -errno; -+ } else if (size == value_len) { -+ condlog(4, "overflow while reading from %s", devpath); -+ size = 0; -+ } -+ -+ close(fd); -+ return size; -+} -+ -+ssize_t sysfs_attr_set_value(struct udev_device *dev, const char *attr_name, -+ char * value, size_t value_len) -+{ -+ char devpath[PATH_SIZE]; -+ struct stat statbuf; -+ int fd; -+ ssize_t size = -1; -+ -+ if (!dev || !attr_name || !value || !value_len) - return 0; - -+ snprintf(devpath, PATH_SIZE, "%s/%s", udev_device_get_syspath(dev), -+ attr_name); -+ condlog(4, "open '%s'", devpath); -+ if (stat(devpath, &statbuf) != 0) { -+ condlog(4, "stat '%s' failed: %s", devpath, strerror(errno)); -+ return -errno; -+ } -+ -+ /* skip directories */ -+ if (S_ISDIR(statbuf.st_mode)) { -+ condlog(4, "%s is a directory", devpath); -+ return -EISDIR; -+ } -+ -+ /* skip non-writeable files */ -+ if ((statbuf.st_mode & S_IWUSR) == 0) { -+ condlog(4, "%s is not writeable", devpath); -+ return -EPERM; -+ } -+ - /* write attribute value */ - fd = open(devpath, O_WRONLY); - if (fd < 0) { - condlog(4, "attribute '%s' can not be opened: %s", - devpath, strerror(errno)); -- return 0; -+ return -errno; - } - size = write(fd, value, value_len); - if (size < 0) { - condlog(4, "write to %s failed: %s", devpath, strerror(errno)); -- size = 0; -+ size = -errno; - } else if (size < value_len) { - condlog(4, "tried to write %ld to %s. Wrote %ld", - (long)value_len, devpath, (long)size); -@@ -89,14 +149,14 @@ ssize_t sysfs_attr_set_value(struct udev - int - sysfs_get_size (struct path *pp, unsigned long long * size) - { -- const char * attr; -+ char attr[255]; - int r; - -- if (!pp->udev) -+ if (!pp->udev || !size) - return 1; - -- attr = udev_device_get_sysattr_value(pp->udev, "size"); -- if (!attr) { -+ attr[0] = '\0'; -+ if (sysfs_attr_get_value(pp->udev, "size", attr, 255) == 0) { - condlog(3, "%s: No size attribute in sysfs", pp->dev); - return 1; - } -@@ -104,8 +164,8 @@ sysfs_get_size (struct path *pp, unsigne - r = sscanf(attr, "%llu\n", size); - - if (r != 1) { -- condlog(3, "%s: Cannot parse size attribute '%s'", -- pp->dev, attr); -+ condlog(3, "%s: Cannot parse size attribute", pp->dev); -+ *size = 0; - return 1; - } - -Index: multipath-tools-130222/libmultipath/sysfs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/sysfs.h -+++ multipath-tools-130222/libmultipath/sysfs.h -@@ -7,6 +7,8 @@ - - ssize_t sysfs_attr_set_value(struct udev_device *dev, const char *attr_name, - char * value, size_t value_len); -+ssize_t sysfs_attr_get_value(struct udev_device *dev, const char *attr_name, -+ char * value, size_t value_len); - int sysfs_get_size (struct path *pp, unsigned long long * size); - int sysfs_check_holders(char * check_devt, char * new_devt); - #endif diff --git a/0058-UP-fix-failback.patch b/0058-UP-fix-failback.patch deleted file mode 100644 index d1fbaeb..0000000 --- a/0058-UP-fix-failback.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmultipath/dict.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -2562,7 +2562,7 @@ snprint_def_failback (char * buff, int l - if (!pgfailback) - pgfailback = DEFAULT_FAILBACK; - -- switch(conf->pgfailback) { -+ switch(pgfailback) { - case FAILBACK_UNDEF: - break; - case -FAILBACK_MANUAL: diff --git a/0059-UP-flush-failure-queueing.patch b/0059-UP-flush-failure-queueing.patch deleted file mode 100644 index f72f314..0000000 --- a/0059-UP-flush-failure-queueing.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- - libmultipath/devmapper.c | 21 +++++++++++++++++---- - libmultipath/devmapper.h | 2 +- - 2 files changed, 18 insertions(+), 5 deletions(-) - -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -363,7 +363,7 @@ out: - } - - extern int --dm_get_map(char * name, unsigned long long * size, char * outparams) -+dm_get_map(const char * name, unsigned long long * size, char * outparams) - { - int r = 1; - struct dm_task *dmt; -@@ -682,7 +682,9 @@ _dm_flush_map (const char * mapname, int - extern int - dm_suspend_and_flush_map (const char * mapname) - { -- int s; -+ int s = 0, queue_if_no_path = 0; -+ unsigned long long mapsize; -+ char params[PARAMS_SIZE] = {0}; - - if (!dm_map_present(mapname)) - return 0; -@@ -690,8 +692,17 @@ dm_suspend_and_flush_map (const char * m - if (dm_type(mapname, TGT_MPATH) <= 0) - return 0; /* nothing to do */ - -- s = dm_queue_if_no_path((char *)mapname, 0); -- if (!s) -+ if (!dm_get_map(mapname, &mapsize, params)) { -+ if (strstr(params, "queue_if_no_path")) -+ queue_if_no_path = 1; -+ } -+ -+ if (queue_if_no_path) -+ s = dm_queue_if_no_path((char *)mapname, 0); -+ /* Leave queue_if_no_path alone if unset failed */ -+ if (s) -+ queue_if_no_path = 0; -+ else - s = dm_simplecmd_flush(DM_DEVICE_SUSPEND, mapname, 0); - - if (!dm_flush_map(mapname)) { -@@ -700,6 +711,8 @@ dm_suspend_and_flush_map (const char * m - } - condlog(2, "failed to remove multipath map %s", mapname); - dm_simplecmd_noflush(DM_DEVICE_RESUME, mapname); -+ if (queue_if_no_path) -+ s = dm_queue_if_no_path((char *)mapname, 1); - return 1; - } - -Index: multipath-tools-130222/libmultipath/devmapper.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.h -+++ multipath-tools-130222/libmultipath/devmapper.h -@@ -14,7 +14,7 @@ int dm_simplecmd_noflush (int, const cha - int dm_addmap_create (struct multipath *mpp, char *params); - int dm_addmap_reload (struct multipath *mpp, char *params); - int dm_map_present (const char *); --int dm_get_map(char *, unsigned long long *, char *); -+int dm_get_map(const char *, unsigned long long *, char *); - int dm_get_status(char *, char *); - int dm_type(const char *, char *); - int _dm_flush_map (const char *, int); diff --git a/0060-UP-uevent-loop-udev.patch b/0060-UP-uevent-loop-udev.patch deleted file mode 100644 index 88fc005..0000000 --- a/0060-UP-uevent-loop-udev.patch +++ /dev/null @@ -1,127 +0,0 @@ ---- - libmultipath/uevent.c | 17 ++++++++++++----- - libmultipath/uevent.h | 4 +++- - multipathd/main.c | 8 +++++--- - 3 files changed, 20 insertions(+), 9 deletions(-) - -Index: multipath-tools-130222/libmultipath/uevent.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/uevent.c -+++ multipath-tools-130222/libmultipath/uevent.c -@@ -47,7 +47,6 @@ - #include "list.h" - #include "uevent.h" - #include "vector.h" --#include "config.h" - - typedef int (uev_trigger)(struct uevent *, void * trigger_data); - -@@ -127,11 +126,14 @@ service_uevq(struct list_head *tmpq) - - static void uevq_stop(void *arg) - { -+ struct udev *udev = arg; -+ - condlog(3, "Stopping uev queue"); - pthread_mutex_lock(uevq_lockp); - my_uev_trigger = NULL; - pthread_cond_signal(uev_condp); - pthread_mutex_unlock(uevq_lockp); -+ udev_unref(udev); - } - - void -@@ -399,9 +401,9 @@ exit: - return 1; - } - --int uevent_listen(void) -+int uevent_listen(struct udev *udev) - { -- int err; -+ int err = 2; - struct udev_monitor *monitor = NULL; - int fd, socket_flags; - int need_failback = 1; -@@ -411,9 +413,14 @@ int uevent_listen(void) - * thereby not getting to empty the socket's receive buffer queue - * often enough. - */ -- pthread_cleanup_push(uevq_stop, NULL); -+ if (!udev) { -+ condlog(1, "no udev context"); -+ return 1; -+ } -+ udev_ref(udev); -+ pthread_cleanup_push(uevq_stop, udev); - -- monitor = udev_monitor_new_from_netlink(conf->udev, "udev"); -+ monitor = udev_monitor_new_from_netlink(udev, "udev"); - if (!monitor) { - condlog(2, "failed to create udev monitor"); - goto out; -Index: multipath-tools-130222/libmultipath/uevent.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/uevent.h -+++ multipath-tools-130222/libmultipath/uevent.h -@@ -13,6 +13,8 @@ - #define NETLINK_KOBJECT_UEVENT 15 - #endif - -+struct udev; -+ - struct uevent { - struct list_head node; - struct udev_device *udev; -@@ -27,7 +29,7 @@ struct uevent { - int is_uevent_busy(void); - void setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached); - --int uevent_listen(void); -+int uevent_listen(struct udev *udev); - int uevent_dispatch(int (*store_uev)(struct uevent *, void * trigger_data), - void * trigger_data); - int uevent_get_major(struct uevent *uev); -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -840,7 +840,7 @@ out: - static void * - ueventloop (void * ap) - { -- if (uevent_listen()) -+ if (uevent_listen(udev)) - condlog(0, "error starting uevent listener"); - - return NULL; -@@ -1593,7 +1593,7 @@ static int - child (void * param) - { - pthread_t check_thr, uevent_thr, uxlsnr_thr, uevq_thr; -- pthread_attr_t log_attr, misc_attr; -+ pthread_attr_t log_attr, misc_attr, uevent_attr; - struct vectors * vecs; - struct multipath * mpp; - int i; -@@ -1606,6 +1606,7 @@ child (void * param) - udev = udev_new(); - - setup_thread_attr(&misc_attr, 64 * 1024, 1); -+ setup_thread_attr(&uevent_attr, 128 * 1024, 1); - setup_thread_attr(&waiter_attr, 32 * 1024, 1); - - if (logsink) { -@@ -1671,10 +1672,11 @@ child (void * param) - /* - * Start uevent listener early to catch events - */ -- if ((rc = pthread_create(&uevent_thr, &misc_attr, ueventloop, vecs))) { -+ if ((rc = pthread_create(&uevent_thr, &uevent_attr, ueventloop, udev))) { - condlog(0, "failed to create uevent thread: %d", rc); - exit(1); - } -+ pthread_attr_destroy(&uevent_attr); - if ((rc = pthread_create(&uxlsnr_thr, &misc_attr, uxlsnrloop, vecs))) { - condlog(0, "failed to create cli listener: %d", rc); - exit(1); diff --git a/0061-RH-display-find-mpaths.patch b/0061-RH-display-find-mpaths.patch deleted file mode 100644 index 05c63f0..0000000 --- a/0061-RH-display-find-mpaths.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmultipath/dict.c | 2 -- - 1 file changed, 2 deletions(-) - -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -2717,8 +2717,6 @@ snprint_def_log_checker_err (char * buff - static int - snprint_def_find_multipaths (char * buff, int len, void * data) - { -- if (conf->find_multipaths == DEFAULT_FIND_MULTIPATHS) -- return 0; - if (!conf->find_multipaths) - return snprintf(buff, len, "no"); - diff --git a/0062-RH-dont-free-vecs.patch b/0062-RH-dont-free-vecs.patch deleted file mode 100644 index f1c3217..0000000 --- a/0062-RH-dont-free-vecs.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- - multipathd/main.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -1735,8 +1735,9 @@ child (void * param) - vecs->pathvec = NULL; - unlock(vecs->lock); - /* Now all the waitevent threads will start rushing in. */ -+ /* freeing vecs isn't worth the races - while (vecs->lock.depth > 0) { -- sleep (1); /* This is weak. */ -+ sleep (1); - condlog(3, "Have %d wait event checkers threads to de-alloc," - " waiting...", vecs->lock.depth); - } -@@ -1746,7 +1747,7 @@ child (void * param) - vecs->lock.mutex = NULL; - FREE(vecs); - vecs = NULL; -- -+ */ - cleanup_checkers(); - cleanup_prio(); - diff --git a/0063-RH-fix-warning.patch b/0063-RH-fix-warning.patch deleted file mode 100644 index 7db8056..0000000 --- a/0063-RH-fix-warning.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- - kpartx/dasd.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/kpartx/dasd.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/dasd.c -+++ multipath-tools-130222/kpartx/dasd.c -@@ -46,6 +46,8 @@ unsigned long long sectors512(unsigned l - return sectors * (blocksize >> 9); - } - -+typedef unsigned int __attribute__((__may_alias__)) label_ints_t; -+ - /* - */ - int -@@ -169,7 +171,7 @@ read_dasd_pt(int fd, struct slice all, s - /* - * VM style CMS1 labeled disk - */ -- unsigned int *label = (unsigned int *) &vlabel; -+ label_ints_t *label = (label_ints_t *) &vlabel; - - blocksize = label[4]; - if (label[14] != 0) { diff --git a/0064-fix-ID_FS-attrs.patch b/0064-fix-ID_FS-attrs.patch deleted file mode 100644 index cb59a85..0000000 --- a/0064-fix-ID_FS-attrs.patch +++ /dev/null @@ -1,383 +0,0 @@ ---- - libmultipath/defaults.h | 3 - - libmultipath/file.c | 89 +++++++++++++++++++++++++++++++++++++++++- - libmultipath/file.h | 3 + - libmultipath/wwids.c | 7 ++- - multipath/main.c | 36 +++++++++++++++- - multipath/multipath.rules | 26 +++++++++--- - multipathd/main.c | 4 + - multipathd/multipathd.service | 2 - multipathd/pidfile.c | 3 + - 9 files changed, 160 insertions(+), 13 deletions(-) - -Index: multipath-tools-130222/libmultipath/defaults.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/defaults.h -+++ multipath-tools-130222/libmultipath/defaults.h -@@ -24,7 +24,8 @@ - #define MAX_CHECKINT(a) (a << 2) - - #define MAX_DEV_LOSS_TMO 0x7FFFFFFF --#define DEFAULT_PIDFILE "/var/run/multipathd.pid" -+#define DEFAULT_PIDFILE "/var/run/multipathd/multipathd.pid" -+#define DEFAULT_TIMESTAMP_FILE "/var/run/multipathd/timestamp" - #define DEFAULT_SOCKET "/org/kernel/linux/storage/multipathd" - #define DEFAULT_CONFIGFILE "/etc/multipath.conf" - #define DEFAULT_BINDINGS_FILE "/etc/multipath/bindings" -Index: multipath-tools-130222/libmultipath/file.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/file.c -+++ multipath-tools-130222/libmultipath/file.c -@@ -12,10 +12,12 @@ - #include - #include - #include -+#include - - #include "file.h" - #include "debug.h" - #include "uxsock.h" -+#include "defaults.h" - - - /* -@@ -36,8 +38,8 @@ - * See the file COPYING included with this distribution for more details. - */ - --static int --ensure_directories_exist(char *str, mode_t dir_mode) -+int -+ensure_directories_exist(const char *str, mode_t dir_mode) - { - char *pathname; - char *end; -@@ -178,3 +180,86 @@ fail: - close(fd); - return -1; - } -+ -+/* If you can't get the timestamp, return equal to just keep using the -+ * existing value. -+ */ -+int timestamp_equal(long int chk_timestamp) -+{ -+ char buf[4096]; -+ FILE *file; -+ long int file_timestamp; -+ int ret = 1; -+ -+ if ((file = fopen(DEFAULT_TIMESTAMP_FILE, "r")) == NULL) { -+ if (errno != ENOENT) -+ condlog(2, "Cannot open timestamp file [%s]: %s", -+ DEFAULT_TIMESTAMP_FILE, strerror(errno)); -+ goto out; -+ } -+ errno = 0; -+ if (fgets(buf, sizeof(buf), file) == NULL) { -+ if (errno) -+ condlog(2, "Cannot read from timestamp file: %s", -+ strerror(errno)); -+ goto out; -+ } -+ if (sscanf(buf, "DM_MULTIPATH_TIMESTAMP=%ld", &file_timestamp) != 1) { -+ if (errno) -+ condlog(0, "Cannot get timestamp: %s", strerror(errno)); -+ else -+ condlog(0, "invalid timestamp file [%s]: %s", -+ DEFAULT_TIMESTAMP_FILE, strerror(errno)); -+ goto out; -+ } -+ if (file_timestamp != chk_timestamp) { -+ condlog(3, "timestamp has changed"); -+ ret = 0; -+ } -+ else -+ condlog(3, "timestamp has not changed"); -+out: -+ if (file) -+ fclose(file); -+ return ret; -+} -+ -+int update_timestamp(int create) -+{ -+ char buf[44]; -+ time_t timestamp; -+ int fd; -+ int flags = O_WRONLY; -+ if (create) -+ flags |= O_CREAT; -+ if((fd = open(DEFAULT_TIMESTAMP_FILE, flags, -+ (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) < 0) { -+ if (errno == ENOENT) -+ return 0; -+ condlog(0, "Cannot open timestamp file [%s]: %s", -+ DEFAULT_TIMESTAMP_FILE, strerror(errno)); -+ return 1; -+ } -+ if (ftruncate(fd, 0) < 0) { -+ condlog(0, "Cannot truncate timestamp file [%s]: %s", -+ DEFAULT_TIMESTAMP_FILE, strerror(errno)); -+ goto fail; -+ } -+ if (time(×tamp) == -1) { -+ condlog(0, "Cannot get current time: %s", strerror(errno)); -+ goto fail; -+ } -+ memset(buf, 0, sizeof(buf)); -+ snprintf(buf, sizeof(buf)-1, "DM_MULTIPATH_TIMESTAMP=%ld\n", -+ timestamp); -+ if (write(fd, buf, strlen(buf)) != strlen(buf)) { -+ condlog(0, "Cannot write out timestamp to %s: %s", -+ DEFAULT_TIMESTAMP_FILE, strerror(errno)); -+ goto fail; -+ } -+ close(fd); -+ return 0; -+fail: -+ close(fd); -+ return 1; -+} -Index: multipath-tools-130222/libmultipath/file.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/file.h -+++ multipath-tools-130222/libmultipath/file.h -@@ -7,5 +7,8 @@ - - #define FILE_TIMEOUT 30 - int open_file(char *file, int *can_write, char *header); -+int ensure_directories_exist(const char *str, mode_t dir_mode); -+int update_timestamp(int create); -+int timestamp_equal(long int chk_timestamp); - - #endif /* _FILE_H */ -Index: multipath-tools-130222/multipathd/pidfile.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/pidfile.c -+++ multipath-tools-130222/multipathd/pidfile.c -@@ -9,6 +9,7 @@ - #include /* for fcntl() */ - - #include -+#include - - #include "pidfile.h" - -@@ -18,6 +19,8 @@ int pidfile_create(const char *pidFile, - struct flock lock; - int fd, value; - -+ if (ensure_directories_exist(pidFile, 0700)) -+ return 1; - if((fd = open(pidFile, O_WRONLY | O_CREAT, - (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) < 0) { - condlog(0, "Cannot open pidfile [%s], error was [%s]", -Index: multipath-tools-130222/libmultipath/wwids.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.c -+++ multipath-tools-130222/libmultipath/wwids.c -@@ -125,6 +125,7 @@ replace_wwids(vector mp) - goto out_file; - } - ret = 0; -+ update_timestamp(0); - out_file: - close(fd); - out: -@@ -209,6 +210,8 @@ remove_wwid(char *wwid) { - goto out_file; - } - ret = do_remove_wwid(fd, str); -+ if (!ret) -+ update_timestamp(0); - - out_file: - close(fd); -@@ -294,8 +297,10 @@ remember_wwid(char *wwid) - condlog(3, "failed writing wwid %s to wwids file", wwid); - return -1; - } -- if (ret == 1) -+ if (ret == 1) { - condlog(3, "wrote wwid %s to wwids file", wwid); -+ update_timestamp(0); -+ } - else - condlog(4, "wwid %s already in wwids file", wwid); - return 0; -Index: multipath-tools-130222/multipath/multipath.rules -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.rules -+++ multipath-tools-130222/multipath/multipath.rules -@@ -4,18 +4,34 @@ SUBSYSTEM!="block", GOTO="end_mpath" - - IMPORT{cmdline}="nompath" - ENV{nompath}=="?*", GOTO="end_mpath" -+ENV{DEVTYPE}=="partition", GOTO="end_mpath" - ENV{MPATH_SBIN_PATH}="/sbin" - TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin" -+TEST!="/etc/multipath.conf", GOTO="check_kpartx" - --ACTION=="add", ENV{DEVTYPE}!="partition", \ -- ENV{DM_MULTIPATH_DEVICE_PATH}!="1", \ -- TEST=="/etc/multipath.conf", \ -+ACTION=="add", ENV{DM_MULTIPATH_DEVICE_PATH}!="1", \ - PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -c $tempnode", \ -- ENV{DM_MULTIPATH_DEVICE_PATH}="1" ENV{ID_FS_TYPE}="mpath_member" -+ ENV{DM_MULTIPATH_DEVICE_PATH}="1", ENV{ID_FS_TYPE}="mpath_member" - --ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{DEVTYPE}!="partition", \ -+ENV{DM_MULTIPATH_DEVICE_PATH}=="1", \ - RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}" - -+ACTION!="change", GOTO="update_timestamp" -+IMPORT{db}="DM_MULTIPATH_TIMESTAMP" -+IMPORT{db}="DM_MULTIPATH_DEVICE_PATH" -+# 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}", \ -+ ENV{DM_MULTIPATH_DEVICE_PATH}="1", ENV{ID_FS_TYPE}="mpath_member", \ -+ GOTO="update_timestamp" -+ -+# If the device isn't part of a multipath device, clear this -+ENV{DM_MULTIPATH_DEVICE_PATH}="" -+ -+LABEL="update_timestamp" -+IMPORT{file}="/run/multipathd/timestamp" -+ -+LABEL="check_kpartx" - KERNEL!="dm-*", GOTO="end_mpath" - ENV{DM_UUID}=="mpath-?*|part[0-9]*-mpath-?*", OPTIONS+="link_priority=10" - ACTION!="change", GOTO="end_mpath" -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -54,6 +54,7 @@ - #include - #include - #include -+#include - - #include "main.h" - #include "pidfile.h" -@@ -1417,6 +1418,7 @@ reconfigure (struct vectors * vecs) - free_config(old); - retval = 0; - } -+ update_timestamp(0); - - return retval; - } -@@ -1709,6 +1711,7 @@ child (void * param) - - /* Startup complete, create logfile */ - pid_rc = pidfile_create(DEFAULT_PIDFILE, daemon_pid); -+ update_timestamp(1); - /* Ignore errors, we can live without */ - - running_state = DAEMON_RUNNING; -@@ -1758,6 +1761,7 @@ child (void * param) - if (!pid_rc) { - condlog(3, "unlink pidfile"); - unlink(DEFAULT_PIDFILE); -+ unlink(DEFAULT_TIMESTAMP_FILE); - } - - condlog(2, "--------shut down-------"); -Index: multipath-tools-130222/multipathd/multipathd.service -=================================================================== ---- multipath-tools-130222.orig/multipathd/multipathd.service -+++ multipath-tools-130222/multipathd/multipathd.service -@@ -9,7 +9,7 @@ Conflicts=shutdown.target - - [Service] - Type=forking --PIDFile=/var/run/multipathd.pid -+PIDFile=/var/run/multipathd/multipathd.pid - ExecStartPre=/sbin/modprobe dm-multipath - ExecStart=/sbin/multipathd - ExecReload=/sbin/multipathd reconfigure -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -55,6 +55,7 @@ - #include - #include - #include -+#include - #include "dev_t.h" - - int logsink; -@@ -84,7 +85,7 @@ usage (char * progname) - { - fprintf (stderr, VERSION_STRING); - fprintf (stderr, "Usage:\n"); -- fprintf (stderr, " %s [-c|-w|-W] [-d] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); -+ fprintf (stderr, " %s [-c|-w|-W] [-d] [-T tm:val] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); - fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname); - fprintf (stderr, " %s -F [-v lvl]\n", progname); - fprintf (stderr, " %s -t\n", progname); -@@ -98,6 +99,9 @@ usage (char * progname) - " -f flush a multipath device map\n" \ - " -F flush all multipath device maps\n" \ - " -c check if a device should be a path in a multipath device\n" \ -+ " -T tm:val\n" \ -+ " check if tm matches the multipathd timestamp. If so val is\n" \ -+ " whether or not the device is a path in a multipath device\n" \ - " -q allow queue_if_no_path when multipathd is not running\n"\ - " -d dry run, do not create or update devmaps\n" \ - " -t dump internal hardware table\n" \ -@@ -441,7 +445,31 @@ main (int argc, char *argv[]) - extern char *optarg; - extern int optind; - int r = 1; -- -+ long int timestamp = -1; -+ int valid = -1; -+ while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { -+ switch(arg) { -+ case 'T': -+ if (optarg[0] == ':') -+ sscanf(optarg, ":%d", &valid); -+ else -+ sscanf(optarg, "%ld:%d", ×tamp, &valid); -+ if (timestamp_equal(timestamp)) -+ return (valid != 1); -+ break; -+ case ':': -+ fprintf(stderr, "Missing option argument\n"); -+ usage(argv[0]); -+ exit(1); -+ case '?': -+ fprintf(stderr, "Unknown switch: %s\n", optarg); -+ usage(argv[0]); -+ exit(1); -+ default: -+ break; -+ } -+ } -+ optind = 1; - if (getuid() != 0) { - fprintf(stderr, "need to be root\n"); - exit(1); -@@ -455,7 +483,7 @@ main (int argc, char *argv[]) - if (dm_prereq()) - exit(1); - -- while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:BrtqwW")) != EOF ) { -+ while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { - switch(arg) { - case 1: printf("optarg : %s\n",optarg); - break; -@@ -517,6 +545,8 @@ main (int argc, char *argv[]) - case 't': - r = dump_config(); - goto out; -+ case 'T': -+ break; - case 'h': - usage(argv[0]); - exit(0); diff --git a/0065-UPBZ-995538-fail-rdac-on-unavailable.patch b/0065-UPBZ-995538-fail-rdac-on-unavailable.patch deleted file mode 100644 index ca72b61..0000000 --- a/0065-UPBZ-995538-fail-rdac-on-unavailable.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- - libmultipath/checkers/rdac.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/libmultipath/checkers/rdac.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/checkers/rdac.c -+++ multipath-tools-130222/libmultipath/checkers/rdac.c -@@ -222,10 +222,9 @@ libcheck_check (struct checker * c) - goto done; - } - -- /* check if controller is in service mode */ -+ /* check if controller is reporting asymmetric access state of unavailable */ - if ((inq.avtcvp & 0x10) && -- ((inq.asym_access_state_cur & 0x0F) == 0x3) && -- (inq.vendor_specific_cur == 0x7)) { -+ ((inq.asym_access_state_cur & 0x0F) == 0x3)) { - ret = PATH_DOWN; - goto done; - } diff --git a/0066-UP-dos-4k-partition-fix.patch b/0066-UP-dos-4k-partition-fix.patch deleted file mode 100644 index a2d1b44..0000000 --- a/0066-UP-dos-4k-partition-fix.patch +++ /dev/null @@ -1,159 +0,0 @@ ---- - kpartx/dos.c | 17 ++++++++++------- - kpartx/gpt.c | 20 +------------------- - kpartx/kpartx.c | 12 ++++++++++++ - kpartx/kpartx.h | 8 ++++++++ - 4 files changed, 31 insertions(+), 26 deletions(-) - -Index: multipath-tools-130222/kpartx/dos.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/dos.c -+++ multipath-tools-130222/kpartx/dos.c -@@ -26,7 +26,9 @@ read_extended_partition(int fd, struct p - int moretodo = 1; - int i, n=0; - -- next = start = le32_to_cpu(ep->start_sect); -+ int sector_size_mul = get_sector_size(fd)/512; -+ -+ next = start = sector_size_mul * le32_to_cpu(ep->start_sect); - - while (moretodo) { - here = next; -@@ -45,14 +47,14 @@ read_extended_partition(int fd, struct p - memcpy(&p, bp + 0x1be + i * sizeof (p), sizeof (p)); - if (is_extended(p.sys_type)) { - if (p.nr_sects && !moretodo) { -- next = start + le32_to_cpu(p.start_sect); -+ next = start + sector_size_mul * le32_to_cpu(p.start_sect); - moretodo = 1; - } - continue; - } - if (n < ns) { -- sp[n].start = here + le32_to_cpu(p.start_sect); -- sp[n].size = le32_to_cpu(p.nr_sects); -+ sp[n].start = here + sector_size_mul * le32_to_cpu(p.start_sect); -+ sp[n].size = sector_size_mul * le32_to_cpu(p.nr_sects); - n++; - } else { - fprintf(stderr, -@@ -76,6 +78,7 @@ read_dos_pt(int fd, struct slice all, st - unsigned long offset = all.start; - int i, n=4; - unsigned char *bp; -+ int sector_size_mul = get_sector_size(fd)/512; - - bp = (unsigned char *)getblock(fd, offset); - if (bp == NULL) -@@ -89,8 +92,8 @@ read_dos_pt(int fd, struct slice all, st - if (is_gpt(p.sys_type)) - return 0; - if (i < ns) { -- sp[i].start = le32_to_cpu(p.start_sect); -- sp[i].size = le32_to_cpu(p.nr_sects); -+ sp[i].start = sector_size_mul * le32_to_cpu(p.start_sect); -+ sp[i].size = sector_size_mul * le32_to_cpu(p.nr_sects); - } else { - fprintf(stderr, - "dos_partition: too many slices\n"); -@@ -99,7 +102,7 @@ read_dos_pt(int fd, struct slice all, st - if (is_extended(p.sys_type)) { - n += read_extended_partition(fd, &p, sp+n, ns-n); - /* hide the extended partition itself */ -- sp[i].size = 2; -+ sp[i].size = sector_size_mul * 2; - } - } - return n; -Index: multipath-tools-130222/kpartx/gpt.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/gpt.c -+++ multipath-tools-130222/kpartx/gpt.c -@@ -38,6 +38,7 @@ - #include - #include - #include "crc32.h" -+#include "kpartx.h" - - #if BYTE_ORDER == LITTLE_ENDIAN - # define __le16_to_cpu(x) (x) -@@ -116,25 +117,6 @@ is_pmbr_valid(legacy_mbr *mbr) - - - /************************************************************ -- * get_sector_size -- * Requires: -- * - filedes is an open file descriptor, suitable for reading -- * Modifies: nothing -- * Returns: -- * sector size, or 512. -- ************************************************************/ --static int --get_sector_size(int filedes) --{ -- int rc, sector_size = 512; -- -- rc = ioctl(filedes, BLKSSZGET, §or_size); -- if (rc) -- sector_size = 512; -- return sector_size; --} -- --/************************************************************ - * _get_num_sectors - * Requires: - * - filedes is an open file descriptor, suitable for reading -Index: multipath-tools-130222/kpartx/kpartx.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.c -+++ multipath-tools-130222/kpartx/kpartx.c -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -606,3 +607,14 @@ getblock (int fd, unsigned int secnr) { - - return bp->block; - } -+ -+int -+get_sector_size(int filedes) -+{ -+ int rc, sector_size = 512; -+ -+ rc = ioctl(filedes, BLKSSZGET, §or_size); -+ if (rc) -+ sector_size = 512; -+ return sector_size; -+} -Index: multipath-tools-130222/kpartx/kpartx.h -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.h -+++ multipath-tools-130222/kpartx/kpartx.h -@@ -2,6 +2,7 @@ - #define _KPARTX_H - - #include -+#include - - /* - * For each partition type there is a routine that takes -@@ -18,6 +19,13 @@ - #define safe_sprintf(var, format, args...) \ - snprintf(var, sizeof(var), format, ##args) >= sizeof(var) - -+#ifndef BLKSSZGET -+#define BLKSSZGET _IO(0x12,104) /* get block device sector size */ -+#endif -+ -+int -+get_sector_size(int filedes); -+ - /* - * units: 512 byte sectors - */ diff --git a/0067-RHBZ-1022899-fix-udev-partition-handling.patch b/0067-RHBZ-1022899-fix-udev-partition-handling.patch deleted file mode 100644 index 6f0a3d8..0000000 --- a/0067-RHBZ-1022899-fix-udev-partition-handling.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- - multipath/multipath.rules | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/multipath/multipath.rules -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.rules -+++ multipath-tools-130222/multipath/multipath.rules -@@ -13,12 +13,13 @@ ACTION=="add", ENV{DM_MULTIPATH_DEVICE_P - PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -c $tempnode", \ - ENV{DM_MULTIPATH_DEVICE_PATH}="1", ENV{ID_FS_TYPE}="mpath_member" - --ENV{DM_MULTIPATH_DEVICE_PATH}=="1", \ -+ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{DM_MULTIPATH_WIPE_PARTS}="1", \ - RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}" - - ACTION!="change", GOTO="update_timestamp" - IMPORT{db}="DM_MULTIPATH_TIMESTAMP" - IMPORT{db}="DM_MULTIPATH_DEVICE_PATH" -+IMPORT{db}="DM_MULTIPATH_WIPE_PARTS" - # 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}", \ -@@ -27,8 +28,13 @@ PROGRAM=="$env{MPATH_SBIN_PATH}/multipat - - # If the device isn't part of a multipath device, clear this - ENV{DM_MULTIPATH_DEVICE_PATH}="" -+ENV{DM_MULTIPATH_WIPE_PARTS}="" - - LABEL="update_timestamp" -+ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{DM_MULTIPATH_WIPE_PARTS}!="1", \ -+ ENV{DM_MULTIPATH_WIPE_PARTS}="1", \ -+ RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}" -+ - IMPORT{file}="/run/multipathd/timestamp" - - LABEL="check_kpartx" diff --git a/0068-RHBZ-1034578-label-partition-devices.patch b/0068-RHBZ-1034578-label-partition-devices.patch deleted file mode 100644 index e8008f7..0000000 --- a/0068-RHBZ-1034578-label-partition-devices.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- - multipath/multipath.rules | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/multipath/multipath.rules -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.rules -+++ multipath-tools-130222/multipath/multipath.rules -@@ -4,7 +4,8 @@ SUBSYSTEM!="block", GOTO="end_mpath" - - IMPORT{cmdline}="nompath" - ENV{nompath}=="?*", GOTO="end_mpath" --ENV{DEVTYPE}=="partition", GOTO="end_mpath" -+ENV{DEVTYPE}=="partition", IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH", \ -+ GOTO="end_mpath" - ENV{MPATH_SBIN_PATH}="/sbin" - TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin" - TEST!="/etc/multipath.conf", GOTO="check_kpartx" diff --git a/0069-UPBZ-1033791-improve-rdac-checker.patch b/0069-UPBZ-1033791-improve-rdac-checker.patch deleted file mode 100644 index c838f29..0000000 --- a/0069-UPBZ-1033791-improve-rdac-checker.patch +++ /dev/null @@ -1,153 +0,0 @@ ---- - libmultipath/checkers/rdac.c | 91 ++++++++++++++++++++++++++++++++++++++----- - libmultipath/discovery.c | 2 - 2 files changed, 81 insertions(+), 12 deletions(-) - -Index: multipath-tools-130222/libmultipath/checkers/rdac.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/checkers/rdac.c -+++ multipath-tools-130222/libmultipath/checkers/rdac.c -@@ -34,6 +34,18 @@ - #define MSG_RDAC_UP "rdac checker reports path is up" - #define MSG_RDAC_DOWN "rdac checker reports path is down" - #define MSG_RDAC_GHOST "rdac checker reports path is ghost" -+#define MSG_RDAC_DOWN_TYPE(STR) MSG_RDAC_DOWN": "STR -+ -+#define RTPG_UNAVAILABLE 0x3 -+#define RTPG_OFFLINE 0xE -+#define RTPG_TRANSITIONING 0xF -+ -+#define RTPG_UNAVAIL_NON_RESPONSIVE 0x2 -+#define RTPG_UNAVAIL_IN_RESET 0x3 -+#define RTPG_UNAVAIL_CFW_DL1 0x4 -+#define RTPG_UNAVAIL_CFW_DL2 0x5 -+#define RTPG_UNAVAIL_QUIESCED 0x6 -+#define RTPG_UNAVAIL_SERVICE_MODE 0x7 - - struct control_mode_page { - unsigned char header[8]; -@@ -199,22 +211,64 @@ struct volume_access_inq - char PQ_PDT; - char dontcare0[7]; - char avtcvp; -- char dontcare1; -- char asym_access_state_cur; -+ char vol_ppp; -+ char aas_cur; - char vendor_specific_cur; -- char dontcare2[36]; -+ char aas_alt; -+ char vendor_specific_alt; -+ char dontcare1[34]; - }; - -+const char -+*checker_msg_string(struct volume_access_inq *inq) -+{ -+ /* lun not connected */ -+ if (((inq->PQ_PDT & 0xE0) == 0x20) || (inq->PQ_PDT & 0x7f)) -+ return MSG_RDAC_DOWN_TYPE("lun not connected"); -+ -+ /* if no tpg data is available, give the generic path down message */ -+ if (!(inq->avtcvp & 0x10)) -+ return MSG_RDAC_DOWN; -+ -+ /* controller is booting up */ -+ if (((inq->aas_cur & 0x0F) == RTPG_TRANSITIONING) && -+ (inq->aas_alt & 0x0F) != RTPG_TRANSITIONING) -+ return MSG_RDAC_DOWN_TYPE("ctlr is in startup sequence"); -+ -+ /* if not unavailable, give generic message */ -+ if ((inq->aas_cur & 0x0F) != RTPG_UNAVAILABLE) -+ return MSG_RDAC_DOWN; -+ -+ /* target port group unavailable */ -+ switch (inq->vendor_specific_cur) { -+ case RTPG_UNAVAIL_NON_RESPONSIVE: -+ return MSG_RDAC_DOWN_TYPE("non-responsive to queries"); -+ case RTPG_UNAVAIL_IN_RESET: -+ return MSG_RDAC_DOWN_TYPE("ctlr held in reset"); -+ case RTPG_UNAVAIL_CFW_DL1: -+ case RTPG_UNAVAIL_CFW_DL2: -+ return MSG_RDAC_DOWN_TYPE("ctlr firmware downloading"); -+ case RTPG_UNAVAIL_QUIESCED: -+ return MSG_RDAC_DOWN_TYPE("ctlr quiesced by admin request"); -+ case RTPG_UNAVAIL_SERVICE_MODE: -+ return MSG_RDAC_DOWN_TYPE("ctlr is in service mode"); -+ default: -+ return MSG_RDAC_DOWN_TYPE("ctlr is unavailable"); -+ } -+} -+ - extern int - libcheck_check (struct checker * c) - { - struct volume_access_inq inq; -- int ret; -+ int ret, inqfail; - -+ inqfail = 0; - memset(&inq, 0, sizeof(struct volume_access_inq)); - if (0 != do_inq(c->fd, 0xC9, &inq, sizeof(struct volume_access_inq), - c->timeout)) { - ret = PATH_DOWN; -+ inqfail = 1; - goto done; - } else if (((inq.PQ_PDT & 0xE0) == 0x20) || (inq.PQ_PDT & 0x7f)) { - /* LUN not connected*/ -@@ -222,11 +276,27 @@ libcheck_check (struct checker * c) - goto done; - } - -- /* check if controller is reporting asymmetric access state of unavailable */ -- if ((inq.avtcvp & 0x10) && -- ((inq.asym_access_state_cur & 0x0F) == 0x3)) { -- ret = PATH_DOWN; -- goto done; -+ /* If TPGDE bit set, evaluate TPG information */ -+ if ((inq.avtcvp & 0x10)) { -+ switch (inq.aas_cur & 0x0F) { -+ /* Never use the path if it reports unavailable */ -+ case RTPG_UNAVAILABLE: -+ ret = PATH_DOWN; -+ goto done; -+ /* -+ * If both controllers report transitioning, it -+ * means mode select or STPG is being processed. -+ * -+ * If this controller alone is transitioning, it's -+ * booting and we shouldn't use it yet. -+ */ -+ case RTPG_TRANSITIONING: -+ if ((inq.aas_alt & 0xF) != RTPG_TRANSITIONING) { -+ ret = PATH_DOWN; -+ goto done; -+ } -+ break; -+ } - } - - /* If owner set or ioship mode is enabled return PATH_UP always */ -@@ -238,7 +308,8 @@ libcheck_check (struct checker * c) - done: - switch (ret) { - case PATH_DOWN: -- MSG(c, MSG_RDAC_DOWN); -+ MSG(c, (inqfail) ? MSG_RDAC_DOWN_TYPE("inquiry failed") : -+ checker_msg_string(&inq)); - break; - case PATH_UP: - MSG(c, MSG_RDAC_UP); -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -1116,8 +1116,6 @@ pathinfo (struct path *pp, vector hwtabl - if (!strlen(pp->wwid)) - get_uid(pp); - get_prio(pp); -- } else { -- pp->priority = PRIO_UNDEF; - } - } - diff --git a/0070-RHBZ-1036503-blacklist-td-devs.patch b/0070-RHBZ-1036503-blacklist-td-devs.patch deleted file mode 100644 index ffcae46..0000000 --- a/0070-RHBZ-1036503-blacklist-td-devs.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmultipath/blacklist.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/blacklist.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/blacklist.c -+++ multipath-tools-130222/libmultipath/blacklist.c -@@ -163,7 +163,7 @@ setup_default_blist (struct config * con - if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT)) - return 1; - -- str = STRDUP("^hd[a-z]"); -+ str = STRDUP("^(td|hd)[a-z]"); - if (!str) - return 1; - if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT)) diff --git a/0071-RHBZ-1031546-strip-dev.patch b/0071-RHBZ-1031546-strip-dev.patch deleted file mode 100644 index 64118c2..0000000 --- a/0071-RHBZ-1031546-strip-dev.patch +++ /dev/null @@ -1,248 +0,0 @@ ---- - libmultipath/util.c | 22 ++++++++++++++++++++++ - libmultipath/util.h | 1 + - multipath/main.c | 23 +---------------------- - multipathd/cli_handlers.c | 18 ++++++++++++++++++ - 4 files changed, 42 insertions(+), 22 deletions(-) - -Index: multipath-tools-130222/libmultipath/util.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/util.c -+++ multipath-tools-130222/libmultipath/util.c -@@ -236,6 +236,28 @@ skip_proc: - return 0; - } - -+/* This function returns a pointer inside of the supplied pathname string. -+ * If is_path_device is true, it may also modify the supplied string */ -+char *convert_dev(char *name, int is_path_device) -+{ -+ char *ptr; -+ -+ if (!name) -+ return NULL; -+ if (is_path_device) { -+ ptr = strstr(name, "cciss/"); -+ if (ptr) { -+ ptr += 5; -+ *ptr = '!'; -+ } -+ } -+ if (!strncmp(name, "/dev/", 5) && strlen(name) > 5) -+ ptr = name + 5; -+ else -+ ptr = name; -+ return ptr; -+} -+ - dev_t parse_devt(const char *dev_t) - { - int maj, min; -Index: multipath-tools-130222/libmultipath/util.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/util.h -+++ multipath-tools-130222/libmultipath/util.h -@@ -10,6 +10,7 @@ size_t strlcat(char *dst, const char *sr - void remove_trailing_chars(char *path, char c); - int devt2devname (char *, int, char *); - dev_t parse_devt(const char *dev_t); -+char *convert_dev(char *dev, int is_path_device); - - #define safe_sprintf(var, format, args...) \ - snprintf(var, sizeof(var), format, ##args) >= sizeof(var) -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -254,16 +254,7 @@ configure (void) - vecs.pathvec = pathvec; - vecs.mpvec = curmp; - -- /* -- * dev is "/dev/" . "sysfs block dev" -- */ -- if (conf->dev) { -- if (!strncmp(conf->dev, "/dev/", 5) && -- strlen(conf->dev) > 5) -- dev = conf->dev + 5; -- else -- dev = conf->dev; -- } -+ dev = convert_dev(conf->dev, (conf->dev_type == DEV_DEVNODE)); - - /* - * if we have a blacklisted device parameter, exit early -@@ -427,16 +418,6 @@ get_dev_type(char *dev) { - return DEV_DEVMAP; - } - --static void --convert_dev(char *dev) --{ -- char *ptr = strstr(dev, "cciss/"); -- if (ptr) { -- ptr += 5; -- *ptr = '!'; -- } --} -- - int - main (int argc, char *argv[]) - { -@@ -577,8 +558,6 @@ main (int argc, char *argv[]) - - strncpy(conf->dev, argv[optind], FILE_NAME_SIZE); - conf->dev_type = get_dev_type(conf->dev); -- if (conf->dev_type == DEV_DEVNODE) -- convert_dev(conf->dev); - } - conf->daemon = 0; - -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -235,6 +235,7 @@ cli_list_map_topology (void * v, char ** - struct vectors * vecs = (struct vectors *)data; - char * param = get_keyparam(v, MAP); - -+ param = convert_dev(param, 0); - get_path_layout(vecs->pathvec, 0); - mpp = find_mp_by_str(vecs->mpvec, param); - -@@ -416,6 +417,7 @@ cli_add_path (void * v, char ** reply, i - struct path *pp; - int r; - -+ param = convert_dev(param, 1); - condlog(2, "%s: add path (operator)", param); - - if (filter_devnode(conf->blist_devnode, conf->elist_devnode, -@@ -459,6 +461,7 @@ cli_del_path (void * v, char ** reply, i - char * param = get_keyparam(v, PATH); - struct path *pp; - -+ param = convert_dev(param, 1); - condlog(2, "%s: remove path (operator)", param); - pp = find_path_by_dev(vecs->pathvec, param); - if (!pp) { -@@ -478,6 +481,7 @@ cli_add_map (void * v, char ** reply, in - char *alias; - int rc; - -+ param = convert_dev(param, 0); - condlog(2, "%s: add map (operator)", param); - - if (filter_wwid(conf->blist_wwid, conf->elist_wwid, param) > 0) { -@@ -518,6 +522,7 @@ cli_del_map (void * v, char ** reply, in - char *alias; - int rc; - -+ param = convert_dev(param, 0); - condlog(2, "%s: remove map (operator)", param); - minor = dm_get_minor(param); - if (minor < 0) { -@@ -549,6 +554,7 @@ cli_reload(void *v, char **reply, int *l - struct multipath *mpp; - int minor; - -+ mapname = convert_dev(mapname, 0); - condlog(2, "%s: reload map (operator)", mapname); - if (sscanf(mapname, "dm-%d", &minor) == 1) - mpp = find_mp_by_minor(vecs->mpvec, minor); -@@ -591,6 +597,7 @@ cli_resize(void *v, char **reply, int *l - struct pathgroup *pgp; - struct path *pp; - -+ mapname = convert_dev(mapname, 0); - condlog(2, "%s: resize map (operator)", mapname); - if (sscanf(mapname, "dm-%d", &minor) == 1) - mpp = find_mp_by_minor(vecs->mpvec, minor); -@@ -665,6 +672,7 @@ cli_restore_queueing(void *v, char **rep - struct multipath *mpp; - int minor; - -+ mapname = convert_dev(mapname, 0); - condlog(2, "%s: restore map queueing (operator)", mapname); - if (sscanf(mapname, "dm-%d", &minor) == 1) - mpp = find_mp_by_minor(vecs->mpvec, minor); -@@ -716,6 +724,7 @@ cli_disable_queueing(void *v, char **rep - struct multipath *mpp; - int minor; - -+ mapname = convert_dev(mapname, 0); - condlog(2, "%s: disable map queueing (operator)", mapname); - if (sscanf(mapname, "dm-%d", &minor) == 1) - mpp = find_mp_by_minor(vecs->mpvec, minor); -@@ -753,6 +762,7 @@ cli_switch_group(void * v, char ** reply - char * mapname = get_keyparam(v, MAP); - int groupnum = atoi(get_keyparam(v, GROUP)); - -+ mapname = convert_dev(mapname, 0); - condlog(2, "%s: switch to path group #%i (operator)", mapname, groupnum); - - return dm_switchgroup(mapname, groupnum); -@@ -775,6 +785,7 @@ cli_suspend(void * v, char ** reply, int - char * param = get_keyparam(v, MAP); - int r = dm_simplecmd_noflush(DM_DEVICE_SUSPEND, param); - -+ param = convert_dev(param, 0); - condlog(2, "%s: suspend (operator)", param); - - if (!r) /* error */ -@@ -796,6 +807,7 @@ cli_resume(void * v, char ** reply, int - char * param = get_keyparam(v, MAP); - int r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param); - -+ param = convert_dev(param, 0); - condlog(2, "%s: resume (operator)", param); - - if (!r) /* error */ -@@ -817,6 +829,7 @@ cli_reinstate(void * v, char ** reply, i - char * param = get_keyparam(v, PATH); - struct path * pp; - -+ param = convert_dev(param, 1); - pp = find_path_by_dev(vecs->pathvec, param); - - if (!pp) -@@ -837,6 +850,7 @@ cli_reassign (void * v, char ** reply, i - { - char * param = get_keyparam(v, MAP); - -+ param = convert_dev(param, 0); - condlog(3, "%s: reset devices (operator)", param); - - dm_reassign(param); -@@ -851,6 +865,7 @@ cli_fail(void * v, char ** reply, int * - struct path * pp; - int r; - -+ param = convert_dev(param, 1); - pp = find_path_by_dev(vecs->pathvec, param); - - if (!pp) -@@ -962,6 +977,7 @@ cli_getprstatus (void * v, char ** reply - struct vectors * vecs = (struct vectors *)data; - char * param = get_keyparam(v, MAP); - -+ param = convert_dev(param, 0); - get_path_layout(vecs->pathvec, 0); - mpp = find_mp_by_str(vecs->mpvec, param); - -@@ -991,6 +1007,7 @@ cli_setprstatus(void * v, char ** reply, - struct vectors * vecs = (struct vectors *)data; - char * param = get_keyparam(v, MAP); - -+ param = convert_dev(param, 0); - get_path_layout(vecs->pathvec, 0); - mpp = find_mp_by_str(vecs->mpvec, param); - -@@ -1013,6 +1030,7 @@ cli_unsetprstatus(void * v, char ** repl - struct vectors * vecs = (struct vectors *)data; - char * param = get_keyparam(v, MAP); - -+ param = convert_dev(param, 0); - get_path_layout(vecs->pathvec, 0); - mpp = find_mp_by_str(vecs->mpvec, param); - diff --git a/0072-RHBZ-1039199-check-loop-control.patch b/0072-RHBZ-1039199-check-loop-control.patch deleted file mode 100644 index 21bd0c3..0000000 --- a/0072-RHBZ-1039199-check-loop-control.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- - kpartx/lopart.c | 18 ++++++++++++++++-- - 1 file changed, 16 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/kpartx/lopart.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/lopart.c -+++ multipath-tools-130222/kpartx/lopart.c -@@ -32,6 +32,10 @@ - #include "lopart.h" - #include "xstrncpy.h" - -+#ifndef LOOP_CTL_GET_FREE -+#define LOOP_CTL_GET_FREE 0x4C82 -+#endif -+ - #if !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__) \ - && !defined (__s390x__) - #define int2ptr(x) ((void *) ((int) x)) -@@ -140,14 +144,24 @@ find_unused_loop_device (void) - - char dev[20]; - char *loop_formats[] = { "/dev/loop%d", "/dev/loop/%d" }; -- int i, j, fd, somedev = 0, someloop = 0, loop_known = 0; -+ int i, j, fd, first = 0, somedev = 0, someloop = 0, loop_known = 0; - struct stat statbuf; - struct loop_info loopinfo; - FILE *procdev; - -+ if (stat("/dev/loop-control", &statbuf) == 0 && -+ S_ISCHR(statbuf.st_mode)) { -+ fd = open("/dev/loop-control", O_RDWR); -+ if (fd >= 0) { -+ first = ioctl(fd, LOOP_CTL_GET_FREE); -+ close(fd); -+ } -+ if (first < 0) -+ first = 0; -+ } - for (j = 0; j < SIZE(loop_formats); j++) { - -- for(i = 0; i < 256; i++) { -+ for(i = first; i < 256; i++) { - sprintf(dev, loop_formats[j], i); - - if (stat (dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) { diff --git a/0073-RH-update-build-flags.patch b/0073-RH-update-build-flags.patch deleted file mode 100644 index 3ab72d0..0000000 --- a/0073-RH-update-build-flags.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- - Makefile.inc | 2 +- - libmultipath/checkers/rdac.c | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/Makefile.inc -=================================================================== ---- multipath-tools-130222.orig/Makefile.inc -+++ multipath-tools-130222/Makefile.inc -@@ -39,7 +39,7 @@ GZIP = /bin/gzip -9 -c - INSTALL_PROGRAM = install - - ifndef RPM_OPT_FLAGS -- RPM_OPT_FLAGS = -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -+ RPM_OPT_FLAGS = -O2 -g -pipe -Wformat-security -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 - endif - - LDFLAGS += -Wl,-z,relro -Index: multipath-tools-130222/libmultipath/checkers/rdac.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/checkers/rdac.c -+++ multipath-tools-130222/libmultipath/checkers/rdac.c -@@ -308,8 +308,8 @@ libcheck_check (struct checker * c) - done: - switch (ret) { - case PATH_DOWN: -- MSG(c, (inqfail) ? MSG_RDAC_DOWN_TYPE("inquiry failed") : -- checker_msg_string(&inq)); -+ MSG(c, "%s", (inqfail) ? MSG_RDAC_DOWN_TYPE("inquiry failed") : -+ checker_msg_string(&inq)); - break; - case PATH_UP: - MSG(c, MSG_RDAC_UP); diff --git a/0074-RHBZ-1056976-dm-mpath-rules.patch b/0074-RHBZ-1056976-dm-mpath-rules.patch deleted file mode 100644 index 9f6c880..0000000 --- a/0074-RHBZ-1056976-dm-mpath-rules.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- - multipath/11-dm-mpath.rules | 34 ++++++++++++++++++++++++++++++++++ - multipath/Makefile | 2 ++ - 2 files changed, 36 insertions(+) - -Index: multipath-tools-130222/multipath/11-dm-mpath.rules -=================================================================== ---- /dev/null -+++ multipath-tools-130222/multipath/11-dm-mpath.rules -@@ -0,0 +1,34 @@ -+ACTION!="add|change", GOTO="mpath_end" -+ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="mpath_end" -+ENV{DM_UUID}!="mpath-?*", GOTO="mpath_end" -+ -+# Do not initiate scanning if no path is available, -+# otherwise there would be a hang or IO error on access. -+# We'd like to avoid this, especially within udev processing. -+ENV{DM_NR_VALID_PATHS}!="?*", IMPORT{db}="DM_NR_VALID_PATHS" -+ENV{DM_NR_VALID_PATHS}=="0", ENV{DM_NOSCAN}="1" -+ -+# Also skip all foreign rules if no path is available. -+# Remember the original value of DM_DISABLE_OTHER_RULES_FLAG -+# and restore it back once we have at least one path available. -+IMPORT{db}="DM_DISABLE_OTHER_RULES_FLAG_OLD" -+ENV{DM_ACTION}=="PATH_FAILED",\ -+ ENV{DM_NR_VALID_PATHS}=="0",\ -+ ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}=="",\ -+ ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}",\ -+ ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" -+ENV{DM_ACTION}=="PATH_REINSTATED",\ -+ ENV{DM_NR_VALID_PATHS}=="1",\ -+ ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="$env{DM_DISABLE_OTHER_RULES_FLAG_OLD}",\ -+ ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="",\ -+ ENV{DM_ACTIVATION}="1" -+ -+# DM_SUBSYSTEM_UDEV_FLAG0 is the "RELOAD" flag for multipath subsystem. -+# Drop the DM_ACTIVATION flag here as mpath reloads tables if any of its -+# paths are lost/recovered. For any stack above the mpath device, this is not -+# something that should be reacted upon since it would be useless extra work. -+# It's exactly mpath's job to provide *seamless* device access to any of the -+# paths that are available underneath. -+ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", ENV{DM_ACTIVATION}="0" -+ -+LABEL="mpath_end" -Index: multipath-tools-130222/multipath/Makefile -=================================================================== ---- multipath-tools-130222.orig/multipath/Makefile -+++ multipath-tools-130222/multipath/Makefile -@@ -25,6 +25,7 @@ install: - $(INSTALL_PROGRAM) -m 755 mpathconf $(DESTDIR)$(bindir)/ - $(INSTALL_PROGRAM) -d $(DESTDIR)/usr/lib/udev/rules.d - $(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/usr/lib/udev/rules.d/62-multipath.rules -+ $(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)/usr/lib/udev/rules.d/11-dm-mpath.rules - $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir) - $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir) - $(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir) -@@ -33,6 +34,7 @@ install: - - uninstall: - rm $(DESTDIR)/usr/lib/udev/rules.d/62-multipath.rules -+ rm $(DESTDIR)/usr/lib/udev/rules.d/11-dm-mpath.rules - rm $(DESTDIR)$(bindir)/$(EXEC) - rm $(DESTDIR)$(bindir)/mpathconf - rm $(DESTDIR)$(mandir)/$(EXEC).8.gz diff --git a/0075-RHBZ-1056976-reload-flag.patch b/0075-RHBZ-1056976-reload-flag.patch deleted file mode 100644 index ee2cdee..0000000 --- a/0075-RHBZ-1056976-reload-flag.patch +++ /dev/null @@ -1,246 +0,0 @@ ---- - kpartx/devmapper.c | 4 ++-- - kpartx/devmapper.h | 8 +++++++- - kpartx/kpartx.c | 6 +++--- - libmultipath/configure.c | 4 ++-- - libmultipath/devmapper.c | 26 ++++++++++++++------------ - libmultipath/devmapper.h | 10 ++++++++-- - multipathd/cli_handlers.c | 4 ++-- - 7 files changed, 38 insertions(+), 24 deletions(-) - -Index: multipath-tools-130222/kpartx/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/devmapper.c -+++ multipath-tools-130222/kpartx/devmapper.c -@@ -60,7 +60,7 @@ dm_prereq (char * str, int x, int y, int - } - - extern int --dm_simplecmd (int task, const char *name, int no_flush, uint32_t *cookie) { -+dm_simplecmd (int task, const char *name, int no_flush, uint32_t *cookie, uint16_t udev_flags) { - int r = 0; - int udev_wait_flag = (task == DM_DEVICE_RESUME || - task == DM_DEVICE_REMOVE); -@@ -78,7 +78,7 @@ dm_simplecmd (int task, const char *name - if (no_flush) - dm_task_no_flush(dmt); - -- if (udev_wait_flag && !dm_task_set_cookie(dmt, cookie, (udev_sync)? 0 : DM_UDEV_DISABLE_LIBRARY_FALLBACK)) -+ if (udev_wait_flag && !dm_task_set_cookie(dmt, cookie, ((udev_sync)? 0 : DM_UDEV_DISABLE_LIBRARY_FALLBACK) | udev_flags)) - goto out; - r = dm_task_run(dmt); - -Index: multipath-tools-130222/kpartx/devmapper.h -=================================================================== ---- multipath-tools-130222.orig/kpartx/devmapper.h -+++ multipath-tools-130222/kpartx/devmapper.h -@@ -2,10 +2,16 @@ - #define MINOR(dev) ((dev & 0xff) | ((dev >> 12) & 0xfff00)) - #define MKDEV(ma,mi) ((mi & 0xff) | (ma << 8) | ((mi & ~0xff) << 12)) - -+#ifdef DM_SUBSYSTEM_UDEV_FLAG0 -+#define MPATH_UDEV_RELOAD_FLAG DM_SUBSYSTEM_UDEV_FLAG0 -+#else -+#define MPATH_UDEV_RELOAD_FLAG 0 -+#endif -+ - extern int udev_sync; - - int dm_prereq (char *, int, int, int); --int dm_simplecmd (int, const char *, int, uint32_t *); -+int dm_simplecmd (int, const char *, int, uint32_t *, uint16_t); - int dm_addmap (int, const char *, const char *, const char *, uint64_t, - int, const char *, int, mode_t, uid_t, gid_t, uint32_t *); - int dm_map_present (char *); -Index: multipath-tools-130222/kpartx/kpartx.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.c -+++ multipath-tools-130222/kpartx/kpartx.c -@@ -421,7 +421,7 @@ main(int argc, char **argv){ - continue; - - if (!dm_simplecmd(DM_DEVICE_REMOVE, partname, -- 0, &cookie)) { -+ 0, &cookie, 0)) { - r++; - continue; - } -@@ -473,7 +473,7 @@ main(int argc, char **argv){ - } - if (op == DM_DEVICE_RELOAD && - !dm_simplecmd(DM_DEVICE_RESUME, partname, -- 1, &cookie)) { -+ 1, &cookie, MPATH_UDEV_RELOAD_FLAG)) { - fprintf(stderr, "resume failed on %s\n", - partname); - r++; -@@ -505,7 +505,7 @@ main(int argc, char **argv){ - continue; - - if (!dm_simplecmd(DM_DEVICE_REMOVE, -- partname, 1, &cookie)) { -+ partname, 1, &cookie, 0)) { - r++; - continue; - } -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -390,13 +390,13 @@ domap (struct multipath * mpp, char * pa - case ACT_RELOAD: - r = dm_addmap_reload(mpp, params); - if (r) -- r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias); -+ r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, MPATH_UDEV_RELOAD_FLAG); - break; - - case ACT_RESIZE: - r = dm_addmap_reload(mpp, params); - if (r) -- r = dm_simplecmd_flush(DM_DEVICE_RESUME, mpp->alias, 1); -+ r = dm_simplecmd_flush(DM_DEVICE_RESUME, mpp->alias, 1, 0); - break; - - case ACT_RENAME: -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -103,7 +103,9 @@ dm_lib_prereq (void) - { - char version[64]; - int v[3]; --#ifdef LIBDM_API_COOKIE -+#if defined(DM_SUBSYSTEM_UDEV_FLAG0) -+ int minv[3] = {1, 2, 82}; -+#elif defined(LIBDM_API_COOKIE) - int minv[3] = {1, 2, 38}; - #else - int minv[3] = {1, 2, 8}; -@@ -200,7 +202,7 @@ dm_prereq (void) - } - - static int --dm_simplecmd (int task, const char *name, int no_flush, int need_sync) { -+dm_simplecmd (int task, const char *name, int no_flush, int need_sync, uint16_t udev_flags) { - int r = 0; - int udev_wait_flag = (need_sync && (task == DM_DEVICE_RESUME || - task == DM_DEVICE_REMOVE)); -@@ -219,7 +221,7 @@ dm_simplecmd (int task, const char *name - dm_task_no_flush(dmt); /* for DM_DEVICE_SUSPEND/RESUME */ - #endif - -- if (udev_wait_flag && !dm_task_set_cookie(dmt, &conf->cookie, (conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0)) -+ if (udev_wait_flag && !dm_task_set_cookie(dmt, &conf->cookie, ((conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0) | udev_flags)) - goto out; - r = dm_task_run (dmt); - -@@ -229,13 +231,13 @@ dm_simplecmd (int task, const char *name - } - - extern int --dm_simplecmd_flush (int task, const char *name, int needsync) { -- return dm_simplecmd(task, name, 0, needsync); -+dm_simplecmd_flush (int task, const char *name, int needsync, uint16_t udev_flags) { -+ return dm_simplecmd(task, name, 0, needsync, udev_flags); - } - - extern int --dm_simplecmd_noflush (int task, const char *name) { -- return dm_simplecmd(task, name, 1, 1); -+dm_simplecmd_noflush (int task, const char *name, uint16_t udev_flags) { -+ return dm_simplecmd(task, name, 1, 1, udev_flags); - } - - extern int -@@ -670,7 +672,7 @@ _dm_flush_map (const char * mapname, int - return 1; - } - -- r = dm_simplecmd_flush(DM_DEVICE_REMOVE, mapname, need_sync); -+ r = dm_simplecmd_flush(DM_DEVICE_REMOVE, mapname, need_sync, 0); - - if (r) { - condlog(4, "multipath map %s removed", mapname); -@@ -703,14 +705,14 @@ dm_suspend_and_flush_map (const char * m - if (s) - queue_if_no_path = 0; - else -- s = dm_simplecmd_flush(DM_DEVICE_SUSPEND, mapname, 0); -+ s = dm_simplecmd_flush(DM_DEVICE_SUSPEND, mapname, 0, 0); - - if (!dm_flush_map(mapname)) { - condlog(4, "multipath map %s removed", mapname); - return 0; - } - condlog(2, "failed to remove multipath map %s", mapname); -- dm_simplecmd_noflush(DM_DEVICE_RESUME, mapname); -+ dm_simplecmd_noflush(DM_DEVICE_RESUME, mapname, 0); - if (queue_if_no_path) - s = dm_queue_if_no_path((char *)mapname, 1); - return 1; -@@ -1077,7 +1079,7 @@ dm_remove_partmaps (const char * mapname - condlog(4, "partition map %s removed", - names->name); - dm_simplecmd_flush(DM_DEVICE_REMOVE, names->name, -- need_sync); -+ need_sync, 0); - } - - next = names->next; -@@ -1305,7 +1307,7 @@ int dm_reassign_table(const char *name, - condlog(3, "%s: failed to reassign targets", name); - goto out_reload; - } -- dm_simplecmd_noflush(DM_DEVICE_RESUME, name); -+ dm_simplecmd_noflush(DM_DEVICE_RESUME, name, MPATH_UDEV_RELOAD_FLAG); - } - r = 1; - -Index: multipath-tools-130222/libmultipath/devmapper.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.h -+++ multipath-tools-130222/libmultipath/devmapper.h -@@ -6,11 +6,17 @@ - #define TGT_MPATH "multipath" - #define TGT_PART "linear" - -+#ifdef DM_SUBSYSTEM_UDEV_FLAG0 -+#define MPATH_UDEV_RELOAD_FLAG DM_SUBSYSTEM_UDEV_FLAG0 -+#else -+#define MPATH_UDEV_RELOAD_FLAG 0 -+#endif -+ - void dm_init(void); - int dm_prereq (void); - int dm_drv_version (unsigned int * version, char * str); --int dm_simplecmd_flush (int, const char *, int); --int dm_simplecmd_noflush (int, const char *); -+int dm_simplecmd_flush (int, const char *, int, uint16_t); -+int dm_simplecmd_noflush (int, const char *, uint16_t); - int dm_addmap_create (struct multipath *mpp, char *params); - int dm_addmap_reload (struct multipath *mpp, char *params); - int dm_map_present (const char *); -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -783,7 +783,7 @@ cli_suspend(void * v, char ** reply, int - { - struct vectors * vecs = (struct vectors *)data; - char * param = get_keyparam(v, MAP); -- int r = dm_simplecmd_noflush(DM_DEVICE_SUSPEND, param); -+ int r = dm_simplecmd_noflush(DM_DEVICE_SUSPEND, param, 0); - - param = convert_dev(param, 0); - condlog(2, "%s: suspend (operator)", param); -@@ -805,7 +805,7 @@ cli_resume(void * v, char ** reply, int - { - struct vectors * vecs = (struct vectors *)data; - char * param = get_keyparam(v, MAP); -- int r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param); -+ int r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param, 0); - - param = convert_dev(param, 0); - condlog(2, "%s: resume (operator)", param); diff --git a/0076-RHBZ-1056686-add-hw_str_match.patch b/0076-RHBZ-1056686-add-hw_str_match.patch deleted file mode 100644 index dc9aca6..0000000 --- a/0076-RHBZ-1056686-add-hw_str_match.patch +++ /dev/null @@ -1,125 +0,0 @@ ---- - libmultipath/config.c | 10 ++++++++-- - libmultipath/config.h | 1 + - libmultipath/dict.c | 28 ++++++++++++++++++++++++++++ - multipath/multipath.conf.5 | 11 +++++++++++ - 4 files changed, 48 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -431,11 +431,16 @@ restart: - break; - j = n; - vector_foreach_slot_after(hw, hwe2, j) { -- if (hwe_regmatch(hwe1, hwe2)) -+ if (conf->hw_strmatch) { -+ if (hwe_strmatch(hwe2, hwe1)) -+ continue; -+ } -+ else if (hwe_regmatch(hwe1, hwe2)) - continue; - /* dup */ - merge_hwe(hwe2, hwe1); -- if (hwe_strmatch(hwe2, hwe1) == 0) { -+ if (conf->hw_strmatch || -+ hwe_strmatch(hwe2, hwe1) == 0) { - vector_del_slot(hw, i); - free_hwe(hwe1); - n -= 1; -@@ -550,6 +555,7 @@ load_config (char * file, struct udev *u - conf->fast_io_fail = DEFAULT_FAST_IO_FAIL; - conf->retain_hwhandler = DEFAULT_RETAIN_HWHANDLER; - conf->detect_prio = DEFAULT_DETECT_PRIO; -+ conf->hw_strmatch = 0; - - /* - * preload default hwtable -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -107,6 +107,7 @@ struct config { - int log_checker_err; - int allow_queueing; - int find_multipaths; -+ int hw_strmatch; - uid_t uid; - gid_t gid; - mode_t mode; -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -693,6 +693,25 @@ def_detect_prio_handler(vector strvec) - return 0; - } - -+static int -+def_hw_strmatch_handler(vector strvec) -+{ -+ char *buff; -+ -+ buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ -+ if (!strncmp(buff, "on", 2) || !strncmp(buff, "yes", 3) || -+ !strncmp(buff, "1", 1)) -+ conf->hw_strmatch = 1; -+ else -+ conf->hw_strmatch = 0; -+ -+ FREE(buff); -+ return 0; -+} -+ - /* - * blacklist block handlers - */ -@@ -2795,6 +2814,14 @@ snprint_def_detect_prio(char * buff, int - } - - static int -+snprint_def_hw_strmatch(char * buff, int len, void * data) -+{ -+ if (conf->hw_strmatch) -+ return snprintf(buff, len, "yes"); -+ return snprintf(buff, len, "no"); -+} -+ -+static int - snprint_ble_simple (char * buff, int len, void * data) - { - struct blentry * ble = (struct blentry *)data; -@@ -2861,6 +2888,7 @@ init_keywords(void) - install_keyword("find_multipaths", &def_find_multipaths_handler, &snprint_def_find_multipaths); - install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler_handler); - install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio); -+ install_keyword("hw_str_match", &def_hw_strmatch_handler, &snprint_def_hw_strmatch); - __deprecated install_keyword("default_selector", &def_selector_handler, NULL); - __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); - __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL); -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -400,6 +400,17 @@ will automatically use the - .I alua - prioritizer. If not, the prioritizer will be selected as usual. Default is - .I no -+.TP -+.B hw_str_match -+If set to -+.I yes -+, the vendor, product, and revision parameters of user device configs will be -+string matched against the built-in device configs to determine if they should -+modify an existing config, or create a new one. If set to -+.I no -+, the user device configs will be regular expression matched against the -+built-in configs instead. Default is -+.I no - . - .SH "blacklist section" - The diff --git a/0078-RHBZ-1054044-fix-mpathconf-manpage.patch b/0078-RHBZ-1054044-fix-mpathconf-manpage.patch deleted file mode 100644 index b06b410..0000000 --- a/0078-RHBZ-1054044-fix-mpathconf-manpage.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - multipath/mpathconf.8 | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/multipath/mpathconf.8 -=================================================================== ---- multipath-tools-130222.orig/multipath/mpathconf.8 -+++ multipath-tools-130222/multipath/mpathconf.8 -@@ -86,7 +86,7 @@ If set to \fBy\fP, this runs - .B service multipathd start - to start the multipathd daemon on \fB--enable\fP, - .B service multipathd stop --to start the multipathd daemon on \fB--disable\fP, and -+to stop the multipathd daemon on \fB--disable\fP, and - .B service multipathd reload - to reconfigure multipathd on \fB--user_frindly_names\fP and - \fB--find_multipaths\fP. diff --git a/0079-RHBZ-1070581-add-wwid-option.patch b/0079-RHBZ-1070581-add-wwid-option.patch deleted file mode 100644 index e967a51..0000000 --- a/0079-RHBZ-1070581-add-wwid-option.patch +++ /dev/null @@ -1,93 +0,0 @@ ---- - multipath/main.c | 19 ++++++++++++++++--- - multipath/multipath.8 | 5 ++++- - 2 files changed, 20 insertions(+), 4 deletions(-) - -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -85,7 +85,7 @@ usage (char * progname) - { - fprintf (stderr, VERSION_STRING); - fprintf (stderr, "Usage:\n"); -- fprintf (stderr, " %s [-c|-w|-W] [-d] [-T tm:val] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); -+ fprintf (stderr, " %s [-a|-c|-w|-W] [-d] [-T tm:val] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); - fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname); - fprintf (stderr, " %s -F [-v lvl]\n", progname); - fprintf (stderr, " %s -t\n", progname); -@@ -98,6 +98,7 @@ usage (char * progname) - " -ll show multipath topology (maximum info)\n" \ - " -f flush a multipath device map\n" \ - " -F flush all multipath device maps\n" \ -+ " -a add a device wwid to the wwids file\n" \ - " -c check if a device should be a path in a multipath device\n" \ - " -T tm:val\n" \ - " check if tm matches the multipathd timestamp. If so val is\n" \ -@@ -292,6 +293,15 @@ configure (void) - } - goto out; - } -+ if (conf->dry_run == 5) { -+ r = remember_wwid(refwwid); -+ if (r == 0) -+ printf("wwid '%s' added\n", refwwid); -+ else -+ printf("failed adding '%s' to wwids file\n", -+ refwwid); -+ goto out; -+ } - condlog(3, "scope limited to %s", refwwid); - if (conf->dry_run == 2) { - if (check_wwids_file(refwwid, 0) == 0){ -@@ -428,7 +438,7 @@ main (int argc, char *argv[]) - int r = 1; - long int timestamp = -1; - int valid = -1; -- while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { -+ while ((arg = getopt(argc, argv, ":adchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { - switch(arg) { - case 'T': - if (optarg[0] == ':') -@@ -464,7 +474,7 @@ main (int argc, char *argv[]) - if (dm_prereq()) - exit(1); - -- while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { -+ while ((arg = getopt(argc, argv, ":adchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { - switch(arg) { - case 1: printf("optarg : %s\n",optarg); - break; -@@ -537,6 +547,9 @@ main (int argc, char *argv[]) - case 'W': - conf->dry_run = 4; - break; -+ case 'a': -+ conf->dry_run = 5; -+ break; - case ':': - fprintf(stderr, "Missing option argument\n"); - usage(argv[0]); -Index: multipath-tools-130222/multipath/multipath.8 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.8 -+++ multipath-tools-130222/multipath/multipath.8 -@@ -8,7 +8,7 @@ multipath \- Device mapper target autoco - .RB [\| \-b\ \c - .IR bindings_file \|] - .RB [\| \-d \|] --.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-w | \-W \|] -+.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-a | \-w | \-W \|] - .RB [\| \-p\ \c - .BR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|] - .RB [\| device \|] -@@ -68,6 +68,9 @@ check if a block device should be a path - .B \-q - allow device tables with queue_if_no_path when multipathd is not running - .TP -+.B \-a -+add the wwid for the specified device to the wwids file -+.TP - .B \-w - remove the wwid for the specified device from the wwids file - .TP diff --git a/0080-RHBZ-1075796-cmdline-wwid.patch b/0080-RHBZ-1075796-cmdline-wwid.patch deleted file mode 100644 index f943aa3..0000000 --- a/0080-RHBZ-1075796-cmdline-wwid.patch +++ /dev/null @@ -1,157 +0,0 @@ ---- - libmultipath/wwids.c | 44 ++++++++++++++++++++++++++++++++++++++++++ - libmultipath/wwids.h | 1 - multipath/main.c | 12 ++++++++--- - multipath/multipath.8 | 5 +++- - multipathd/multipathd.service | 1 - 5 files changed, 59 insertions(+), 4 deletions(-) - -Index: multipath-tools-130222/libmultipath/wwids.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.c -+++ multipath-tools-130222/libmultipath/wwids.c -@@ -305,3 +305,47 @@ remember_wwid(char *wwid) - condlog(4, "wwid %s already in wwids file", wwid); - return 0; - } -+ -+int remember_cmdline_wwid(void) -+{ -+ FILE *f = NULL; -+ char buf[LINE_MAX], *next, *ptr; -+ int ret = 0; -+ -+ f = fopen("/proc/cmdline", "re"); -+ if (!f) { -+ condlog(0, "can't open /proc/cmdline : %s", strerror(errno)); -+ return -1; -+ } -+ -+ if (!fgets(buf, sizeof(buf), f)) { -+ if (ferror(f)) -+ condlog(0, "read of /proc/cmdline failed : %s", -+ strerror(errno)); -+ else -+ condlog(0, "couldn't read /proc/cmdline"); -+ fclose(f); -+ return -1; -+ } -+ fclose(f); -+ next = buf; -+ while((ptr = strstr(next, "mpath.wwid="))) { -+ ptr += 11; -+ next = strpbrk(ptr, " \t\n"); -+ if (next) { -+ *next = '\0'; -+ next++; -+ } -+ if (strlen(ptr)) { -+ if (remember_wwid(ptr) != 0) -+ ret = -1; -+ } -+ else { -+ condlog(0, "empty mpath.wwid kernel command line option"); -+ ret = -1; -+ } -+ if (!next) -+ break; -+ } -+ return ret; -+} -Index: multipath-tools-130222/libmultipath/wwids.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.h -+++ multipath-tools-130222/libmultipath/wwids.h -@@ -17,5 +17,6 @@ int remember_wwid(char *wwid); - int check_wwids_file(char *wwid, int write_wwid); - int remove_wwid(char *wwid); - int replace_wwids(vector mp); -+int remember_cmdline_wwid(void); - - #endif /* _WWIDS_H */ -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -85,7 +85,7 @@ usage (char * progname) - { - fprintf (stderr, VERSION_STRING); - fprintf (stderr, "Usage:\n"); -- fprintf (stderr, " %s [-a|-c|-w|-W] [-d] [-T tm:val] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); -+ fprintf (stderr, " %s [-a|-A|-c|-w|-W] [-d] [-T tm:val] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); - fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname); - fprintf (stderr, " %s -F [-v lvl]\n", progname); - fprintf (stderr, " %s -t\n", progname); -@@ -99,6 +99,8 @@ usage (char * progname) - " -f flush a multipath device map\n" \ - " -F flush all multipath device maps\n" \ - " -a add a device wwid to the wwids file\n" \ -+ " -A add devices from kernel command line mpath.wwids\n" -+ " parameters to wwids file\n" \ - " -c check if a device should be a path in a multipath device\n" \ - " -T tm:val\n" \ - " check if tm matches the multipathd timestamp. If so val is\n" \ -@@ -438,7 +440,7 @@ main (int argc, char *argv[]) - int r = 1; - long int timestamp = -1; - int valid = -1; -- while ((arg = getopt(argc, argv, ":adchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { -+ while ((arg = getopt(argc, argv, ":aAdchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { - switch(arg) { - case 'T': - if (optarg[0] == ':') -@@ -474,7 +476,7 @@ main (int argc, char *argv[]) - if (dm_prereq()) - exit(1); - -- while ((arg = getopt(argc, argv, ":adchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { -+ while ((arg = getopt(argc, argv, ":aAdchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { - switch(arg) { - case 1: printf("optarg : %s\n",optarg); - break; -@@ -538,6 +540,10 @@ main (int argc, char *argv[]) - goto out; - case 'T': - break; -+ case 'A': -+ if (remember_cmdline_wwid() != 0) -+ exit(1); -+ exit(0); - case 'h': - usage(argv[0]); - exit(0); -Index: multipath-tools-130222/multipathd/multipathd.service -=================================================================== ---- multipath-tools-130222.orig/multipathd/multipathd.service -+++ multipath-tools-130222/multipathd/multipathd.service -@@ -11,6 +11,7 @@ Conflicts=shutdown.target - Type=forking - PIDFile=/var/run/multipathd/multipathd.pid - ExecStartPre=/sbin/modprobe dm-multipath -+ExecStartPre=-/sbin/multipath -A - ExecStart=/sbin/multipathd - ExecReload=/sbin/multipathd reconfigure - #ExecStop=/path/to/scrip delete-me if not necessary -Index: multipath-tools-130222/multipath/multipath.8 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.8 -+++ multipath-tools-130222/multipath/multipath.8 -@@ -8,7 +8,7 @@ multipath \- Device mapper target autoco - .RB [\| \-b\ \c - .IR bindings_file \|] - .RB [\| \-d \|] --.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-a | \-w | \-W \|] -+.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-a | \-A | \-w | \-W \|] - .RB [\| \-p\ \c - .BR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|] - .RB [\| device \|] -@@ -71,6 +71,9 @@ allow device tables with queue_if_no_pat - .B \-a - add the wwid for the specified device to the wwids file - .TP -+.B \-A -+add wwids from any kernel command line mpath.wwid parameters to the wwids file -+.TP - .B \-w - remove the wwid for the specified device from the wwids file - .TP diff --git a/0081-RHBZ-1066264-check-prefix-on-rename.patch b/0081-RHBZ-1066264-check-prefix-on-rename.patch deleted file mode 100644 index 791f32e..0000000 --- a/0081-RHBZ-1066264-check-prefix-on-rename.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- - libmultipath/devmapper.c | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -1151,6 +1151,8 @@ dm_rename_partmaps (char * old, char * n - unsigned long long size; - char dev_t[32]; - int r = 1; -+ int offset; -+ char *delim; - - if (!(dmt = dm_task_create(DM_DEVICE_LIST))) - return 1; -@@ -1171,6 +1173,11 @@ dm_rename_partmaps (char * old, char * n - if (dm_dev_t(old, &dev_t[0], 32)) - goto out; - -+ if (isdigit(new[strlen(new)-1])) -+ delim = "p"; -+ else -+ delim = ""; -+ - do { - if ( - /* -@@ -1198,8 +1205,9 @@ dm_rename_partmaps (char * old, char * n - * then it's a kpartx generated partition. - * Rename it. - */ -- snprintf(buff, PARAMS_SIZE, "%s%s", -- new, names->name + strlen(old)); -+ for (offset = strlen(old); names->name[offset] && !(isdigit(names->name[offset])); offset++); /* do nothing */ -+ snprintf(buff, PARAMS_SIZE, "%s%s%s", -+ new, delim, names->name + offset); - dm_rename(names->name, buff); - condlog(4, "partition map %s renamed", - names->name); diff --git a/0082-UPBZ-1109995-no-sync-turs-on-pthread_cancel.patch b/0082-UPBZ-1109995-no-sync-turs-on-pthread_cancel.patch deleted file mode 100644 index 9a1bd34..0000000 --- a/0082-UPBZ-1109995-no-sync-turs-on-pthread_cancel.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- - libmultipath/checkers/tur.c | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -Index: multipath-tools-130222/libmultipath/checkers/tur.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/checkers/tur.c -+++ multipath-tools-130222/libmultipath/checkers/tur.c -@@ -409,7 +409,6 @@ libcheck_check (struct checker * c) - ct->running = 0; - MSG(c, MSG_TUR_TIMEOUT); - tur_status = PATH_DOWN; -- ct->state = PATH_UNCHECKED; - } else { - condlog(3, "%d:%d: tur checker not finished", - TUR_DEVT(ct)); -@@ -426,12 +425,10 @@ libcheck_check (struct checker * c) - pthread_mutex_unlock(&ct->lock); - } else { - if (ct->thread) { -- /* pthread cancel failed. continue in sync mode */ - pthread_mutex_unlock(&ct->lock); -- condlog(3, "%d:%d: tur thread not responding, " -- "using sync mode", TUR_DEVT(ct)); -- return tur_check(c->fd, c->timeout, c->message, -- ct->wwid); -+ condlog(3, "%d:%d: tur thread not responding, ", -+ TUR_DEVT(ct)); -+ return PATH_DOWN; - } - /* Start new TUR checker */ - ct->state = PATH_UNCHECKED; diff --git a/0083-RHBZ-1080055-orphan-paths-on-reload.patch b/0083-RHBZ-1080055-orphan-paths-on-reload.patch deleted file mode 100644 index 8eaee74..0000000 --- a/0083-RHBZ-1080055-orphan-paths-on-reload.patch +++ /dev/null @@ -1,85 +0,0 @@ ---- - libmultipath/structs_vec.c | 31 +++++++++++++++++++++++++++---- - multipathd/main.c | 4 ++++ - 2 files changed, 31 insertions(+), 4 deletions(-) - -Index: multipath-tools-130222/libmultipath/structs_vec.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs_vec.c -+++ multipath-tools-130222/libmultipath/structs_vec.c -@@ -280,12 +280,38 @@ update_multipath_status (struct multipat - return 0; - } - -+void sync_paths(struct multipath *mpp, vector pathvec) -+{ -+ struct path *pp; -+ struct pathgroup *pgp; -+ int found, i, j; -+ -+ vector_foreach_slot (mpp->paths, pp, i) { -+ found = 0; -+ vector_foreach_slot(mpp->pg, pgp, j) { -+ if (find_slot(pgp->paths, (void *)pp) != -1) { -+ found = 1; -+ break; -+ } -+ } -+ if (!found) { -+ condlog(3, "%s dropped path %s", mpp->alias, pp->dev); -+ vector_del_slot(mpp->paths, i--); -+ orphan_path(pp); -+ } -+ } -+ update_mpp_paths(mpp, pathvec); -+ vector_foreach_slot (mpp->paths, pp, i) -+ pp->mpp = mpp; -+} -+ - extern int - update_multipath_strings (struct multipath *mpp, vector pathvec) - { - if (!mpp) - return 1; - -+ update_mpp_paths(mpp, pathvec); - condlog(4, "%s: %s", mpp->alias, __FUNCTION__); - - free_multipath_attributes(mpp); -@@ -294,6 +320,7 @@ update_multipath_strings (struct multipa - - if (update_multipath_table(mpp, pathvec)) - return 1; -+ sync_paths(mpp, pathvec); - - if (update_multipath_status(mpp)) - return 1; -@@ -494,13 +521,9 @@ int update_multipath (struct vectors *ve - return 2; - } - -- free_pgvec(mpp->pg, KEEP_PATHS); -- mpp->pg = NULL; -- - if (__setup_multipath(vecs, mpp, reset)) - return 1; /* mpp freed in setup_multipath */ - -- adopt_paths(vecs->pathvec, mpp, 0); - /* - * compare checkers states with DM states - */ -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -1152,6 +1152,10 @@ check_path (struct vectors * vecs, struc - pp->dev); - pp->dmstate = PSTATE_UNDEF; - } -+ /* if update_multipath_strings orphaned the path, quit early */ -+ if (!pp->mpp) -+ return; -+ - pp->chkrstate = newstate; - if (newstate != pp->state) { - int oldstate = pp->state; diff --git a/0084-RHBZ-1110000-multipath-man.patch b/0084-RHBZ-1110000-multipath-man.patch deleted file mode 100644 index 4ea422a..0000000 --- a/0084-RHBZ-1110000-multipath-man.patch +++ /dev/null @@ -1,101 +0,0 @@ ---- - libmultipath/prioritizers/alua.c | 4 ++-- - multipathd/multipathd.8 | 37 +++++++++++++++++++++++++++++++++---- - 2 files changed, 35 insertions(+), 6 deletions(-) - -Index: multipath-tools-130222/multipathd/multipathd.8 -=================================================================== ---- multipath-tools-130222.orig/multipathd/multipathd.8 -+++ multipath-tools-130222/multipathd/multipathd.8 -@@ -42,6 +42,9 @@ format wildcards. - .B list|show maps|multipaths - Show the multipath devices that the multipathd is monitoring. - .TP -+.B list|show daemon -+Show the current state of the multipathd daemon -+.TP - .B list|show maps|multipaths format $format - Show the status of all multipath devices that the multipathd is monitoring, - using a format string with multipath format wildcards. -@@ -83,16 +86,16 @@ Add a path to the list of monitored path - .B remove|del path $path - Stop monitoring a path. $path is as listed in /sys/block (e.g. sda). - .TP --.B add map $map -+.B add map|multipath $map - Add a multipath device to the list of monitored devices. $map can either be a device-mapper device as listed in /sys/block (e.g. dm-0) or it can be the alias for the multipath device (e.g. mpath1) or the uid of the multipath device (e.g. 36005076303ffc56200000000000010aa). - .TP --.B remove|del map $map -+.B remove|del map|multipath $map - Stop monitoring a multipath device. - .TP - .B resize map|multipath $map - Resizes map $map to the given size - .TP --.B switch|switchgroup map $map group $group -+.B switch|switchgroup map|multipath $map group $group - Force a multipath device to switch to a specific path group. $group is the path group index, starting with 1. - .TP - .B reconfigure -@@ -104,6 +107,13 @@ Sets map $map into suspend state. - .B resume map|multipath $map - Resumes map $map from suspend state. - .TP -+.B reset map|multipath $map -+Reassign existing device-mapper table(s) use use the multipath device, instead -+of its path devices. -+.TP -+.B reload map|multipath $map -+Reload a multipath device. -+.TP - .B fail path $path - Sets path $path into failed state. - .TP -@@ -120,10 +130,29 @@ Restore queueing on all multipath device - Disable queuing on multipathed map $map - .TP - .B restorequeueing map|multipath $map --Restore queuing on multipahted map $map -+Restore queuing on multipathed map $map -+.TP -+.B forcequeueing daemon -+Forces multipathd into queue_without_daemon mode, so that no_path_retry queueing -+will not be disabled when the daemon stops -+.TP -+.B restorequeueing daemon -+Restores configured queue_without_daemon mode -+.TP -+.B map|multipath $map setprstatus -+Enable persistent reservation management on $map -+.TP -+.B map|multipath $map unsetprstatus -+Disable persistent reservation management on $map -+.TP -+.B map|multipath $map getprstatus -+Get the current persistent reservation management status of $map - .TP - .B quit|exit - End interactive session. -+.TP -+.B shutdown -+Stop multipathd. - - .SH "SEE ALSO" - .BR multipath (8) -Index: multipath-tools-130222/libmultipath/prioritizers/alua.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/alua.c -+++ multipath-tools-130222/libmultipath/prioritizers/alua.c -@@ -119,10 +119,10 @@ int getprio (struct path * pp, char * ar - condlog(0, "%s: couldn't get target port group", pp->dev); - break; - case ALUA_PRIO_GETAAS_FAILED: -- condlog(0, "%s: couln't get asymmetric access state", pp->dev); -+ condlog(0, "%s: couldn't get asymmetric access state", pp->dev); - break; - case ALUA_PRIO_TPGS_FAILED: -- condlog(3, "%s: couln't get supported alua states", pp->dev); -+ condlog(3, "%s: couldn't get supported alua states", pp->dev); - break; - } - } diff --git a/0085-UPBZ-1110006-datacore-config.patch b/0085-UPBZ-1110006-datacore-config.patch deleted file mode 100644 index cedb5e3..0000000 --- a/0085-UPBZ-1110006-datacore-config.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- - libmultipath/hwtable.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -Index: multipath-tools-130222/libmultipath/hwtable.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/hwtable.c -+++ multipath-tools-130222/libmultipath/hwtable.c -@@ -1108,6 +1108,19 @@ static struct hwentry default_hw[] = { - .prio_name = PRIO_ALUA, - .prio_args = NULL, - }, -+ { -+ .vendor = "DataCore", -+ .product = "Virtual Disk", -+ .features = DEFAULT_FEATURES, -+ .hwhandler = DEFAULT_HWHANDLER, -+ .pgpolicy = GROUP_BY_PRIO, -+ .pgfailback = -FAILBACK_IMMEDIATE, -+ .rr_weight = RR_WEIGHT_NONE, -+ .no_path_retry = NO_PATH_RETRY_QUEUE, -+ .checker_name = TUR, -+ .prio_name = PRIO_ALUA, -+ .prio_args = NULL, -+ }, - /* - * EOL - */ diff --git a/0086-RHBZ-1110007-orphan-path-on-failed-add.patch b/0086-RHBZ-1110007-orphan-path-on-failed-add.patch deleted file mode 100644 index 0d6aa58..0000000 --- a/0086-RHBZ-1110007-orphan-path-on-failed-add.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - multipathd/main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -562,7 +562,7 @@ rescan: - return 0; - } - else -- return 1; -+ goto fail; - - fail_map: - remove_map(mpp, vecs, 1); diff --git a/0087-RHBZ-1110013-config-error-checking.patch b/0087-RHBZ-1110013-config-error-checking.patch deleted file mode 100644 index c774bc5..0000000 --- a/0087-RHBZ-1110013-config-error-checking.patch +++ /dev/null @@ -1,190 +0,0 @@ ---- - libmultipath/parser.c | 154 ++++++++++++++++++++++++++++++++++++++++---------- - 1 file changed, 126 insertions(+), 28 deletions(-) - -Index: multipath-tools-130222/libmultipath/parser.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/parser.c -+++ multipath-tools-130222/libmultipath/parser.c -@@ -395,36 +395,57 @@ set_value(vector strvec) - char *alloc = NULL; - char *tmp; - -- if (!str) -+ if (!str) { -+ condlog(0, "option '%s' missing value", -+ (char *)VECTOR_SLOT(strvec, 0)); - return NULL; -- -+ } - size = strlen(str); -- if (size == 0) -+ if (size == 0) { -+ condlog(0, "option '%s' has empty value", -+ (char *)VECTOR_SLOT(strvec, 0)); - return NULL; -- -- if (*str == '"') { -- for (i = 2; i < VECTOR_SIZE(strvec); i++) { -- str = VECTOR_SLOT(strvec, i); -- len += strlen(str); -- if (!alloc) -- alloc = -- (char *) MALLOC(sizeof (char *) * -- (len + 1)); -- else { -- alloc = -- REALLOC(alloc, sizeof (char *) * (len + 1)); -- tmp = VECTOR_SLOT(strvec, i-1); -- if (alloc && *str != '"' && *tmp != '"') -- strncat(alloc, " ", 1); -- } -- -- if (alloc && i != VECTOR_SIZE(strvec)-1) -- strncat(alloc, str, strlen(str)); -- } -- } else { -- alloc = MALLOC(sizeof (char *) * (size + 1)); -+ } -+ if (*str != '"') { -+ alloc = MALLOC(sizeof (char) * (size + 1)); - if (alloc) - memcpy(alloc, str, size); -+ else -+ condlog(0, "can't allocate memeory for option '%s'", -+ (char *)VECTOR_SLOT(strvec, 0)); -+ return alloc; -+ } -+ /* Even empty quotes counts as a value (An empty string) */ -+ alloc = (char *) MALLOC(sizeof (char)); -+ if (!alloc) { -+ condlog(0, "can't allocate memeory for option '%s'", -+ (char *)VECTOR_SLOT(strvec, 0)); -+ return NULL; -+ } -+ for (i = 2; i < VECTOR_SIZE(strvec); i++) { -+ str = VECTOR_SLOT(strvec, i); -+ if (!str) { -+ free(alloc); -+ condlog(0, "parse error for option '%s'", -+ (char *)VECTOR_SLOT(strvec, 0)); -+ return NULL; -+ } -+ if (*str == '"') -+ break; -+ tmp = alloc; -+ /* The first +1 is for the NULL byte. The rest are for the -+ * spaces between words */ -+ len += strlen(str) + 1; -+ alloc = REALLOC(alloc, sizeof (char) * len); -+ if (!alloc) { -+ FREE(tmp); -+ condlog(0, "can't allocate memeory for option '%s'", -+ (char *)VECTOR_SLOT(strvec, 0)); -+ return NULL; -+ } -+ if (*alloc != '\0') -+ strncat(alloc, " ", 1); -+ strncat(alloc, str, strlen(str)); - } - return alloc; - } -@@ -465,6 +486,74 @@ void free_uniques(vector uniques) - } - - int -+is_sublevel_keyword(char *str) -+{ -+ return (strcmp(str, "defaults") == 0 || strcmp(str, "blacklist") == 0 || -+ strcmp(str, "blacklist_exceptions") == 0 || -+ strcmp(str, "devices") == 0 || strcmp(str, "devices") == 0 || -+ strcmp(str, "device") == 0 || strcmp(str, "multipaths") == 0 || -+ strcmp(str, "multipath") == 0); -+} -+ -+int -+validate_config_strvec(vector strvec) -+{ -+ char *str; -+ int i; -+ -+ str = VECTOR_SLOT(strvec, 0); -+ if (str == NULL) { -+ condlog(0, "can't parse option on line %d of config file", -+ line_nr); -+ return -1; -+ } -+ if (*str == '}') { -+ if (VECTOR_SIZE(strvec) > 1) -+ condlog(0, "ignoring extra data starting with '%s' on line %d of config file", (char *)VECTOR_SLOT(strvec, 1), line_nr); -+ return 0; -+ } -+ if (*str == '{') { -+ condlog(0, "invalid keyword '%s' on line %d of config file", str, line_nr); -+ return -1; -+ } -+ if (is_sublevel_keyword(str)) { -+ str = VECTOR_SLOT(strvec, 1); -+ if (str == NULL) -+ condlog(0, "missing '{' on line %d of config file", line_nr); -+ else if (*str != '{') -+ condlog(0, "expecting '{' on line %d of config file. found '%s'", line_nr, str); -+ else if (VECTOR_SIZE(strvec) > 2) -+ condlog(0, "ignoring extra data starting with '%s' on line %d of config file", (char *)VECTOR_SLOT(strvec, 2), line_nr); -+ return 0; -+ } -+ str = VECTOR_SLOT(strvec, 1); -+ if (str == NULL) { -+ condlog(0, "missing value for option '%s' on line %d of config file", (char *)VECTOR_SLOT(strvec, 0), line_nr); -+ return -1; -+ } -+ if (*str != '"') { -+ if (VECTOR_SIZE(strvec) > 2) -+ condlog(0, "ignoring extra data starting with '%s' on line %d of config file", (char *)VECTOR_SLOT(strvec, 2), line_nr); -+ return 0; -+ } -+ for (i = 2; i < VECTOR_SIZE(strvec); i++) { -+ str = VECTOR_SLOT(strvec, i); -+ if (str == NULL) { -+ condlog(0, "can't parse value on line %d of config file", line_nr); -+ return -1; -+ } -+ if (*str == '"') { -+ if (VECTOR_SIZE(strvec) > i + 1) -+ condlog(0, "ignoring extra data starting with '%s' on line %d of config file", (char *)VECTOR_SLOT(strvec, (i + 1)), line_nr); -+ return 0; -+ } -+ } -+ condlog(0, "missing closing quotes on line %d of config file", -+ line_nr); -+ return 0; -+} -+ -+int - process_stream(vector keywords) - { - int i; -@@ -494,11 +583,20 @@ process_stream(vector keywords) - if (!strvec) - continue; - -+ if (validate_config_strvec(strvec) != 0) { -+ free_strvec(strvec); -+ continue; -+ } -+ - str = VECTOR_SLOT(strvec, 0); - -- if (!strcmp(str, EOB) && kw_level > 0) { -- free_strvec(strvec); -- break; -+ if (!strcmp(str, EOB)) { -+ if (kw_level > 0) { -+ free_strvec(strvec); -+ break; -+ } -+ condlog(0, "unmatched '%s' at line %d of config file", -+ EOB, line_nr); - } - - for (i = 0; i < VECTOR_SIZE(keywords); i++) { diff --git a/0088-RHBZ-1069811-configurable-prio-timeout.patch b/0088-RHBZ-1069811-configurable-prio-timeout.patch deleted file mode 100644 index 60f374b..0000000 --- a/0088-RHBZ-1069811-configurable-prio-timeout.patch +++ /dev/null @@ -1,178 +0,0 @@ ---- - libmultipath/prio.c | 7 +++++++ - libmultipath/prio.h | 1 + - libmultipath/prioritizers/alua_rtpg.c | 5 +++-- - libmultipath/prioritizers/emc.c | 2 +- - libmultipath/prioritizers/hds.c | 2 +- - libmultipath/prioritizers/hp_sw.c | 2 +- - libmultipath/prioritizers/ontap.c | 4 ++-- - libmultipath/prioritizers/rdac.c | 2 +- - multipath.conf.annotated | 5 +++-- - multipath/multipath.conf.5 | 4 ++-- - 10 files changed, 22 insertions(+), 12 deletions(-) - -Index: multipath-tools-130222/libmultipath/prio.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prio.c -+++ multipath-tools-130222/libmultipath/prio.c -@@ -10,6 +10,13 @@ - - static LIST_HEAD(prioritizers); - -+unsigned int get_prio_timeout(unsigned int default_timeout) -+{ -+ if (conf->checker_timeout) -+ return conf->checker_timeout * 1000; -+ return default_timeout; -+} -+ - int init_prio (void) - { - if (!add_prio(DEFAULT_PRIO)) -Index: multipath-tools-130222/libmultipath/prio.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prio.h -+++ multipath-tools-130222/libmultipath/prio.h -@@ -51,6 +51,7 @@ struct prio { - int (*getprio)(struct path *, char *); - }; - -+unsigned int get_prio_timeout(unsigned int default_timeout); - int init_prio (void); - void cleanup_prio (void); - struct prio * add_prio (char *); -Index: multipath-tools-130222/libmultipath/prioritizers/alua_rtpg.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/alua_rtpg.c -+++ multipath-tools-130222/libmultipath/prioritizers/alua_rtpg.c -@@ -21,6 +21,7 @@ - #define __user - #include - -+#include "../prio.h" - #include "alua_rtpg.h" - - #define SENSE_BUFF_LEN 32 -@@ -134,7 +135,7 @@ do_inquiry(int fd, int evpd, unsigned in - hdr.dxfer_len = resplen; - hdr.sbp = sense; - hdr.mx_sb_len = sizeof(sense); -- hdr.timeout = DEF_TIMEOUT; -+ hdr.timeout = get_prio_timeout(DEF_TIMEOUT); - - if (ioctl(fd, SG_IO, &hdr) < 0) { - PRINT_DEBUG("do_inquiry: IOCTL failed!\n"); -@@ -253,7 +254,7 @@ do_rtpg(int fd, void* resp, long resplen - hdr.dxfer_len = resplen; - hdr.mx_sb_len = sizeof(sense); - hdr.sbp = sense; -- hdr.timeout = DEF_TIMEOUT; -+ hdr.timeout = get_prio_timeout(DEF_TIMEOUT); - - if (ioctl(fd, SG_IO, &hdr) < 0) - return -RTPG_RTPG_FAILED; -Index: multipath-tools-130222/libmultipath/prioritizers/emc.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/emc.c -+++ multipath-tools-130222/libmultipath/prioritizers/emc.c -@@ -31,7 +31,7 @@ int emc_clariion_prio(const char *dev, i - io_hdr.dxferp = sense_buffer; - io_hdr.cmdp = inqCmdBlk; - io_hdr.sbp = sb; -- io_hdr.timeout = 60000; -+ io_hdr.timeout = get_prio_timeout(60000); - io_hdr.pack_id = 0; - if (ioctl(fd, SG_IO, &io_hdr) < 0) { - pp_emc_log(0, "sending query command failed"); -Index: multipath-tools-130222/libmultipath/prioritizers/hds.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/hds.c -+++ multipath-tools-130222/libmultipath/prioritizers/hds.c -@@ -114,7 +114,7 @@ int hds_modular_prio (const char *dev, i - io_hdr.dxferp = inqBuff; - io_hdr.cmdp = inqCmdBlk; - io_hdr.sbp = sense_buffer; -- io_hdr.timeout = 2000; /* TimeOut = 2 seconds */ -+ io_hdr.timeout = get_prio_timeout(2000); /* TimeOut = 2 seconds */ - - if (ioctl (fd, SG_IO, &io_hdr) < 0) { - pp_hds_log(0, "SG_IO error"); -Index: multipath-tools-130222/libmultipath/prioritizers/hp_sw.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/hp_sw.c -+++ multipath-tools-130222/libmultipath/prioritizers/hp_sw.c -@@ -46,7 +46,7 @@ int hp_sw_prio(const char *dev, int fd) - io_hdr.dxfer_direction = SG_DXFER_NONE; - io_hdr.cmdp = turCmdBlk; - io_hdr.sbp = sb; -- io_hdr.timeout = 60000; -+ io_hdr.timeout = get_prio_timeout(60000); - io_hdr.pack_id = 0; - retry: - if (ioctl(fd, SG_IO, &io_hdr) < 0) { -Index: multipath-tools-130222/libmultipath/prioritizers/ontap.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/ontap.c -+++ multipath-tools-130222/libmultipath/prioritizers/ontap.c -@@ -89,7 +89,7 @@ static int send_gva(const char *dev, int - io_hdr.dxferp = results; - io_hdr.cmdp = cdb; - io_hdr.sbp = sb; -- io_hdr.timeout = SG_TIMEOUT; -+ io_hdr.timeout = get_prio_timeout(SG_TIMEOUT); - io_hdr.pack_id = 0; - if (ioctl(fd, SG_IO, &io_hdr) < 0) { - pp_ontap_log(0, "SG_IO ioctl failed, errno=%d", errno); -@@ -141,7 +141,7 @@ static int get_proxy(const char *dev, in - io_hdr.dxferp = results; - io_hdr.cmdp = cdb; - io_hdr.sbp = sb; -- io_hdr.timeout = SG_TIMEOUT; -+ io_hdr.timeout = get_prio_timeout(SG_TIMEOUT); - io_hdr.pack_id = 0; - if (ioctl(fd, SG_IO, &io_hdr) < 0) { - pp_ontap_log(0, "ioctl sending inquiry command failed, " -Index: multipath-tools-130222/libmultipath/prioritizers/rdac.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/rdac.c -+++ multipath-tools-130222/libmultipath/prioritizers/rdac.c -@@ -31,7 +31,7 @@ int rdac_prio(const char *dev, int fd) - io_hdr.dxferp = sense_buffer; - io_hdr.cmdp = inqCmdBlk; - io_hdr.sbp = sb; -- io_hdr.timeout = 60000; -+ io_hdr.timeout = get_prio_timeout(60000); - io_hdr.pack_id = 0; - if (ioctl(fd, SG_IO, &io_hdr) < 0) { - pp_rdac_log(0, "sending inquiry command failed"); -Index: multipath-tools-130222/multipath.conf.annotated -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.annotated -+++ multipath-tools-130222/multipath.conf.annotated -@@ -188,8 +188,9 @@ - # # - # # name : checker_timeout - # # scope : multipath & multipathd --# # desc : The timeout to use for path checkers that issue scsi --# # commands with an explicit timeout, in seconds. -+# # desc : The timeout to use for path checkers and prioritizers -+# # that issue scsi commands with an explicit timeout, in -+# # seconds. - # # values : n > 0 - # # default : taken from /sys/block/sd/device/timeout - # checker_timeout 60 -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -321,8 +321,8 @@ maximum number of open fds is taken from - if that number is greated than 1024. - .TP - .B checker_timeout --Specify the timeout to user for path checkers that issue scsi commands with an --explicit timeout, in seconds; default taken from -+Specify the timeout to use for path checkers and prioritizers that issue scsi -+commands with an explicit timeout, in seconds; default taken from - .I /sys/block/sd/device/timeout - .TP - .B fast_io_fail_tmo diff --git a/0089-RHBZ-1110016-add-noasync-option.patch b/0089-RHBZ-1110016-add-noasync-option.patch deleted file mode 100644 index 2651c0e..0000000 --- a/0089-RHBZ-1110016-add-noasync-option.patch +++ /dev/null @@ -1,158 +0,0 @@ ---- - libmultipath/config.c | 1 + - libmultipath/config.h | 1 + - libmultipath/dict.c | 33 +++++++++++++++++++++++++++++++++ - libmultipath/discovery.c | 8 ++++++-- - multipath.conf.annotated | 10 ++++++++++ - multipath/multipath.conf.5 | 9 +++++++++ - 6 files changed, 60 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -556,6 +556,7 @@ load_config (char * file, struct udev *u - conf->retain_hwhandler = DEFAULT_RETAIN_HWHANDLER; - conf->detect_prio = DEFAULT_DETECT_PRIO; - conf->hw_strmatch = 0; -+ conf->force_sync = 0; - - /* - * preload default hwtable -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -115,6 +115,7 @@ struct config { - int reassign_maps; - int retain_hwhandler; - int detect_prio; -+ int force_sync; - unsigned int version[3]; - - char * dev; -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -712,6 +712,29 @@ def_hw_strmatch_handler(vector strvec) - return 0; - } - -+static int -+def_force_sync_handler(vector strvec) -+{ -+ char * buff; -+ -+ buff = set_value(strvec); -+ -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ conf->force_sync = 0; -+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) || -+ (strlen(buff) == 1 && !strcmp(buff, "1"))) -+ conf->force_sync = 1; -+ else -+ conf->force_sync = 0; -+ -+ FREE(buff); -+ return 0; -+} -+ - /* - * blacklist block handlers - */ -@@ -2822,6 +2845,15 @@ snprint_def_hw_strmatch(char * buff, int - } - - static int -+snprint_def_force_sync(char * buff, int len, void * data) -+{ -+ if (conf->force_sync) -+ return snprintf(buff, len, "yes"); -+ else -+ return snprintf(buff, len, "no"); -+} -+ -+static int - snprint_ble_simple (char * buff, int len, void * data) - { - struct blentry * ble = (struct blentry *)data; -@@ -2889,6 +2921,7 @@ init_keywords(void) - install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler_handler); - install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio); - install_keyword("hw_str_match", &def_hw_strmatch_handler, &snprint_def_hw_strmatch); -+ install_keyword("force_sync", &def_force_sync_handler, &snprint_def_force_sync); - __deprecated install_keyword("default_selector", &def_selector_handler, NULL); - __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); - __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL); -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -952,8 +952,12 @@ get_state (struct path * pp, int daemon) - } - } - checker_clear_message(c); -- if (daemon) -- checker_set_async(c); -+ if (daemon) { -+ if (conf->force_sync == 0) -+ checker_set_async(c); -+ else -+ checker_set_sync(c); -+ } - if (!conf->checker_timeout && - (pp->bus != SYSFS_BUS_SCSI || - sysfs_get_timeout(pp, &(c->timeout)))) -Index: multipath-tools-130222/multipath.conf.annotated -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.annotated -+++ multipath-tools-130222/multipath.conf.annotated -@@ -214,6 +214,8 @@ - # # values : n > 0 - # # default : determined by the OS - # dev_loss_tmo 600 -+# -+# # - # # name : bindings_file - # # scope : multipath - # # desc : The location of the bindings file that is used with -@@ -222,6 +224,14 @@ - # # default : "/var/lib/multipath/bindings" - # bindings_file "/etc/multipath_bindings" - # -+# # -+# # name : force_sync -+# # scope : multipathd -+# # desc : If set to yes, multipath will run all of the checkers in -+# # sync mode, even if the checker has an async mode. -+# # values : yes|no -+# # default : no -+# force_sync yes - #} - # - ## -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -411,6 +411,15 @@ modify an existing config, or create a n - , the user device configs will be regular expression matched against the - built-in configs instead. Default is - .I no -+.TP -+.B force_sync -+If set to -+.I yes -+, multipathd will call the path checkers in sync mode only. This means that -+only one checker will run at a time. This is useful in the case where many -+multipathd checkers running in parallel causes significant CPU pressure. The -+Default is -+.I no - . - .SH "blacklist section" - The diff --git a/0090-UPBZ-1080038-reorder-paths-for-round-robin.patch b/0090-UPBZ-1080038-reorder-paths-for-round-robin.patch deleted file mode 100644 index 44f8407..0000000 --- a/0090-UPBZ-1080038-reorder-paths-for-round-robin.patch +++ /dev/null @@ -1,529 +0,0 @@ ---- - libmultipath/configure.c | 229 +++++++++++++++++++++++++++++++++++++++++++++++ - libmultipath/configure.h | 2 - libmultipath/discovery.c | 87 +++++++++++++++++ - libmultipath/discovery.h | 2 - libmultipath/structs.c | 84 +++++++++++++++++ - libmultipath/structs.h | 25 ++++- - 6 files changed, 427 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -39,6 +39,219 @@ - #include "uxsock.h" - #include "wwids.h" - -+/* group paths in pg by host adapter -+ */ -+int group_by_host_adapter(struct pathgroup *pgp, vector adapters) -+{ -+ struct adapter_group *agp; -+ struct host_group *hgp; -+ struct path *pp, *pp1; -+ char adapter_name1[SLOT_NAME_SIZE]; -+ char adapter_name2[SLOT_NAME_SIZE]; -+ int i, j; -+ int found_hostgroup = 0; -+ -+ while (VECTOR_SIZE(pgp->paths) > 0) { -+ -+ pp = VECTOR_SLOT(pgp->paths, 0); -+ -+ if (sysfs_get_host_adapter_name(pp, adapter_name1)) -+ goto out; -+ /* create a new host adapter group -+ */ -+ agp = alloc_adaptergroup(); -+ if (!agp) -+ goto out; -+ agp->pgp = pgp; -+ -+ strncpy(agp->adapter_name, adapter_name1, SLOT_NAME_SIZE); -+ store_adaptergroup(adapters, agp); -+ -+ /* create a new host port group -+ */ -+ hgp = alloc_hostgroup(); -+ if (!hgp) -+ goto out; -+ if (store_hostgroup(agp->host_groups, hgp)) -+ goto out; -+ -+ hgp->host_no = pp->sg_id.host_no; -+ agp->num_hosts++; -+ if (store_path(hgp->paths, pp)) -+ goto out; -+ -+ hgp->num_paths++; -+ /* delete path from path group -+ */ -+ vector_del_slot(pgp->paths, 0); -+ -+ /* add all paths belonging to same host adapter -+ */ -+ vector_foreach_slot(pgp->paths, pp1, i) { -+ if (sysfs_get_host_adapter_name(pp1, adapter_name2)) -+ goto out; -+ if (strcmp(adapter_name1, adapter_name2) == 0) { -+ found_hostgroup = 0; -+ vector_foreach_slot(agp->host_groups, hgp, j) { -+ if (hgp->host_no == pp1->sg_id.host_no) { -+ if (store_path(hgp->paths, pp1)) -+ goto out; -+ hgp->num_paths++; -+ found_hostgroup = 1; -+ break; -+ } -+ } -+ if (!found_hostgroup) { -+ /* this path belongs to new host port -+ * within this adapter -+ */ -+ hgp = alloc_hostgroup(); -+ if (!hgp) -+ goto out; -+ -+ if (store_hostgroup(agp->host_groups, hgp)) -+ goto out; -+ -+ agp->num_hosts++; -+ if (store_path(hgp->paths, pp1)) -+ goto out; -+ -+ hgp->host_no = pp1->sg_id.host_no; -+ hgp->num_paths++; -+ } -+ /* delete paths from original path_group -+ * as they are added into adapter group now -+ */ -+ vector_del_slot(pgp->paths, i); -+ i--; -+ } -+ } -+ } -+ return 0; -+ -+out: /* add back paths into pg as re-ordering failed -+ */ -+ vector_foreach_slot(adapters, agp, i) { -+ vector_foreach_slot(agp->host_groups, hgp, j) { -+ while (VECTOR_SIZE(hgp->paths) > 0) { -+ pp = VECTOR_SLOT(hgp->paths, 0); -+ if (store_path(pgp->paths, pp)) -+ condlog(3, "failed to restore " -+ "path %s into path group", -+ pp->dev); -+ vector_del_slot(hgp->paths, 0); -+ } -+ } -+ } -+ free_adaptergroup(adapters); -+ return 1; -+} -+ -+/* re-order paths in pg by alternating adapters and host ports -+ * for optimized selection -+ */ -+int order_paths_in_pg_by_alt_adapters(struct pathgroup *pgp, vector adapters, -+ int total_paths) -+{ -+ int next_adapter_index = 0; -+ struct adapter_group *agp; -+ struct host_group *hgp; -+ struct path *pp; -+ -+ while (total_paths > 0) { -+ agp = VECTOR_SLOT(adapters, next_adapter_index); -+ if (!agp) { -+ condlog(0, "can't get adapter group %d", next_adapter_index); -+ return 1; -+ } -+ -+ hgp = VECTOR_SLOT(agp->host_groups, agp->next_host_index); -+ if (!hgp) { -+ condlog(0, "can't get host group %d of adapter group %d", next_adapter_index, agp->next_host_index); -+ return 1; -+ } -+ -+ if (!hgp->num_paths) { -+ agp->next_host_index++; -+ agp->next_host_index %= agp->num_hosts; -+ next_adapter_index++; -+ next_adapter_index %= VECTOR_SIZE(adapters); -+ continue; -+ } -+ -+ pp = VECTOR_SLOT(hgp->paths, 0); -+ -+ if (store_path(pgp->paths, pp)) -+ return 1; -+ -+ total_paths--; -+ -+ vector_del_slot(hgp->paths, 0); -+ -+ hgp->num_paths--; -+ -+ agp->next_host_index++; -+ agp->next_host_index %= agp->num_hosts; -+ next_adapter_index++; -+ next_adapter_index %= VECTOR_SIZE(adapters); -+ } -+ -+ /* all paths are added into path_group -+ * in crafted child order -+ */ -+ return 0; -+} -+ -+/* round-robin: order paths in path group to alternate -+ * between all host adapters -+ */ -+int rr_optimize_path_order(struct pathgroup *pgp) -+{ -+ vector adapters; -+ struct path *pp; -+ int total_paths; -+ int i; -+ -+ total_paths = VECTOR_SIZE(pgp->paths); -+ vector_foreach_slot(pgp->paths, pp, i) { -+ if (pp->sg_id.proto_id != SCSI_PROTOCOL_FCP && -+ pp->sg_id.proto_id != SCSI_PROTOCOL_SAS && -+ pp->sg_id.proto_id != SCSI_PROTOCOL_ISCSI && -+ pp->sg_id.proto_id != SCSI_PROTOCOL_SRP) { -+ /* return success as default path order -+ * is maintained in path group -+ */ -+ return 0; -+ } -+ } -+ adapters = vector_alloc(); -+ if (!adapters) -+ return 0; -+ -+ /* group paths in path group by host adapters -+ */ -+ if (group_by_host_adapter(pgp, adapters)) { -+ /* already freed adapters */ -+ condlog(3, "Failed to group paths by adapters"); -+ return 0; -+ } -+ -+ /* re-order paths in pg to alternate between adapters and host ports -+ */ -+ if (order_paths_in_pg_by_alt_adapters(pgp, adapters, total_paths)) { -+ condlog(3, "Failed to re-order paths in pg by adapters " -+ "and host ports"); -+ free_adaptergroup(adapters); -+ /* return failure as original paths are -+ * removed form pgp -+ */ -+ return 1; -+ } -+ -+ free_adaptergroup(adapters); -+ return 0; -+} -+ - extern int - setup_map (struct multipath * mpp, char * params, int params_size) - { -@@ -101,6 +314,22 @@ setup_map (struct multipath * mpp, char - */ - mpp->bestpg = select_path_group(mpp); - -+ /* re-order paths in all path groups in an optimized way -+ * for round-robin path selectors to get maximum throughput. -+ */ -+ if (!strncmp(mpp->selector, "round-robin", 11)) { -+ vector_foreach_slot(mpp->pg, pgp, i) { -+ if (VECTOR_SIZE(pgp->paths) <= 2) -+ continue; -+ if (rr_optimize_path_order(pgp)) { -+ condlog(2, "cannot re-order paths for " -+ "optimization: %s", -+ mpp->alias); -+ return 1; -+ } -+ } -+ } -+ - /* - * transform the mp->pg vector of vectors of paths - * into a mp->params strings to feed the device-mapper -Index: multipath-tools-130222/libmultipath/configure.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.h -+++ multipath-tools-130222/libmultipath/configure.h -@@ -29,4 +29,4 @@ int reinstate_paths (struct multipath *m - int coalesce_paths (struct vectors *vecs, vector curmp, char * refwwid, int force_reload); - int get_refwwid (char * dev, enum devtypes dev_type, vector pathvec, char **wwid); - int reload_map(struct vectors *vecs, struct multipath *mpp, int refresh); -- -+int sysfs_get_host_adapter_name(struct path *pp, char *adapter_name); -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -310,6 +310,93 @@ sysfs_get_tgt_nodename (struct path *pp, - return 1; - } - -+int sysfs_get_host_adapter_name(struct path *pp, char *adapter_name) -+{ -+ int proto_id; -+ -+ if (!pp || !adapter_name) -+ return 1; -+ -+ proto_id = pp->sg_id.proto_id; -+ -+ if (proto_id != SCSI_PROTOCOL_FCP && -+ proto_id != SCSI_PROTOCOL_SAS && -+ proto_id != SCSI_PROTOCOL_ISCSI && -+ proto_id != SCSI_PROTOCOL_SRP) { -+ return 1; -+ } -+ /* iscsi doesn't have adapter info in sysfs -+ * get ip_address for grouping paths -+ */ -+ if (pp->sg_id.proto_id == SCSI_PROTOCOL_ISCSI) -+ return sysfs_get_iscsi_ip_address(pp, adapter_name); -+ -+ /* fetch adapter pci name for other protocols -+ */ -+ return sysfs_get_host_pci_name(pp, adapter_name); -+} -+ -+int sysfs_get_host_pci_name(struct path *pp, char *pci_name) -+{ -+ struct udev_device *hostdev, *parent; -+ char host_name[HOST_NAME_LEN]; -+ const char *driver_name, *value; -+ -+ if (!pp || !pci_name) -+ return 1; -+ -+ sprintf(host_name, "host%d", pp->sg_id.host_no); -+ hostdev = udev_device_new_from_subsystem_sysname(conf->udev, -+ "scsi_host", host_name); -+ if (!hostdev) -+ return 1; -+ -+ parent = udev_device_get_parent(hostdev); -+ while (parent) { -+ driver_name = udev_device_get_driver(parent); -+ if (!driver_name) { -+ parent = udev_device_get_parent(parent); -+ continue; -+ } -+ if (!strcmp(driver_name, "pcieport")) -+ break; -+ parent = udev_device_get_parent(parent); -+ } -+ if (parent) { -+ /* pci_device found -+ */ -+ value = udev_device_get_sysname(parent); -+ -+ strncpy(pci_name, value, SLOT_NAME_SIZE); -+ udev_device_unref(hostdev); -+ return 0; -+ } -+ udev_device_unref(hostdev); -+ return 1; -+} -+ -+int sysfs_get_iscsi_ip_address(struct path *pp, char *ip_address) -+{ -+ struct udev_device *hostdev; -+ char host_name[HOST_NAME_LEN]; -+ const char *value; -+ -+ sprintf(host_name, "host%d", pp->sg_id.host_no); -+ hostdev = udev_device_new_from_subsystem_sysname(conf->udev, -+ "iscsi_host", host_name); -+ if (hostdev) { -+ value = udev_device_get_sysattr_value(hostdev, -+ "ipaddress"); -+ if (value) { -+ strncpy(ip_address, value, SLOT_NAME_SIZE); -+ udev_device_unref(hostdev); -+ return 0; -+ } else -+ udev_device_unref(hostdev); -+ } -+ return 1; -+} -+ - static void - sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp) - { -Index: multipath-tools-130222/libmultipath/discovery.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.h -+++ multipath-tools-130222/libmultipath/discovery.h -@@ -38,6 +38,8 @@ int store_pathinfo (vector pathvec, vect - struct path **pp_ptr); - int sysfs_set_scsi_tmo (struct multipath *mpp); - int sysfs_get_timeout(struct path *pp, unsigned int *timeout); -+int sysfs_get_host_pci_name(struct path *pp, char *pci_name); -+int sysfs_get_iscsi_ip_address(struct path *pp, char *ip_address); - - /* - * discovery bitmask -Index: multipath-tools-130222/libmultipath/structs.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.c -+++ multipath-tools-130222/libmultipath/structs.c -@@ -18,6 +18,70 @@ - #include "blacklist.h" - #include "prio.h" - -+struct adapter_group * -+alloc_adaptergroup(void) -+{ -+ struct adapter_group *agp; -+ -+ agp = (struct adapter_group *)MALLOC(sizeof(struct adapter_group)); -+ -+ if (!agp) -+ return NULL; -+ -+ agp->host_groups = vector_alloc(); -+ if (!agp->host_groups) { -+ FREE(agp); -+ agp = NULL; -+ } -+ return agp; -+} -+ -+void free_adaptergroup(vector adapters) -+{ -+ int i; -+ struct adapter_group *agp; -+ -+ vector_foreach_slot(adapters, agp, i) { -+ free_hostgroup(agp->host_groups); -+ FREE(agp); -+ } -+ vector_free(adapters); -+} -+ -+void free_hostgroup(vector hostgroups) -+{ -+ int i; -+ struct host_group *hgp; -+ -+ if (!hostgroups) -+ return; -+ -+ vector_foreach_slot(hostgroups, hgp, i) { -+ vector_free(hgp->paths); -+ FREE(hgp); -+ } -+ vector_free(hostgroups); -+} -+ -+struct host_group * -+alloc_hostgroup(void) -+{ -+ struct host_group *hgp; -+ -+ hgp = (struct host_group *)MALLOC(sizeof(struct host_group)); -+ -+ if (!hgp) -+ return NULL; -+ -+ hgp->paths = vector_alloc(); -+ -+ if (!hgp->paths) { -+ FREE(hgp); -+ hgp = NULL; -+ } -+ return hgp; -+} -+ - struct path * - alloc_path (void) - { -@@ -242,6 +306,26 @@ store_pathgroup (vector pgvec, struct pa - return 0; - } - -+int -+store_hostgroup(vector hostgroupvec, struct host_group * hgp) -+{ -+ if (!vector_alloc_slot(hostgroupvec)) -+ return 1; -+ -+ vector_set_slot(hostgroupvec, hgp); -+ return 0; -+} -+ -+int -+store_adaptergroup(vector adapters, struct adapter_group * agp) -+{ -+ if (!vector_alloc_slot(adapters)) -+ return 1; -+ -+ vector_set_slot(adapters, agp); -+ return 0; -+} -+ - struct multipath * - find_mp_by_minor (vector mpvec, int minor) - { -Index: multipath-tools-130222/libmultipath/structs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.h -+++ multipath-tools-130222/libmultipath/structs.h -@@ -15,7 +15,8 @@ - #define BLK_DEV_SIZE 33 - #define PATH_SIZE 512 - #define NAME_SIZE 512 -- -+#define HOST_NAME_LEN 8 -+#define SLOT_NAME_SIZE 40 - - #define SCSI_VENDOR_SIZE 9 - #define SCSI_PRODUCT_SIZE 17 -@@ -251,6 +252,20 @@ struct pathgroup { - char * selector; - }; - -+struct adapter_group { -+ char adapter_name[SLOT_NAME_SIZE]; -+ struct pathgroup *pgp; -+ int num_hosts; -+ vector host_groups; -+ int next_host_index; -+}; -+ -+struct host_group { -+ int host_no; -+ int num_paths; -+ vector paths; -+}; -+ - struct path * alloc_path (void); - struct pathgroup * alloc_pathgroup (void); - struct multipath * alloc_multipath (void); -@@ -263,6 +278,14 @@ void free_multipath_attributes (struct m - void drop_multipath (vector mpvec, char * wwid, enum free_path_mode free_paths); - void free_multipathvec (vector mpvec, enum free_path_mode free_paths); - -+struct adapter_group * alloc_adaptergroup(void); -+struct host_group * alloc_hostgroup(void); -+void free_adaptergroup(vector adapters); -+void free_hostgroup(vector hostgroups); -+ -+int store_adaptergroup(vector adapters, struct adapter_group *agp); -+int store_hostgroup(vector hostgroupvec, struct host_group *hgp); -+ - int store_path (vector pathvec, struct path * pp); - int store_pathgroup (vector pgvec, struct pathgroup * pgp); - diff --git a/0091-RHBZ-1069584-fix-empty-values-fast-io-fail-and-dev-loss.patch b/0091-RHBZ-1069584-fix-empty-values-fast-io-fail-and-dev-loss.patch deleted file mode 100644 index d164de1..0000000 --- a/0091-RHBZ-1069584-fix-empty-values-fast-io-fail-and-dev-loss.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- - libmultipath/dict.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -43,6 +43,9 @@ def_fast_io_fail_handler(vector strvec) - char * buff; - - buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ - if (strlen(buff) == 3 && !strcmp(buff, "off")) - conf->fast_io_fail = MP_FAST_IO_FAIL_OFF; - else if (sscanf(buff, "%d", &conf->fast_io_fail) != 1 || -@@ -1002,6 +1005,9 @@ hw_dev_loss_handler(vector strvec) - char * buff; - struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable); - -+ if (!hwe) -+ return 1; -+ - buff = set_value(strvec); - if (!buff) - return 1; -@@ -1021,6 +1027,9 @@ hw_pgpolicy_handler(vector strvec) - char * buff; - struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable); - -+ if (!hwe) -+ return 1; -+ - buff = set_value(strvec); - - if (!buff) diff --git a/0092-UPBZ-1104605-reload-on-rename.patch b/0092-UPBZ-1104605-reload-on-rename.patch deleted file mode 100644 index 465257c..0000000 --- a/0092-UPBZ-1104605-reload-on-rename.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- - libmultipath/configure.c | 11 +++++++++++ - libmultipath/configure.h | 1 + - libmultipath/devmapper.c | 3 +-- - 3 files changed, 13 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -394,6 +394,8 @@ select_action (struct multipath * mpp, v - cmpp->alias, mpp->alias); - strncpy(mpp->alias_old, cmpp->alias, WWID_SIZE); - mpp->action = ACT_RENAME; -+ if (force_reload) -+ mpp->action = ACT_RENAME2; - return; - } - mpp->action = ACT_CREATE; -@@ -632,6 +634,15 @@ domap (struct multipath * mpp, char * pa - r = dm_rename(mpp->alias_old, mpp->alias); - break; - -+ case ACT_RENAME2: -+ r = dm_rename(mpp->alias_old, mpp->alias); -+ if (r) { -+ r = dm_addmap_reload(mpp, params); -+ if (r) -+ r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, MPATH_UDEV_RELOAD_FLAG); -+ } -+ break; -+ - default: - break; - } -Index: multipath-tools-130222/libmultipath/configure.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.h -+++ multipath-tools-130222/libmultipath/configure.h -@@ -18,6 +18,7 @@ enum actions { - ACT_RENAME, - ACT_CREATE, - ACT_RESIZE, -+ ACT_RENAME2, - }; - - #define FLUSH_ONE 1 -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -565,10 +565,9 @@ dm_dev_t (const char * mapname, char * d - if (!dm_task_run(dmt)) - goto out; - -- if (!dm_task_get_info(dmt, &info)) -+ if (!dm_task_get_info(dmt, &info) || !info.exists) - goto out; - -- r = info.open_count; - if (snprintf(dev_t, len, "%i:%i", info.major, info.minor) > len) - goto out; - diff --git a/0093-UPBZ-1086825-user-friendly-name-remap.patch b/0093-UPBZ-1086825-user-friendly-name-remap.patch deleted file mode 100644 index ab5abbd..0000000 --- a/0093-UPBZ-1086825-user-friendly-name-remap.patch +++ /dev/null @@ -1,199 +0,0 @@ ---- - libmultipath/alias.c | 64 ++++++++++++++++++++++++++++++++++++++++++--- - libmultipath/alias.h | 2 + - libmultipath/propsel.c | 32 +++++++++++++++------- - libmultipath/structs_vec.c | 15 ++++++++++ - 4 files changed, 100 insertions(+), 13 deletions(-) - -Index: multipath-tools-130222/libmultipath/alias.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/alias.c -+++ multipath-tools-130222/libmultipath/alias.c -@@ -145,7 +145,7 @@ lookup_binding(FILE *f, char *map_wwid, - } - - static int --rlookup_binding(FILE *f, char *buff, char *map_alias) -+rlookup_binding(FILE *f, char *buff, char *map_alias, char *prefix) - { - char line[LINE_MAX]; - unsigned int line_nr = 0; -@@ -164,7 +164,7 @@ rlookup_binding(FILE *f, char *buff, cha - alias = strtok(line, " \t"); - if (!alias) /* blank line */ - continue; -- curr_id = scan_devname(alias, NULL); /* TBD: Why this call? */ -+ curr_id = scan_devname(alias, prefix); - if (curr_id >= id) - id = curr_id + 1; - wwid = strtok(NULL, " \t"); -@@ -188,6 +188,11 @@ rlookup_binding(FILE *f, char *buff, cha - } - } - condlog(3, "No matching alias [%s] in bindings file.", map_alias); -+ -+ /* Get the theoretical id for this map alias. -+ * Used by use_existing_alias -+ */ -+ id = scan_devname(map_alias, prefix); - return id; - } - -@@ -237,6 +242,59 @@ allocate_binding(int fd, char *wwid, int - } - - char * -+use_existing_alias (char *wwid, char *file, char *alias_old, -+ char *prefix, int bindings_read_only) -+{ -+ char *alias = NULL; -+ int id = 0; -+ int fd, can_write; -+ char buff[WWID_SIZE]; -+ FILE *f; -+ -+ fd = open_file(file, &can_write, BINDINGS_FILE_HEADER); -+ if (fd < 0) -+ return NULL; -+ -+ f = fdopen(fd, "r"); -+ if (!f) { -+ condlog(0, "cannot fdopen on bindings file descriptor"); -+ close(fd); -+ return NULL; -+ } -+ /* lookup the binding. if it exsists, the wwid will be in buff -+ * either way, id contains the id for the alias -+ */ -+ id = rlookup_binding(f , buff, alias_old, prefix); -+ if (id < 0) -+ goto out; -+ -+ if (strlen(buff) > 0) { -+ /* if buff is our wwid, it's already -+ * allocated correctly -+ */ -+ if (strcmp(buff, wwid) == 0) -+ alias = STRDUP(alias_old); -+ else { -+ alias = NULL; -+ condlog(0, "alias %s already bound to wwid %s, cannot reuse", -+ alias_old, buff); -+ } -+ goto out; -+ } -+ -+ /* allocate the existing alias in the bindings file */ -+ if (can_write && id && !bindings_read_only) { -+ alias = allocate_binding(fd, wwid, id, prefix); -+ condlog(0, "Allocated existing binding [%s] for WWID [%s]", -+ alias, wwid); -+ } -+ -+out: -+ fclose(f); -+ return alias; -+} -+ -+char * - get_user_friendly_alias(char *wwid, char *file, char *prefix, - int bindings_read_only) - { -@@ -305,7 +363,7 @@ get_user_friendly_wwid(char *alias, char - return -1; - } - -- rlookup_binding(f, buff, alias); -+ rlookup_binding(f, buff, alias, NULL); - if (!strlen(buff)) { - fclose(f); - return -1; -Index: multipath-tools-130222/libmultipath/alias.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/alias.h -+++ multipath-tools-130222/libmultipath/alias.h -@@ -10,3 +10,5 @@ - char *get_user_friendly_alias(char *wwid, char *file, char *prefix, - int bindings_readonly); - int get_user_friendly_wwid(char *alias, char *buff, char *file); -+char *use_existing_alias (char *wwid, char *file, char *alias_old, -+ char *prefix, int bindings_read_only); -Index: multipath-tools-130222/libmultipath/propsel.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.c -+++ multipath-tools-130222/libmultipath/propsel.c -@@ -253,19 +253,31 @@ want_user_friendly_names(struct multipat - extern int - select_alias (struct multipath * mp) - { -- if (mp->mpe && mp->mpe->alias) -+ if (mp->mpe && mp->mpe->alias) { - mp->alias = STRDUP(mp->mpe->alias); -- else { -- mp->alias = NULL; -- if (want_user_friendly_names(mp)) { -- select_alias_prefix(mp); -- mp->alias = get_user_friendly_alias(mp->wwid, -- conf->bindings_file, mp->alias_prefix, conf->bindings_read_only); -- } -- if (mp->alias == NULL) -- mp->alias = STRDUP(mp->wwid); -+ goto out; - } - -+ mp->alias = NULL; -+ if (!want_user_friendly_names(mp)) -+ goto out; -+ -+ select_alias_prefix(mp); -+ -+ if (strlen(mp->alias_old) > 0) { -+ mp->alias = use_existing_alias(mp->wwid, conf->bindings_file, -+ mp->alias_old, mp->alias_prefix, -+ conf->bindings_read_only); -+ memset (mp->alias_old, 0, WWID_SIZE); -+ } -+ -+ if (mp->alias == NULL) -+ mp->alias = get_user_friendly_alias(mp->wwid, -+ conf->bindings_file, mp->alias_prefix, conf->bindings_read_only); -+out: -+ if (mp->alias == NULL) -+ mp->alias = STRDUP(mp->wwid); -+ - return mp->alias ? 0 : 1; - } - -Index: multipath-tools-130222/libmultipath/structs_vec.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs_vec.c -+++ multipath-tools-130222/libmultipath/structs_vec.c -@@ -430,6 +430,20 @@ out: - return NULL; - } - -+static void -+find_existing_alias (struct multipath * mpp, -+ struct vectors *vecs) -+{ -+ struct multipath * mp; -+ int i; -+ -+ vector_foreach_slot (vecs->mpvec, mp, i) -+ if (strcmp(mp->wwid, mpp->wwid) == 0) { -+ strncpy(mpp->alias_old, mp->alias, WWID_SIZE); -+ return; -+ } -+} -+ - extern struct multipath * - add_map_with_path (struct vectors * vecs, - struct path * pp, int add_vec) -@@ -443,6 +457,7 @@ add_map_with_path (struct vectors * vecs - mpp->hwe = pp->hwe; - - strcpy(mpp->wwid, pp->wwid); -+ find_existing_alias(mpp, vecs); - if (select_alias(mpp)) - goto out; - mpp->size = pp->size; diff --git a/0094-RHBZ-1086825-cleanup-remap.patch b/0094-RHBZ-1086825-cleanup-remap.patch deleted file mode 100644 index 7d85c2d..0000000 --- a/0094-RHBZ-1086825-cleanup-remap.patch +++ /dev/null @@ -1,107 +0,0 @@ ---- - libmultipath/alias.c | 31 +++++++++++++++---------------- - libmultipath/propsel.c | 4 ++-- - 2 files changed, 17 insertions(+), 18 deletions(-) - -Index: multipath-tools-130222/libmultipath/alias.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/alias.c -+++ multipath-tools-130222/libmultipath/alias.c -@@ -149,13 +149,11 @@ rlookup_binding(FILE *f, char *buff, cha - { - char line[LINE_MAX]; - unsigned int line_nr = 0; -- int id = 0; - - buff[0] = '\0'; - - while (fgets(line, LINE_MAX, f)) { - char *c, *alias, *wwid; -- int curr_id; - - line_nr++; - c = strpbrk(line, "#\n\r"); -@@ -164,9 +162,6 @@ rlookup_binding(FILE *f, char *buff, cha - alias = strtok(line, " \t"); - if (!alias) /* blank line */ - continue; -- curr_id = scan_devname(alias, prefix); -- if (curr_id >= id) -- id = curr_id + 1; - wwid = strtok(NULL, " \t"); - if (!wwid){ - condlog(3, -@@ -184,16 +179,12 @@ rlookup_binding(FILE *f, char *buff, cha - "\nSetting wwid to %s", alias, wwid); - strncpy(buff, wwid, WWID_SIZE); - buff[WWID_SIZE - 1] = '\0'; -- return id; -+ return 0; - } - } - condlog(3, "No matching alias [%s] in bindings file.", map_alias); - -- /* Get the theoretical id for this map alias. -- * Used by use_existing_alias -- */ -- id = scan_devname(map_alias, prefix); -- return id; -+ return -1; - } - - static char * -@@ -264,9 +255,7 @@ use_existing_alias (char *wwid, char *fi - /* lookup the binding. if it exsists, the wwid will be in buff - * either way, id contains the id for the alias - */ -- id = rlookup_binding(f , buff, alias_old, prefix); -- if (id < 0) -- goto out; -+ rlookup_binding(f, buff, alias_old, prefix); - - if (strlen(buff) > 0) { - /* if buff is our wwid, it's already -@@ -279,11 +268,21 @@ use_existing_alias (char *wwid, char *fi - condlog(0, "alias %s already bound to wwid %s, cannot reuse", - alias_old, buff); - } -- goto out; -+ goto out; - } - - /* allocate the existing alias in the bindings file */ -- if (can_write && id && !bindings_read_only) { -+ id = scan_devname(alias_old, prefix); -+ if (id <= 0) -+ goto out; -+ -+ if (fflush(f) != 0) { -+ condlog(0, "cannot fflush bindings file stream : %s", -+ strerror(errno)); -+ goto out; -+ } -+ -+ if (can_write && !bindings_read_only) { - alias = allocate_binding(fd, wwid, id, prefix); - condlog(0, "Allocated existing binding [%s] for WWID [%s]", - alias, wwid); -Index: multipath-tools-130222/libmultipath/propsel.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.c -+++ multipath-tools-130222/libmultipath/propsel.c -@@ -263,13 +263,13 @@ select_alias (struct multipath * mp) - goto out; - - select_alias_prefix(mp); -- -+ - if (strlen(mp->alias_old) > 0) { - mp->alias = use_existing_alias(mp->wwid, conf->bindings_file, - mp->alias_old, mp->alias_prefix, - conf->bindings_read_only); - memset (mp->alias_old, 0, WWID_SIZE); -- } -+ } - - if (mp->alias == NULL) - mp->alias = get_user_friendly_alias(mp->wwid, diff --git a/0095-RHBZ-1127944-xtremIO-config.patch b/0095-RHBZ-1127944-xtremIO-config.patch deleted file mode 100644 index 6807cbc..0000000 --- a/0095-RHBZ-1127944-xtremIO-config.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- - libmultipath/hwtable.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -Index: multipath-tools-130222/libmultipath/hwtable.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/hwtable.c -+++ multipath-tools-130222/libmultipath/hwtable.c -@@ -1121,6 +1121,19 @@ static struct hwentry default_hw[] = { - .prio_name = PRIO_ALUA, - .prio_args = NULL, - }, -+ { -+ .vendor = "XtremIO", -+ .product = "XtremApp", -+ .features = DEFAULT_FEATURES, -+ .hwhandler = DEFAULT_HWHANDLER, -+ .selector = "queue-length 0", -+ .pgpolicy = MULTIBUS, -+ .pgfailback = -FAILBACK_IMMEDIATE, -+ .checker_name = DIRECTIO, -+ .fast_io_fail = 15, -+ .prio_name = DEFAULT_PRIO, -+ .prio_args = NULL, -+ }, - /* - * EOL - */ diff --git a/0096-RHBZ-979474-new-wildcards.patch b/0096-RHBZ-979474-new-wildcards.patch deleted file mode 100644 index 9025efe..0000000 --- a/0096-RHBZ-979474-new-wildcards.patch +++ /dev/null @@ -1,120 +0,0 @@ ---- - libmultipath/print.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 83 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/print.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.c -+++ multipath-tools-130222/libmultipath/print.c -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - - #include "checkers.h" - #include "vector.h" -@@ -44,7 +45,7 @@ - * information printing helpers - */ - static int --snprint_str (char * buff, size_t len, char * str) -+snprint_str (char * buff, size_t len, const char * str) - { - return snprintf(buff, len, "%s", str); - } -@@ -432,6 +433,83 @@ snprint_path_mpp (char * buff, size_t le - } - - static int -+snprint_host_attr (char * buff, size_t len, struct path * pp, char *attr) -+{ -+ struct udev_device *host_dev = NULL; -+ char host_id[32]; -+ const char *value = NULL; -+ int ret; -+ -+ if (pp->sg_id.proto_id != SCSI_PROTOCOL_FCP) -+ return snprintf(buff, len, "[undef]"); -+ sprintf(host_id, "host%d", pp->sg_id.host_no); -+ host_dev = udev_device_new_from_subsystem_sysname(conf->udev, "fc_host", -+ host_id); -+ if (!host_dev) { -+ condlog(1, "%s: No fc_host device for '%s'", pp->dev, host_id); -+ goto out; -+ } -+ value = udev_device_get_sysattr_value(host_dev, attr); -+ if (value) -+ ret = snprint_str(buff, len, value); -+ udev_device_unref(host_dev); -+out: -+ if (!value) -+ ret = snprintf(buff, len, "[unknown]"); -+ return ret; -+} -+ -+static int -+snprint_host_wwnn (char * buff, size_t len, struct path * pp) -+{ -+ return snprint_host_attr(buff, len, pp, "node_name"); -+} -+ -+static int -+snprint_host_wwpn (char * buff, size_t len, struct path * pp) -+{ -+ return snprint_host_attr(buff, len, pp, "port_name"); -+} -+ -+static int -+snprint_tgt_wwpn (char * buff, size_t len, struct path * pp) -+{ -+ struct udev_device *rport_dev = NULL; -+ char rport_id[32]; -+ const char *value = NULL; -+ int ret; -+ -+ if (pp->sg_id.proto_id != SCSI_PROTOCOL_FCP) -+ return snprintf(buff, len, "[undef]"); -+ sprintf(rport_id, "rport-%d:%d-%d", -+ pp->sg_id.host_no, pp->sg_id.channel, pp->sg_id.transport_id); -+ rport_dev = udev_device_new_from_subsystem_sysname(conf->udev, -+ "fc_remote_ports", rport_id); -+ if (!rport_dev) { -+ condlog(1, "%s: No fc_remote_port device for '%s'", pp->dev, -+ rport_id); -+ goto out; -+ } -+ value = udev_device_get_sysattr_value(rport_dev, "port_name"); -+ if (value) -+ ret = snprint_str(buff, len, value); -+ udev_device_unref(rport_dev); -+out: -+ if (!value) -+ ret = snprintf(buff, len, "[unknown]"); -+ return ret; -+} -+ -+ -+static int -+snprint_tgt_wwnn (char * buff, size_t len, struct path * pp) -+{ -+ if (pp->tgt_node_name[0] == '\0') -+ return snprintf(buff, len, "[undef]"); -+ return snprint_str(buff, len, pp->tgt_node_name); -+} -+ -+static int - snprint_path_checker (char * buff, size_t len, struct path * pp) - { - struct checker * c = &pp->checker; -@@ -475,6 +553,10 @@ struct path_data pd[] = { - {'S', "size", 0, snprint_path_size}, - {'z', "serial", 0, snprint_path_serial}, - {'m', "multipath", 0, snprint_path_mpp}, -+ {'N', "host WWNN", 0, snprint_host_wwnn}, -+ {'n', "target WWNN", 0, snprint_tgt_wwnn}, -+ {'R', "host WWPN", 0, snprint_host_wwpn}, -+ {'r', "target WWPN", 0, snprint_tgt_wwpn}, - {0, NULL, 0 , NULL} - }; - diff --git a/0097-RH-fix-coverity-errors.patch b/0097-RH-fix-coverity-errors.patch deleted file mode 100644 index 8ce0e87..0000000 --- a/0097-RH-fix-coverity-errors.patch +++ /dev/null @@ -1,158 +0,0 @@ ---- - kpartx/devmapper.c | 3 ++- - libmultipath/alias.c | 1 + - libmultipath/blacklist.c | 7 +++++++ - libmultipath/prioritizers/iet.c | 2 ++ - libmultipath/prioritizers/weightedpath.c | 5 ++++- - libmultipath/regex.c | 5 ++++- - libmultipath/sysfs.c | 3 ++- - libmultipath/util.c | 2 +- - 8 files changed, 23 insertions(+), 5 deletions(-) - -Index: multipath-tools-130222/kpartx/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/devmapper.c -+++ multipath-tools-130222/kpartx/devmapper.c -@@ -132,8 +132,9 @@ dm_addmap (int task, const char *name, c - goto addout; - r = dm_task_run (dmt); - -- addout: -+addout: - dm_task_destroy (dmt); -+ free(prefixed_uuid); - - return r; - } -Index: multipath-tools-130222/libmultipath/alias.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/alias.c -+++ multipath-tools-130222/libmultipath/alias.c -@@ -328,6 +328,7 @@ get_user_friendly_alias(char *wwid, char - if (fflush(f) != 0) { - condlog(0, "cannot fflush bindings file stream : %s", - strerror(errno)); -+ free(alias); - fclose(f); - return NULL; - } -Index: multipath-tools-130222/libmultipath/blacklist.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/blacklist.c -+++ multipath-tools-130222/libmultipath/blacklist.c -@@ -79,6 +79,8 @@ set_ble_device (vector blist, char * ven - if (regcomp(&ble->vendor_reg, vendor, - REG_EXTENDED|REG_NOSUB)) { - FREE(vendor); -+ if (product) -+ FREE(product); - return 1; - } - ble->vendor = vendor; -@@ -87,6 +89,10 @@ set_ble_device (vector blist, char * ven - if (regcomp(&ble->product_reg, product, - REG_EXTENDED|REG_NOSUB)) { - FREE(product); -+ if (vendor) { -+ ble->vendor = NULL; -+ FREE(vendor); -+ } - return 1; - } - ble->product = product; -@@ -189,6 +195,7 @@ setup_default_blist (struct config * con - STRDUP(hwe->bl_product), - ORIGIN_DEFAULT)) { - FREE(ble); -+ vector_del_slot(conf->blist_device, VECTOR_SIZE(conf->blist_device) - 1); - return 1; - } - } -Index: multipath-tools-130222/libmultipath/prioritizers/iet.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/iet.c -+++ multipath-tools-130222/libmultipath/prioritizers/iet.c -@@ -109,6 +109,7 @@ int iet_prio(const char *dev, char * arg - ssize_t nchars = readlink(path, buffer, sizeof(buffer)-1); - if (nchars != -1) { - char *device; -+ buffer[nchars] = '\0'; - device = find_regex(buffer,"(sd[a-z]+)"); - // if device parsed is the right one - if (device!=NULL && strncmp(device, dev, strlen(device)) == 0) { -@@ -118,6 +119,7 @@ int iet_prio(const char *dev, char * arg - if (ip!=NULL && strncmp(ip, preferredip, strlen(ip)) == 0) { - // high prio - free(ip); -+ free(device); - closedir(dir_p); - return 20; - } -Index: multipath-tools-130222/libmultipath/prioritizers/weightedpath.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/weightedpath.c -+++ multipath-tools-130222/libmultipath/prioritizers/weightedpath.c -@@ -61,8 +61,10 @@ int prio_path_weight(struct path *pp, ch - regex = get_next_string(&temp, split_char); - - /* Return default priority if the argument is not parseable */ -- if (!regex) -+ if (!regex) { -+ FREE(arg); - return priority; -+ } - - if (!strcmp(regex, HBTL)) { - sprintf(path, "%d:%d:%d:%d", pp->sg_id.host_no, -@@ -72,6 +74,7 @@ int prio_path_weight(struct path *pp, ch - } else { - condlog(0, "%s: %s - Invalid arguments", pp->dev, - pp->prio.name); -+ FREE(arg); - return priority; - } - -Index: multipath-tools-130222/libmultipath/regex.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/regex.c -+++ multipath-tools-130222/libmultipath/regex.c -@@ -3936,8 +3936,11 @@ int eflags; - regs.num_regs = nmatch; - regs.start = TALLOC(nmatch, regoff_t); - regs.end = TALLOC(nmatch, regoff_t); -- if (regs.start == NULL || regs.end == NULL) -+ if (regs.start == NULL || regs.end == NULL) { -+ free(regs.start); -+ free(regs.end); - return (int) REG_NOMATCH; -+ } - } - - /* Perform the searching operation. */ -Index: multipath-tools-130222/libmultipath/sysfs.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/sysfs.c -+++ multipath-tools-130222/libmultipath/sysfs.c -@@ -88,7 +88,8 @@ ssize_t sysfs_attr_get_value(struct udev - } else if (size == value_len) { - condlog(4, "overflow while reading from %s", devpath); - size = 0; -- } -+ } else -+ value[size] = '\0'; - - close(fd); - return size; -Index: multipath-tools-130222/libmultipath/util.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/util.c -+++ multipath-tools-130222/libmultipath/util.c -@@ -175,7 +175,7 @@ devt2devname (char *devname, int devname - sprintf(block_path,"/sys/dev/block/%u:%u", major, minor); - if (lstat(block_path, &statbuf) == 0) { - if (S_ISLNK(statbuf.st_mode) && -- readlink(block_path, dev, FILE_NAME_SIZE) > 0) { -+ readlink(block_path, dev, FILE_NAME_SIZE-1) > 0) { - char *p = strrchr(dev, '/'); - - if (!p) { diff --git a/0098-UPBZ-1067171-mutipath-i.patch b/0098-UPBZ-1067171-mutipath-i.patch deleted file mode 100644 index cf41863..0000000 --- a/0098-UPBZ-1067171-mutipath-i.patch +++ /dev/null @@ -1,332 +0,0 @@ ---- - libmultipath/config.h | 15 ++++++++- - libmultipath/configure.c | 2 - - libmultipath/discovery.c | 5 +-- - multipath/main.c | 75 +++++++++++++++++++++++++---------------------- - multipath/multipath.8 | 5 ++- - 5 files changed, 61 insertions(+), 41 deletions(-) - -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -23,6 +23,17 @@ enum devtypes { - DEV_DEVMAP - }; - -+enum mpath_cmds { -+ CMD_CREATE, -+ CMD_DRY_RUN, -+ CMD_LIST_SHORT, -+ CMD_LIST_LONG, -+ CMD_VALID_PATH, -+ CMD_REMOVE_WWID, -+ CMD_RESET_WWIDS, -+ CMD_ADD_WWID, -+}; -+ - struct hwentry { - char * vendor; - char * product; -@@ -79,8 +90,7 @@ struct mpentry { - - struct config { - int verbosity; -- int dry_run; -- int list; -+ enum mpath_cmds cmd; - int pgpolicy_flag; - int pgpolicy; - enum devtypes dev_type; -@@ -98,6 +108,7 @@ struct config { - int max_fds; - int force_reload; - int queue_without_daemon; -+ int ignore_wwids; - int checker_timeout; - int daemon; - int flush_on_last_del; -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -85,7 +85,7 @@ usage (char * progname) - { - fprintf (stderr, VERSION_STRING); - fprintf (stderr, "Usage:\n"); -- fprintf (stderr, " %s [-a|-A|-c|-w|-W] [-d] [-T tm:val] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); -+ fprintf (stderr, " %s [-a|-A|-c|-w|-W] [-d] [-T tm:val] [-r] [-i] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); - fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname); - fprintf (stderr, " %s -F [-v lvl]\n", progname); - fprintf (stderr, " %s -t\n", progname); -@@ -109,6 +109,7 @@ usage (char * progname) - " -d dry run, do not create or update devmaps\n" \ - " -t dump internal hardware table\n" \ - " -r force devmap reload\n" \ -+ " -i ignore wwids file\n" \ - " -B treat the bindings file as read only\n" \ - " -p policy failover|multibus|group_by_serial|group_by_prio\n" \ - " -b fil bindings file location\n" \ -@@ -209,18 +210,19 @@ get_dm_mpvec (vector curmp, vector pathv - * If not in "fast list mode", we need to fetch information - * about them - */ -- if (conf->list != 1) -+ if (conf->cmd != CMD_LIST_SHORT) - update_paths(mpp); - -- if (conf->list > 1) -+ if (conf->cmd == CMD_LIST_LONG) - mpp->bestpg = select_path_group(mpp); - - disassemble_status(status, mpp); - -- if (conf->list) -+ if (conf->cmd == CMD_LIST_SHORT || -+ conf->cmd == CMD_LIST_LONG) - print_multipath_topology(mpp, conf->verbosity); - -- if (!conf->dry_run) -+ if (conf->cmd == CMD_CREATE) - reinstate_paths(mpp); - } - return 0; -@@ -262,10 +264,11 @@ configure (void) - /* - * if we have a blacklisted device parameter, exit early - */ -- if (dev && conf->dev_type == DEV_DEVNODE && conf->dry_run != 3 && -+ if (dev && conf->dev_type == DEV_DEVNODE && -+ conf->cmd != CMD_REMOVE_WWID && - (filter_devnode(conf->blist_devnode, - conf->elist_devnode, dev) > 0)) { -- if (conf->dry_run == 2) -+ if (conf->cmd == CMD_VALID_PATH) - printf("%s is not a valid multipath device path\n", - conf->dev); - goto out; -@@ -278,13 +281,13 @@ configure (void) - int failed = get_refwwid(conf->dev, conf->dev_type, pathvec, - &refwwid); - if (!refwwid) { -- if (failed == 2 && conf->dry_run == 2) -+ if (failed == 2 && conf->cmd == CMD_VALID_PATH) - printf("%s is not a valid multipath device path\n", conf->dev); - else - condlog(3, "scope is nul"); - goto out; - } -- if (conf->dry_run == 3) { -+ if (conf->cmd == CMD_REMOVE_WWID) { - r = remove_wwid(refwwid); - if (r == 0) - printf("wwid '%s' removed\n", refwwid); -@@ -295,7 +298,7 @@ configure (void) - } - goto out; - } -- if (conf->dry_run == 5) { -+ if (conf->cmd == CMD_ADD_WWID) { - r = remember_wwid(refwwid); - if (r == 0) - printf("wwid '%s' added\n", refwwid); -@@ -305,13 +308,13 @@ configure (void) - goto out; - } - condlog(3, "scope limited to %s", refwwid); -- if (conf->dry_run == 2) { -- if (check_wwids_file(refwwid, 0) == 0){ -- printf("%s is a valid multipath device path\n", conf->dev); -+ if (conf->cmd == CMD_VALID_PATH) { -+ if (conf->ignore_wwids || -+ check_wwids_file(refwwid, 0) == 0) - r = 0; -- } -- else -- printf("%s is not a valid multipath device path\n", conf->dev); -+ -+ printf("%s %s a valid multipath device path\n", -+ conf->dev, r == 0 ? "is" : "is not"); - goto out; - } - } -@@ -319,13 +322,13 @@ configure (void) - /* - * get a path list - */ -- if (conf->dev && !conf->list) -+ if (conf->dev) - di_flag = DI_WWID; - -- if (conf->list > 1) -+ if (conf->cmd == CMD_LIST_LONG) - /* extended path info '-ll' */ - di_flag |= DI_SYSFS | DI_CHECKER; -- else if (conf->list) -+ else if (conf->cmd == CMD_LIST_SHORT) - /* minimum path info '-l' */ - di_flag |= DI_SYSFS; - else -@@ -345,7 +348,7 @@ configure (void) - - filter_pathvec(pathvec, refwwid); - -- if (conf->list) { -+ if (conf->cmd != CMD_CREATE && conf->cmd != CMD_DRY_RUN) { - r = 0; - goto out; - } -@@ -440,7 +443,7 @@ main (int argc, char *argv[]) - int r = 1; - long int timestamp = -1; - int valid = -1; -- while ((arg = getopt(argc, argv, ":aAdchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { -+ while ((arg = getopt(argc, argv, ":aAdchl::FfM:v:p:b:BritT:qwW")) != EOF ) { - switch(arg) { - case 'T': - if (optarg[0] == ':') -@@ -476,7 +479,7 @@ main (int argc, char *argv[]) - if (dm_prereq()) - exit(1); - -- while ((arg = getopt(argc, argv, ":aAdchl::FfM:v:p:b:BrtT:qwW")) != EOF ) { -+ while ((arg = getopt(argc, argv, ":aAdchl::FfM:v:p:b:BritT:qwW")) != EOF ) { - switch(arg) { - case 1: printf("optarg : %s\n",optarg); - break; -@@ -499,11 +502,11 @@ main (int argc, char *argv[]) - conf->allow_queueing = 1; - break; - case 'c': -- conf->dry_run = 2; -+ conf->cmd = CMD_VALID_PATH; - break; - case 'd': -- if (!conf->dry_run) -- conf->dry_run = 1; -+ if (conf->cmd == CMD_CREATE) -+ conf->cmd = CMD_DRY_RUN; - break; - case 'f': - conf->remove = FLUSH_ONE; -@@ -512,11 +515,10 @@ main (int argc, char *argv[]) - conf->remove = FLUSH_ALL; - break; - case 'l': -- conf->list = 1; -- conf->dry_run = 1; -- - if (optarg && !strncmp(optarg, "l", 1)) -- conf->list++; -+ conf->cmd = CMD_LIST_LONG; -+ else -+ conf->cmd = CMD_LIST_SHORT; - - break; - case 'M': -@@ -535,6 +537,9 @@ main (int argc, char *argv[]) - case 'r': - conf->force_reload = 1; - break; -+ case 'i': -+ conf->ignore_wwids = 1; -+ break; - case 't': - r = dump_config(); - goto out; -@@ -548,13 +553,13 @@ main (int argc, char *argv[]) - usage(argv[0]); - exit(0); - case 'w': -- conf->dry_run = 3; -+ conf->cmd = CMD_REMOVE_WWID; - break; - case 'W': -- conf->dry_run = 4; -+ conf->cmd = CMD_RESET_WWIDS; - break; - case 'a': -- conf->dry_run = 5; -+ conf->cmd = CMD_ADD_WWID; - break; - case ':': - fprintf(stderr, "Missing option argument\n"); -@@ -600,16 +605,16 @@ main (int argc, char *argv[]) - } - dm_init(); - -- if (conf->dry_run == 2 && -+ if (conf->cmd == CMD_VALID_PATH && - (!conf->dev || conf->dev_type == DEV_DEVMAP)) { - condlog(0, "the -c option requires a path to check"); - goto out; - } -- if (conf->dry_run == 3 && !conf->dev) { -+ if (conf->cmd == CMD_REMOVE_WWID && !conf->dev) { - condlog(0, "the -w option requires a device"); - goto out; - } -- if (conf->dry_run == 4) { -+ if (conf->cmd == CMD_RESET_WWIDS) { - struct multipath * mpp; - int i; - vector curmp; -Index: multipath-tools-130222/multipath/multipath.8 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.8 -+++ multipath-tools-130222/multipath/multipath.8 -@@ -8,7 +8,7 @@ multipath \- Device mapper target autoco - .RB [\| \-b\ \c - .IR bindings_file \|] - .RB [\| \-d \|] --.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-a | \-A | \-w | \-W \|] -+.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-r | \-a | \-A | \-w | \-W \|] - .RB [\| \-p\ \c - .BR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|] - .RB [\| device \|] -@@ -55,6 +55,9 @@ print internal hardware table to stdout - .B \-r - force devmap reload - .TP -+.B \-i -+ignore wwids file when processing devices -+.TP - .B \-B - treat the bindings file as read only - .TP -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -580,7 +580,7 @@ domap (struct multipath * mpp, char * pa - /* - * last chance to quit before touching the devmaps - */ -- if (conf->dry_run && mpp->action != ACT_NOTHING) { -+ if (conf->cmd == CMD_DRY_RUN && mpp->action != ACT_NOTHING) { - print_multipath_topology(mpp, conf->verbosity); - return DOMAP_DRY; - } -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -54,7 +54,8 @@ store_pathinfo (vector pathvec, vector h - } - pp->udev = udev_device_ref(udevice); - err = pathinfo(pp, hwtable, -- (conf->dry_run == 3)? flag : (flag | DI_BLACKLIST)); -+ (conf->cmd == CMD_REMOVE_WWID)? flag : -+ (flag | DI_BLACKLIST)); - if (err) - goto out; - -@@ -1101,7 +1102,7 @@ get_uid (struct path * pp) - - memset(pp->wwid, 0, WWID_SIZE); - value = udev_device_get_property_value(pp->udev, pp->uid_attribute); -- if ((!value || strlen(value) == 0) && conf->dry_run == 2) -+ if ((!value || strlen(value) == 0) && conf->cmd == CMD_VALID_PATH) - value = getenv(pp->uid_attribute); - if (value && strlen(value)) { - size_t len = WWID_SIZE; diff --git a/0099-RH-add-all-devs.patch b/0099-RH-add-all-devs.patch deleted file mode 100644 index aca6d4c..0000000 --- a/0099-RH-add-all-devs.patch +++ /dev/null @@ -1,170 +0,0 @@ ---- - libmultipath/config.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++- - libmultipath/config.h | 1 - libmultipath/dict.c | 38 +++++++++++++++++++++++++++++ - 3 files changed, 102 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -113,6 +113,8 @@ find_hwe (vector hwtable, char * vendor, - * continuing to the generic entries - */ - vector_foreach_slot_backwards (hwtable, tmp, i) { -+ if (tmp->all_devs == 1) -+ continue; - if (hwe_regmatch(tmp, &hwe)) - continue; - ret = tmp; -@@ -348,6 +350,62 @@ merge_hwe (struct hwentry * dst, struct - return 0; - } - -+#define overwrite_str(s) \ -+do { \ -+ if (src->s) { \ -+ if (dst->s) \ -+ FREE(dst->s); \ -+ if (!(dst->s = set_param_str(src->s))) \ -+ return 1; \ -+ } \ -+} while(0) -+ -+#define overwrite_num(s) \ -+do { \ -+ if (src->s) \ -+ dst->s = src->s; \ -+} while(0) -+ -+static int -+overwrite_hwe (struct hwentry * dst, struct hwentry * src) -+{ -+ overwrite_str(vendor); -+ overwrite_str(product); -+ overwrite_str(revision); -+ overwrite_str(uid_attribute); -+ overwrite_str(features); -+ overwrite_str(hwhandler); -+ overwrite_str(selector); -+ overwrite_str(checker_name); -+ overwrite_str(prio_name); -+ overwrite_str(prio_args); -+ overwrite_str(alias_prefix); -+ overwrite_str(bl_product); -+ overwrite_num(pgpolicy); -+ overwrite_num(pgfailback); -+ overwrite_num(rr_weight); -+ overwrite_num(no_path_retry); -+ overwrite_num(minio); -+ overwrite_num(minio_rq); -+ overwrite_num(pg_timeout); -+ overwrite_num(flush_on_last_del); -+ overwrite_num(fast_io_fail); -+ overwrite_num(dev_loss); -+ overwrite_num(user_friendly_names); -+ overwrite_num(retain_hwhandler); -+ overwrite_num(detect_prio); -+ -+ /* -+ * Make sure features is consistent with -+ * no_path_retry -+ */ -+ if (dst->no_path_retry == NO_PATH_RETRY_FAIL) -+ remove_feature(&dst->features, "queue_if_no_path"); -+ else if (dst->no_path_retry != NO_PATH_RETRY_UNDEF) -+ add_feature(&dst->features, "queue_if_no_path"); -+ return 0; -+} -+ - int - store_hwe (vector hwtable, struct hwentry * dhwe) - { -@@ -431,7 +489,11 @@ restart: - break; - j = n; - vector_foreach_slot_after(hw, hwe2, j) { -- if (conf->hw_strmatch) { -+ if (hwe2->all_devs == 1) { -+ overwrite_hwe(hwe1, hwe2); -+ continue; -+ } -+ else if (conf->hw_strmatch) { - if (hwe_strmatch(hwe2, hwe1)) - continue; - } -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -47,6 +47,7 @@ struct hwentry { - char * prio_args; - char * alias_prefix; - -+ int all_devs; - int pgpolicy; - int pgfailback; - int rr_weight; -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -918,6 +918,32 @@ device_handler(vector strvec) - } - - static int -+all_devs_handler(vector strvec) -+{ -+ char * buff; -+ struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable); -+ -+ if (!hwe) -+ return 1; -+ -+ buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ hwe->all_devs = 0; -+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) || -+ (strlen(buff) == 1 && !strcmp(buff, "1"))) -+ hwe->all_devs = 1; -+ else -+ hwe->all_devs = 0; -+ -+ FREE(buff); -+ return 0; -+} -+ -+static int - vendor_handler(vector strvec) - { - struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable); -@@ -2182,6 +2208,17 @@ snprint_hw_dev_loss(char * buff, int len - } - - static int -+snprint_hw_all_devs (char *buff, int len, void *data) -+{ -+ struct hwentry * hwe = (struct hwentry *)data; -+ -+ if (!hwe->all_devs) -+ return 0; -+ -+ return snprintf(buff, len, "yes"); -+} -+ -+static int - snprint_hw_vendor (char * buff, int len, void * data) - { - struct hwentry * hwe = (struct hwentry *)data; -@@ -2968,6 +3005,7 @@ init_keywords(void) - install_keyword_root("devices", &devices_handler); - install_keyword_multi("device", &device_handler, NULL); - install_sublevel(); -+ install_keyword("all_devs", &all_devs_handler, &snprint_hw_all_devs); - install_keyword("vendor", &vendor_handler, &snprint_hw_vendor); - install_keyword("product", &product_handler, &snprint_hw_product); - install_keyword("revision", &revision_handler, &snprint_hw_revision); diff --git a/0100-RHBZ-1067171-multipath-i-update.patch b/0100-RHBZ-1067171-multipath-i-update.patch deleted file mode 100644 index 9a67e7a..0000000 --- a/0100-RHBZ-1067171-multipath-i-update.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- - multipath/main.c | 25 ++++++++++++++++++++++++- - 1 file changed, 24 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -198,6 +198,9 @@ get_dm_mpvec (vector curmp, vector pathv - continue; - } - -+ if (conf->cmd == CMD_VALID_PATH) -+ continue; -+ - dm_get_map(mpp->alias, &mpp->size, params); - condlog(3, "params = %s", params); - dm_get_status(mpp->alias, status); -@@ -308,7 +311,13 @@ configure (void) - goto out; - } - condlog(3, "scope limited to %s", refwwid); -- if (conf->cmd == CMD_VALID_PATH) { -+ /* If you are ignoring the wwids file and find_multipaths is -+ * set, you need to actually check if there are two available -+ * paths to determine if this path should be multipathed. To -+ * do this, we put off the check until after discovering all -+ * the paths */ -+ if (conf->cmd == CMD_VALID_PATH && -+ (!conf->find_multipaths || !conf->ignore_wwids)) { - if (conf->ignore_wwids || - check_wwids_file(refwwid, 0) == 0) - r = 0; -@@ -348,6 +357,20 @@ configure (void) - - filter_pathvec(pathvec, refwwid); - -+ -+ if (conf->cmd == CMD_VALID_PATH) { -+ /* This only happens if find_multipaths is and -+ * ignore_wwids is set. -+ * If there is currently a multipath device matching -+ * the refwwid, or there is more than one path matching -+ * the refwwid, then the path is valid */ -+ if (VECTOR_SIZE(curmp) != 0 || VECTOR_SIZE(pathvec) > 1) -+ r = 0; -+ printf("%s %s a valid multipath device path\n", -+ conf->dev, r == 0 ? "is" : "is not"); -+ goto out; -+ } -+ - if (conf->cmd != CMD_CREATE && conf->cmd != CMD_DRY_RUN) { - r = 0; - goto out; diff --git a/0101-RH-adapter-name-wildcard.patch b/0101-RH-adapter-name-wildcard.patch deleted file mode 100644 index 3c67de5..0000000 --- a/0101-RH-adapter-name-wildcard.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- - libmultipath/print.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -Index: multipath-tools-130222/libmultipath/print.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.c -+++ multipath-tools-130222/libmultipath/print.c -@@ -510,6 +510,16 @@ snprint_tgt_wwnn (char * buff, size_t le - } - - static int -+snprint_host_adapter (char * buff, size_t len, struct path * pp) -+{ -+ char adapter[SLOT_NAME_SIZE]; -+ -+ if (sysfs_get_host_adapter_name(pp, adapter)) -+ return snprintf(buff, len, "[undef]"); -+ return snprint_str(buff, len, adapter); -+} -+ -+static int - snprint_path_checker (char * buff, size_t len, struct path * pp) - { - struct checker * c = &pp->checker; -@@ -557,6 +567,7 @@ struct path_data pd[] = { - {'n', "target WWNN", 0, snprint_tgt_wwnn}, - {'R', "host WWPN", 0, snprint_host_wwpn}, - {'r', "target WWPN", 0, snprint_tgt_wwpn}, -+ {'a', "host adapter", 0, snprint_host_adapter}, - {0, NULL, 0 , NULL} - }; - diff --git a/0102-RHBZ-1160478-mpathconf-template.patch b/0102-RHBZ-1160478-mpathconf-template.patch deleted file mode 100644 index 7e58736..0000000 --- a/0102-RHBZ-1160478-mpathconf-template.patch +++ /dev/null @@ -1,82 +0,0 @@ ---- - multipath/mpathconf | 26 ++++++++++++++++++++------ - multipath/mpathconf.8 | 16 +++++++--------- - 2 files changed, 27 insertions(+), 15 deletions(-) - -Index: multipath-tools-130222/multipath/mpathconf -=================================================================== ---- multipath-tools-130222.orig/multipath/mpathconf -+++ multipath-tools-130222/multipath/mpathconf -@@ -19,10 +19,27 @@ - - unset ENABLE FIND FRIENDLY MODULE MULTIPATHD HAVE_DISABLE HAVE_FIND HAVE_BLACKLIST HAVE_DEFAULTS HAVE_FRIENDLY HAVE_MULTIPATHD HAVE_MODULE SHOW_STATUS CHANGED_CONFIG - --DEFAULT_CONFIGFILE="/usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf" -+DEFAULT_CONFIG="# device-mapper-multipath configuration file -+ -+# For a complete list of the default configuration values, run either: -+# # multipath -t -+# or -+# # multipathd show config -+ -+# For a list of configuration options with descriptions, see the -+# multipath.conf man page. -+ -+# For an example configuration file, see: -+# /user/share/doc/device-mapper-multipath/multipath.conf -+ -+defaults { -+ user_friendly_names yes -+ find_multipaths yes -+}" -+ - CONFIGFILE="/etc/multipath.conf" - MULTIPATHDIR="/etc/multipath" --TMPFILE=/etc/multipath/.multipath.conf.tmp -+TMPFILE="/etc/multipath/.multipath.conf.tmp" - - function usage - { -@@ -134,12 +151,9 @@ if [ ! -d "$MULTIPATHDIR" ]; then - fi - - rm $TMPFILE 2> /dev/null -+echo "$DEFAULT_CONFIG" > $TMPFILE - if [ -f "$CONFIGFILE" ]; then - cp $CONFIGFILE $TMPFILE --elif [ -f "$DEFAULT_CONFIGFILE" ]; then -- cp $DEFAULT_CONFIGFILE $TMPFILE --else -- touch $TMPFILE - fi - - if grep -q "^blacklist[[:space:]]*{" $TMPFILE ; then -Index: multipath-tools-130222/multipath/mpathconf.8 -=================================================================== ---- multipath-tools-130222.orig/multipath/mpathconf.8 -+++ multipath-tools-130222/multipath/mpathconf.8 -@@ -34,17 +34,15 @@ that users can manually edit their confi - If - .B /etc/multipath.conf - already exists, mpathconf will edit it. If it does not exist, mpathconf will --use --.B /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf --as the starting file. This file has -+create a default file with - .B user_friendly_names --set. If this file does not exist, mpathconf will create --.B /etc/multipath.conf --from scratch. For most users, this means that --.B user_friendly_names --will be set by default, unless they use the -+and -+.B find_multipaths -+set. To disable these, use the - .B --user_friendly_names n --command. -+and -+.B --find_multipaths n -+options - .SH COMMANDS - .TP - .B --enable diff --git a/0103-RH-cleanup-partmaps-code.patch b/0103-RH-cleanup-partmaps-code.patch deleted file mode 100644 index 57fb402..0000000 --- a/0103-RH-cleanup-partmaps-code.patch +++ /dev/null @@ -1,199 +0,0 @@ ---- - libmultipath/devmapper.c | 155 ++++++++++++++++++----------------------------- - 1 file changed, 61 insertions(+), 94 deletions(-) - -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -1006,8 +1006,9 @@ bad: - return NULL; - } - --int --dm_remove_partmaps (const char * mapname, int need_sync) -+static int -+do_foreach_partmaps (const char * mapname, int (*partmap_func)(char *, void *), -+ void *data) - { - struct dm_task *dmt; - struct dm_names *names; -@@ -1059,26 +1060,8 @@ dm_remove_partmaps (const char * mapname - */ - strstr(params, dev_t) - ) { -- /* -- * then it's a kpartx generated partition. -- * remove it. -- */ -- /* -- * if the opencount is 0 maybe some other -- * partitions depend on it. -- */ -- if (dm_get_opencount(names->name)) { -- dm_remove_partmaps(names->name, need_sync); -- if (dm_get_opencount(names->name)) { -- condlog(2, "%s: map in use", -- names->name); -- goto out; -- } -- } -- condlog(4, "partition map %s removed", -- names->name); -- dm_simplecmd_flush(DM_DEVICE_REMOVE, names->name, -- need_sync, 0); -+ if (partmap_func(names->name, data) != 0) -+ goto out; - } - - next = names->next; -@@ -1091,6 +1074,35 @@ out: - return r; - } - -+struct remove_data { -+ int need_sync; -+}; -+ -+static int -+remove_partmap(char *name, void *data) -+{ -+ struct remove_data *rd = (struct remove_data *)data; -+ -+ if (dm_get_opencount(name)) { -+ dm_remove_partmaps(name, rd->need_sync); -+ if (dm_get_opencount(name)) { -+ condlog(2, "%s: map in use", name); -+ return 1; -+ } -+ } -+ condlog(4, "partition map %s removed", name); -+ dm_simplecmd_flush(DM_DEVICE_REMOVE, name, -+ rd->need_sync, 0); -+ return 0; -+} -+ -+int -+dm_remove_partmaps (const char * mapname, int need_sync) -+{ -+ struct remove_data rd = { need_sync }; -+ return do_foreach_partmaps(mapname, remove_partmap, &rd); -+} -+ - static struct dm_info * - alloc_dminfo (void) - { -@@ -1140,86 +1152,41 @@ out: - return r; - } - --int --dm_rename_partmaps (char * old, char * new) -+struct rename_data { -+ char *old; -+ char *new; -+ char *delim; -+}; -+ -+static int -+rename_partmap (char *name, void *data) - { -- struct dm_task *dmt; -- struct dm_names *names; -- unsigned next = 0; - char buff[PARAMS_SIZE]; -- unsigned long long size; -- char dev_t[32]; -- int r = 1; - int offset; -- char *delim; -- -- if (!(dmt = dm_task_create(DM_DEVICE_LIST))) -- return 1; -+ struct rename_data *rd = (struct rename_data *)data; - -- dm_task_no_open_count(dmt); -- -- if (!dm_task_run(dmt)) -- goto out; -- -- if (!(names = dm_task_get_names(dmt))) -- goto out; -- -- if (!names->dev) { -- r = 0; /* this is perfectly valid */ -- goto out; -- } -+ if (strncmp(name, rd->old, strlen(rd->old)) != 0) -+ return 0; -+ for (offset = strlen(rd->old); name[offset] && !(isdigit(name[offset])); offset++); /* do nothing */ -+ snprintf(buff, PARAMS_SIZE, "%s%s%s", rd->new, rd->delim, -+ name + offset); -+ dm_rename(name, buff); -+ condlog(4, "partition map %s renamed", name); -+ return 0; -+} - -- if (dm_dev_t(old, &dev_t[0], 32)) -- goto out; -+int -+dm_rename_partmaps (char * old, char * new) -+{ -+ struct rename_data rd; - -+ rd.old = old; -+ rd.new = new; - if (isdigit(new[strlen(new)-1])) -- delim = "p"; -+ rd.delim = "p"; - else -- delim = ""; -- -- do { -- if ( -- /* -- * if devmap target is "linear" -- */ -- (dm_type(names->name, TGT_PART) > 0) && -- -- /* -- * and the multipath mapname and the part mapname start -- * the same -- */ -- !strncmp(names->name, old, strlen(old)) && -- -- /* -- * and we can fetch the map table from the kernel -- */ -- !dm_get_map(names->name, &size, &buff[0]) && -- -- /* -- * and the table maps over the multipath map -- */ -- strstr(buff, dev_t) -- ) { -- /* -- * then it's a kpartx generated partition. -- * Rename it. -- */ -- for (offset = strlen(old); names->name[offset] && !(isdigit(names->name[offset])); offset++); /* do nothing */ -- snprintf(buff, PARAMS_SIZE, "%s%s%s", -- new, delim, names->name + offset); -- dm_rename(names->name, buff); -- condlog(4, "partition map %s renamed", -- names->name); -- } -- -- next = names->next; -- names = (void *) names + next; -- } while (next); -- -- r = 0; --out: -- dm_task_destroy (dmt); -- return r; -+ rd.delim = ""; -+ return do_foreach_partmaps(old, rename_partmap, &rd); - } - - int diff --git a/0104-RHBZ-631009-deferred-remove.patch b/0104-RHBZ-631009-deferred-remove.patch deleted file mode 100644 index 07f734c..0000000 --- a/0104-RHBZ-631009-deferred-remove.patch +++ /dev/null @@ -1,793 +0,0 @@ ---- - libmultipath/Makefile | 6 + - libmultipath/config.c | 3 - libmultipath/config.h | 3 - libmultipath/configure.c | 1 - libmultipath/defaults.h | 1 - libmultipath/devmapper.c | 142 ++++++++++++++++++++++++++++++++++++++++----- - libmultipath/devmapper.h | 11 ++- - libmultipath/dict.c | 116 ++++++++++++++++++++++++++++++++++++ - libmultipath/propsel.c | 28 ++++++++ - libmultipath/propsel.h | 1 - libmultipath/structs.h | 8 ++ - libmultipath/structs_vec.c | 3 - multipath/multipath.conf.5 | 36 +++++++++++ - multipathd/main.c | 23 +++++-- - 14 files changed, 355 insertions(+), 27 deletions(-) - -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -337,6 +337,7 @@ merge_hwe (struct hwentry * dst, struct - merge_num(user_friendly_names); - merge_num(retain_hwhandler); - merge_num(detect_prio); -+ merge_num(deferred_remove); - - /* - * Make sure features is consistent with -@@ -394,6 +395,7 @@ overwrite_hwe (struct hwentry * dst, str - overwrite_num(user_friendly_names); - overwrite_num(retain_hwhandler); - overwrite_num(detect_prio); -+ overwrite_num(deferred_remove); - - /* - * Make sure features is consistent with -@@ -617,6 +619,7 @@ load_config (char * file, struct udev *u - conf->fast_io_fail = DEFAULT_FAST_IO_FAIL; - conf->retain_hwhandler = DEFAULT_RETAIN_HWHANDLER; - conf->detect_prio = DEFAULT_DETECT_PRIO; -+ conf->deferred_remove = DEFAULT_DEFERRED_REMOVE; - conf->hw_strmatch = 0; - conf->force_sync = 0; - -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -61,6 +61,7 @@ struct hwentry { - int user_friendly_names; - int retain_hwhandler; - int detect_prio; -+ int deferred_remove; - char * bl_product; - }; - -@@ -84,6 +85,7 @@ struct mpentry { - int flush_on_last_del; - int attribute_flags; - int user_friendly_names; -+ int deferred_remove; - uid_t uid; - gid_t gid; - mode_t mode; -@@ -128,6 +130,7 @@ struct config { - int retain_hwhandler; - int detect_prio; - int force_sync; -+ int deferred_remove; - unsigned int version[3]; - - char * dev; -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -290,6 +290,7 @@ setup_map (struct multipath * mpp, char - select_dev_loss(mpp); - select_reservation_key(mpp); - select_retain_hwhandler(mpp); -+ select_deferred_remove(mpp); - - sysfs_set_scsi_tmo(mpp); - /* -Index: multipath-tools-130222/libmultipath/defaults.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/defaults.h -+++ multipath-tools-130222/libmultipath/defaults.h -@@ -19,6 +19,7 @@ - #define DEFAULT_FAST_IO_FAIL 5 - #define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_OFF - #define DEFAULT_DETECT_PRIO DETECT_PRIO_OFF -+#define DEFAULT_DEFERRED_REMOVE DEFERRED_REMOVE_OFF - - #define DEFAULT_CHECKINT 5 - #define MAX_CHECKINT(a) (a << 2) -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -32,6 +32,8 @@ - #define UUID_PREFIX "mpath-" - #define UUID_PREFIX_LEN 6 - -+static int dm_cancel_remove_partmaps(const char * mapname); -+ - #ifndef LIBDM_API_COOKIE - static inline int dm_task_set_cookie(struct dm_task *dmt, uint32_t *c, int a) - { -@@ -103,7 +105,9 @@ dm_lib_prereq (void) - { - char version[64]; - int v[3]; --#if defined(DM_SUBSYSTEM_UDEV_FLAG0) -+#if defined(LIBDM_API_DEFERRED) -+ int minv[3] = {1, 2, 89}; -+#elif defined(DM_SUBSYSTEM_UDEV_FLAG0) - int minv[3] = {1, 2, 82}; - #elif defined(LIBDM_API_COOKIE) - int minv[3] = {1, 2, 38}; -@@ -201,8 +205,10 @@ dm_prereq (void) - return dm_drv_prereq(); - } - -+#define do_deferred(x) ((x) == DEFERRED_REMOVE_ON || (x) == DEFERRED_REMOVE_IN_PROGRESS) -+ - static int --dm_simplecmd (int task, const char *name, int no_flush, int need_sync, uint16_t udev_flags) { -+dm_simplecmd (int task, const char *name, int no_flush, int need_sync, uint16_t udev_flags, int deferred_remove) { - int r = 0; - int udev_wait_flag = (need_sync && (task == DM_DEVICE_RESUME || - task == DM_DEVICE_REMOVE)); -@@ -220,7 +226,10 @@ dm_simplecmd (int task, const char *name - if (no_flush) - dm_task_no_flush(dmt); /* for DM_DEVICE_SUSPEND/RESUME */ - #endif -- -+#ifdef LIBDM_API_DEFERRED -+ if (do_deferred(deferred_remove)) -+ dm_task_deferred_remove(dmt); -+#endif - if (udev_wait_flag && !dm_task_set_cookie(dmt, &conf->cookie, ((conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0) | udev_flags)) - goto out; - r = dm_task_run (dmt); -@@ -232,12 +241,18 @@ dm_simplecmd (int task, const char *name - - extern int - dm_simplecmd_flush (int task, const char *name, int needsync, uint16_t udev_flags) { -- return dm_simplecmd(task, name, 0, needsync, udev_flags); -+ return dm_simplecmd(task, name, 0, needsync, udev_flags, 0); - } - - extern int - dm_simplecmd_noflush (int task, const char *name, uint16_t udev_flags) { -- return dm_simplecmd(task, name, 1, 1, udev_flags); -+ return dm_simplecmd(task, name, 1, 1, udev_flags, 0); -+} -+ -+static int -+dm_device_remove (const char *name, int needsync, int deferred_remove) { -+ return dm_simplecmd(DM_DEVICE_REMOVE, name, 0, needsync, 0, -+ deferred_remove); - } - - extern int -@@ -653,7 +668,7 @@ out: - } - - extern int --_dm_flush_map (const char * mapname, int need_sync) -+_dm_flush_map (const char * mapname, int need_sync, int deferred_remove) - { - int r; - -@@ -663,23 +678,46 @@ _dm_flush_map (const char * mapname, int - if (dm_type(mapname, TGT_MPATH) <= 0) - return 0; /* nothing to do */ - -- if (dm_remove_partmaps(mapname, need_sync)) -+ if (dm_remove_partmaps(mapname, need_sync, deferred_remove)) - return 1; - -- if (dm_get_opencount(mapname)) { -+ if (!do_deferred(deferred_remove) && dm_get_opencount(mapname)) { - condlog(2, "%s: map in use", mapname); - return 1; - } - -- r = dm_simplecmd_flush(DM_DEVICE_REMOVE, mapname, need_sync, 0); -+ r = dm_device_remove(mapname, need_sync, deferred_remove); - - if (r) { -+ if (do_deferred(deferred_remove) && dm_map_present(mapname)) { -+ condlog(4, "multipath map %s remove deferred", -+ mapname); -+ return 2; -+ } - condlog(4, "multipath map %s removed", mapname); - return 0; - } - return 1; - } - -+#ifdef LIBDM_API_DEFERRED -+ -+int -+dm_flush_map_nopaths(const char * mapname, int deferred_remove) -+{ -+ return _dm_flush_map(mapname, 1, deferred_remove); -+} -+ -+#else -+ -+int -+dm_flush_map_nopaths(const char * mapname, int deferred_remove) -+{ -+ return _dm_flush_map(mapname, 1, 0); -+} -+ -+#endif -+ - extern int - dm_suspend_and_flush_map (const char * mapname) - { -@@ -1076,6 +1114,7 @@ out: - - struct remove_data { - int need_sync; -+ int deferred_remove; - }; - - static int -@@ -1084,25 +1123,98 @@ remove_partmap(char *name, void *data) - struct remove_data *rd = (struct remove_data *)data; - - if (dm_get_opencount(name)) { -- dm_remove_partmaps(name, rd->need_sync); -- if (dm_get_opencount(name)) { -+ dm_remove_partmaps(name, rd->need_sync, rd->deferred_remove); -+ if (!do_deferred(rd->deferred_remove) && -+ dm_get_opencount(name)) { - condlog(2, "%s: map in use", name); - return 1; - } - } - condlog(4, "partition map %s removed", name); -- dm_simplecmd_flush(DM_DEVICE_REMOVE, name, -- rd->need_sync, 0); -+ dm_device_remove(name, rd->need_sync, rd->deferred_remove); - return 0; - } - - int --dm_remove_partmaps (const char * mapname, int need_sync) -+dm_remove_partmaps (const char * mapname, int need_sync, int deferred_remove) - { -- struct remove_data rd = { need_sync }; -+ struct remove_data rd = { need_sync, deferred_remove }; - return do_foreach_partmaps(mapname, remove_partmap, &rd); - } - -+#ifdef LIBDM_API_DEFERRED -+ -+static int -+cancel_remove_partmap (char *name, void *unused) -+{ -+ if (dm_get_opencount(name)) -+ dm_cancel_remove_partmaps(name); -+ if (dm_message(name, "@cancel_deferred_remove") != 0) -+ condlog(0, "%s: can't cancel deferred remove: %s", name, -+ strerror(errno)); -+ return 0; -+} -+ -+static int -+dm_get_deferred_remove (char * mapname) -+{ -+ int r = -1; -+ struct dm_task *dmt; -+ struct dm_info info; -+ -+ if (!(dmt = dm_task_create(DM_DEVICE_INFO))) -+ return -1; -+ -+ if (!dm_task_set_name(dmt, mapname)) -+ goto out; -+ -+ if (!dm_task_run(dmt)) -+ goto out; -+ -+ if (!dm_task_get_info(dmt, &info)) -+ goto out; -+ -+ r = info.deferred_remove; -+out: -+ dm_task_destroy(dmt); -+ return r; -+} -+ -+static int -+dm_cancel_remove_partmaps(const char * mapname) { -+ return do_foreach_partmaps(mapname, cancel_remove_partmap, NULL); -+} -+ -+int -+dm_cancel_deferred_remove (struct multipath *mpp) -+{ -+ int r = 0; -+ -+ if (!dm_get_deferred_remove(mpp->alias)) -+ return 0; -+ if (mpp->deferred_remove == DEFERRED_REMOVE_IN_PROGRESS) -+ mpp->deferred_remove = DEFERRED_REMOVE_ON; -+ -+ dm_cancel_remove_partmaps(mpp->alias); -+ r = dm_message(mpp->alias, "@cancel_deferred_remove"); -+ if (r) -+ condlog(0, "%s: can't cancel deferred remove: %s", mpp->alias, -+ strerror(errno)); -+ else -+ condlog(2, "%s: canceled deferred remove", mpp->alias); -+ return r; -+} -+ -+#else -+ -+int -+dm_cancel_deferred_remove (struct multipath *mpp) -+{ -+ return 0; -+} -+ -+#endif -+ - static struct dm_info * - alloc_dminfo (void) - { -Index: multipath-tools-130222/libmultipath/devmapper.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.h -+++ multipath-tools-130222/libmultipath/devmapper.h -@@ -23,9 +23,11 @@ int dm_map_present (const char *); - int dm_get_map(const char *, unsigned long long *, char *); - int dm_get_status(char *, char *); - int dm_type(const char *, char *); --int _dm_flush_map (const char *, int); --#define dm_flush_map(mapname) _dm_flush_map(mapname, 1) --#define dm_flush_map_nosync(mapname) _dm_flush_map(mapname, 0) -+int _dm_flush_map (const char *, int, int); -+int dm_flush_map_nopaths(const char * mapname, int deferred_remove); -+#define dm_flush_map(mapname) _dm_flush_map(mapname, 1, 0) -+#define dm_flush_map_nosync(mapname) _dm_flush_map(mapname, 0, 0) -+int dm_cancel_deferred_remove(struct multipath *mpp); - int dm_suspend_and_flush_map(const char * mapname); - int dm_flush_maps (void); - int dm_fail_path(char * mapname, char * path); -@@ -40,7 +42,8 @@ int dm_geteventnr (char *name); - int dm_get_major (char *name); - int dm_get_minor (char *name); - char * dm_mapname(int major, int minor); --int dm_remove_partmaps (const char * mapname, int need_sync); -+int dm_remove_partmaps (const char * mapname, int need_sync, -+ int deferred_remove); - int dm_get_uuid(char *name, char *uuid); - int dm_get_info (char * mapname, struct dm_info ** dmi); - int dm_rename (char * old, char * new); -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -738,6 +738,29 @@ def_force_sync_handler(vector strvec) - return 0; - } - -+static int -+def_deferred_remove_handler(vector strvec) -+{ -+ char * buff; -+ -+ buff = set_value(strvec); -+ -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ conf->deferred_remove = DEFERRED_REMOVE_OFF; -+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) || -+ (strlen(buff) == 1 && !strcmp(buff, "1"))) -+ conf->deferred_remove = DEFERRED_REMOVE_ON; -+ else -+ conf->deferred_remove = DEFAULT_DEFERRED_REMOVE; -+ -+ FREE(buff); -+ return 0; -+} -+ - /* - * blacklist block handlers - */ -@@ -1445,6 +1468,33 @@ hw_detect_prio_handler(vector strvec) - return 0; - } - -+static int -+hw_deferred_remove_handler(vector strvec) -+{ -+ struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable); -+ char * buff; -+ -+ if (!hwe) -+ return 1; -+ -+ buff = set_value(strvec); -+ -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ hwe->deferred_remove = DEFERRED_REMOVE_OFF; -+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) || -+ (strlen(buff) == 1 && !strcmp(buff, "1"))) -+ hwe->deferred_remove = DEFERRED_REMOVE_ON; -+ else -+ hwe->deferred_remove = DEFERRED_REMOVE_UNDEF; -+ -+ FREE(buff); -+ return 0; -+} -+ - /* - * multipaths block handlers - */ -@@ -1920,6 +1970,32 @@ mp_names_handler(vector strvec) - return 0; - } - -+static int -+mp_deferred_remove_handler(vector strvec) -+{ -+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable); -+ char * buff; -+ -+ if (!mpe) -+ return 1; -+ -+ buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && strcmp(buff, "no") == 0) || -+ (strlen(buff) == 1 && strcmp(buff, "0") == 0)) -+ mpe->deferred_remove = DEFERRED_REMOVE_OFF; -+ else if ((strlen(buff) == 3 && strcmp(buff, "yes") == 0) || -+ (strlen(buff) == 1 && strcmp(buff, "1") == 0)) -+ mpe->deferred_remove = DEFERRED_REMOVE_ON; -+ else -+ mpe->deferred_remove = DEFERRED_REMOVE_UNDEF; -+ -+ FREE(buff); -+ return 0; -+} -+ - /* - * config file keywords printing - */ -@@ -2165,7 +2241,7 @@ snprint_mp_reservation_key (char * buff, - return snprintf(buff, len, "0x%" PRIx64, prkey); - } - -- static int -+static int - snprint_mp_user_friendly_names (char * buff, int len, void * data) - { - struct mpentry * mpe = (struct mpentry *)data; -@@ -2179,6 +2255,19 @@ snprint_mp_user_friendly_names (char * b - } - - static int -+snprint_mp_deferred_remove (char * buff, int len, void * data) -+{ -+ struct mpentry * mpe = (struct mpentry *)data; -+ -+ if (mpe->deferred_remove == DEFERRED_REMOVE_UNDEF) -+ return 0; -+ else if (mpe->deferred_remove == DEFERRED_REMOVE_OFF) -+ return snprintf(buff, len, "no"); -+ else -+ return snprintf(buff, len, "yes"); -+} -+ -+static int - snprint_hw_fast_io_fail(char * buff, int len, void * data) - { - struct hwentry * hwe = (struct hwentry *)data; -@@ -2507,6 +2596,19 @@ snprint_hw_retain_hwhandler_handler(char - } - - static int -+snprint_hw_deferred_remove(char * buff, int len, void * data) -+{ -+ struct hwentry * hwe = (struct hwentry *)data; -+ -+ if (hwe->deferred_remove == DEFERRED_REMOVE_ON) -+ return snprintf(buff, len, "yes"); -+ else if (hwe->deferred_remove == DEFERRED_REMOVE_OFF) -+ return snprintf(buff, len, "no"); -+ else -+ return 0; -+} -+ -+static int - snprint_detect_prio(char * buff, int len, void * data) - { - struct hwentry * hwe = (struct hwentry *)data; -@@ -2900,6 +3002,15 @@ snprint_def_force_sync(char * buff, int - } - - static int -+snprint_def_deferred_remove(char * buff, int len, void * data) -+{ -+ if (conf->deferred_remove == DEFERRED_REMOVE_ON) -+ return snprintf(buff, len, "yes"); -+ else -+ return snprintf(buff, len, "no"); -+} -+ -+static int - snprint_ble_simple (char * buff, int len, void * data) - { - struct blentry * ble = (struct blentry *)data; -@@ -2968,6 +3079,7 @@ init_keywords(void) - install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio); - install_keyword("hw_str_match", &def_hw_strmatch_handler, &snprint_def_hw_strmatch); - install_keyword("force_sync", &def_force_sync_handler, &snprint_def_force_sync); -+ install_keyword("deferred_remove", &def_deferred_remove_handler, &snprint_def_deferred_remove); - __deprecated install_keyword("default_selector", &def_selector_handler, NULL); - __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); - __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL); -@@ -3032,6 +3144,7 @@ init_keywords(void) - install_keyword("user_friendly_names", &hw_names_handler, &snprint_hw_user_friendly_names); - install_keyword("retain_attached_hw_handler", &hw_retain_hwhandler_handler, &snprint_hw_retain_hwhandler_handler); - install_keyword("detect_prio", &hw_detect_prio_handler, &snprint_detect_prio); -+ install_keyword("deferred_remove", &hw_deferred_remove_handler, &snprint_hw_deferred_remove); - install_sublevel_end(); - - install_keyword_root("multipaths", &multipaths_handler); -@@ -3056,5 +3169,6 @@ init_keywords(void) - install_keyword("gid", &mp_gid_handler, &snprint_mp_gid); - install_keyword("reservation_key", &mp_reservation_key_handler, &snprint_mp_reservation_key); - install_keyword("user_friendly_names", &mp_names_handler, &snprint_mp_user_friendly_names); -+ install_keyword("deferred_remove", &mp_deferred_remove_handler, &snprint_mp_deferred_remove); - install_sublevel_end(); - } -Index: multipath-tools-130222/libmultipath/propsel.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.c -+++ multipath-tools-130222/libmultipath/propsel.c -@@ -744,6 +744,34 @@ select_retain_hwhandler (struct multipat - } - - extern int -+select_deferred_remove (struct multipath *mp) -+{ -+ if (mp->deferred_remove == DEFERRED_REMOVE_IN_PROGRESS) { -+ condlog(3, "%s: deferred_remove in progress", mp->alias); -+ return 0; -+ } -+ if (mp->mpe && mp->mpe->deferred_remove) { -+ mp->deferred_remove = mp->mpe->deferred_remove; -+ condlog(3, "%s: deferred_remove = %i (multipath setting)", -+ mp->alias, mp->deferred_remove); -+ return 0; -+ } -+ if (mp->hwe && mp->hwe->deferred_remove) { -+ mp->deferred_remove = mp->hwe->deferred_remove; -+ condlog(3, "%s: deferred_remove = %d (controller default)", mp->alias, mp->deferred_remove); -+ return 0; -+ } -+ if (conf->deferred_remove) { -+ mp->deferred_remove = conf->deferred_remove; -+ condlog(3, "%s: deferred_remove = %d (config file default)", mp->alias, mp->deferred_remove); -+ return 0; -+ } -+ mp->deferred_remove = DEFAULT_DEFERRED_REMOVE; -+ condlog(3, "%s: deferred_remove = %d (compiled in default)", mp->alias, mp->deferred_remove); -+ return 0; -+} -+ -+extern int - select_detect_prio (struct path * pp) - { - if (pp->hwe && pp->hwe->detect_prio) { -Index: multipath-tools-130222/libmultipath/propsel.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.h -+++ multipath-tools-130222/libmultipath/propsel.h -@@ -20,3 +20,4 @@ int select_dev_loss(struct multipath *mp - int select_reservation_key(struct multipath *mp); - int select_retain_hwhandler (struct multipath * mp); - int select_detect_prio(struct path * pp); -+int select_deferred_remove(struct multipath *mp); -Index: multipath-tools-130222/libmultipath/structs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.h -+++ multipath-tools-130222/libmultipath/structs.h -@@ -114,6 +114,13 @@ enum detect_prio_states { - DETECT_PRIO_ON, - }; - -+enum deferred_remove_states { -+ DEFERRED_REMOVE_UNDEF, -+ DEFERRED_REMOVE_OFF, -+ DEFERRED_REMOVE_ON, -+ DEFERRED_REMOVE_IN_PROGRESS, -+}; -+ - enum scsi_protocol { - SCSI_PROTOCOL_FCP = 0, /* Fibre Channel */ - SCSI_PROTOCOL_SPI = 1, /* parallel SCSI */ -@@ -207,6 +214,7 @@ struct multipath { - int attribute_flags; - int fast_io_fail; - int retain_hwhandler; -+ int deferred_remove; - unsigned int dev_loss; - uid_t uid; - gid_t gid; -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -214,19 +214,30 @@ sync_maps_state(vector mpvec) - } - - static int --flush_map(struct multipath * mpp, struct vectors * vecs) -+flush_map(struct multipath * mpp, struct vectors * vecs, int nopaths) - { -+ int r; -+ -+ if (nopaths) -+ r = dm_flush_map_nopaths(mpp->alias, mpp->deferred_remove); -+ else -+ r = dm_flush_map(mpp->alias); - /* - * clear references to this map before flushing so we can ignore - * the spurious uevent we may generate with the dm_flush_map call below - */ -- if (dm_flush_map(mpp->alias)) { -+ if (r) { - /* - * May not really be an error -- if the map was already flushed - * from the device mapper by dmsetup(8) for instance. - */ -- condlog(0, "%s: can't flush", mpp->alias); -- return 1; -+ if (r == 1) -+ condlog(0, "%s: can't flush", mpp->alias); -+ else { -+ condlog(2, "%s: devmap deferred remove", mpp->alias); -+ mpp->deferred_remove = DEFERRED_REMOVE_IN_PROGRESS; -+ } -+ return r; - } - else { - dm_lib_release(); -@@ -372,7 +383,7 @@ ev_remove_map (char * devname, char * al - mpp->alias, mpp->dmi->minor, minor); - return 0; - } -- return flush_map(mpp, vecs); -+ return flush_map(mpp, vecs, 0); - } - - static int -@@ -628,7 +639,7 @@ ev_remove_path (struct path *pp, struct - mpp->flush_on_last_del = FLUSH_IN_PROGRESS; - dm_queue_if_no_path(mpp->alias, 0); - } -- if (!flush_map(mpp, vecs)) { -+ if (!flush_map(mpp, vecs, 1)) { - condlog(2, "%s: removed map after" - " removing all paths", - alias); -Index: multipath-tools-130222/libmultipath/structs_vec.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs_vec.c -+++ multipath-tools-130222/libmultipath/structs_vec.c -@@ -392,6 +392,8 @@ __setup_multipath (struct vectors * vecs - set_no_path_retry(mpp); - select_pg_timeout(mpp); - select_flush_on_last_del(mpp); -+ if (VECTOR_SIZE(mpp->paths) != 0) -+ dm_cancel_deferred_remove(mpp); - } - - return 0; -@@ -565,7 +567,6 @@ int update_multipath (struct vectors *ve - } - } - } -- - return 0; - } - -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -84,6 +84,28 @@ directory where the dynamic shared objec - dependent, commonly - .I /lib/multipath - .TP -+.B find_multipaths -+If set to -+.I yes -+, instead of trying to create a multipath device for every non-blacklisted -+path, multipath will only create a device if one of three condidions are -+met. -+.I 1 -+There are at least two non-blacklisted paths with the same wwid, -+.I 2 -+the user manually forces the creation, by specifying a device with the multipath -+command, or -+.I 3 -+a path has the same WWID as a multipath device that was previously created -+while find_multipaths was set (even if that multipath device doesn't currently -+exist). -+Whenever a multipath device is created with find_multipaths set, multipath will -+remeber the WWID of the device, so that it will automatically create the -+device again, as soon as it sees a path with that WWID. This should allow most -+users to have multipath automatically choose the correct paths to make into -+multipath devices, without having to edit the blacklist; Default is -+.I no -+.TP - .B verbosity - default verbosity. Higher values increase the verbosity level. Valid - levels are between 0 and 6; default is -@@ -420,6 +442,16 @@ only one checker will run at a time. Th - multipathd checkers running in parallel causes significant CPU pressure. The - Default is - .I no -+.TP -+.B deferred_remove -+If set to -+.I yes -+, multipathd will do a deferred remove instead of a regular remove when the -+last path device has been deleted. This means that if the multipath device is -+still in use, it will be freed when the last user closes it. If path is added -+to the multipath device before the last user closes it, the deferred remove -+will be canceled. Default is -+.I no - . - .SH "blacklist section" - The -@@ -521,6 +553,8 @@ section: - .B features - .TP - .B reservation_key -+.TP -+.B deferred_remove - .RE - .PD - .LP -@@ -611,6 +645,8 @@ section: - .B retain_attached_hw_handler - .TP - .B detect_prio -+.TP -+.B deferred_remove - .RE - .PD - .LP -Index: multipath-tools-130222/libmultipath/Makefile -=================================================================== ---- multipath-tools-130222.orig/libmultipath/Makefile -+++ multipath-tools-130222/libmultipath/Makefile -@@ -36,6 +36,12 @@ ifneq ($(strip $(LIBUDEV_API_RECVBUF)),0 - CFLAGS += -DLIBUDEV_API_RECVBUF - endif - -+LIBDM_API_DEFERRED = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_deferred_remove' /usr/include/libdevmapper.h) -+ -+ifneq ($(strip $(LIBDM_API_DEFERRED)),0) -+ CFLAGS += -DLIBDM_API_DEFERRED -+endif -+ - - all: $(LIBS) - diff --git a/0105-RHBZ-1148979-fix-partition-mapping-creation-race-with-kpartx.patch b/0105-RHBZ-1148979-fix-partition-mapping-creation-race-with-kpartx.patch deleted file mode 100644 index 8c793bb..0000000 --- a/0105-RHBZ-1148979-fix-partition-mapping-creation-race-with-kpartx.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff -purN multipath-tools-130222.orig/multipath/multipath.rules multipath-tools-130222/multipath/multipath.rules ---- multipath-tools-130222.orig/multipath/multipath.rules 2014-11-03 14:37:41.269413134 +0100 -+++ multipath-tools-130222/multipath/multipath.rules 2014-11-03 14:38:43.694281901 +0100 -@@ -45,5 +45,5 @@ ACTION!="change", GOTO="end_mpath" - ENV{DM_UUID}!="mpath-?*", GOTO="end_mpath" - ENV{DM_SUSPENDED}=="1", GOTO="end_mpath" - ENV{DM_ACTION}=="PATH_FAILED", GOTO="end_mpath" --RUN+="$env{MPATH_SBIN_PATH}/kpartx -a $tempnode" -+ENV{DM_ACTIVATION}=="1", RUN+="$env{MPATH_SBIN_PATH}/kpartx -a $tempnode" - LABEL="end_mpath" diff --git a/0106-RHBZ-1159337-fix-double-free.patch b/0106-RHBZ-1159337-fix-double-free.patch deleted file mode 100644 index cbe4d1e..0000000 --- a/0106-RHBZ-1159337-fix-double-free.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- - multipathd/main.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -669,9 +669,8 @@ ev_remove_path (struct path *pp, struct - /* - * update our state from kernel - */ -- if (setup_multipath(vecs, mpp)) { -- goto fail; -- } -+ if (setup_multipath(vecs, mpp)) -+ return 1; - sync_map_state(mpp); - - condlog(2, "%s [%s]: path removed from map %s", diff --git a/0107-RHBZ-1169935-no-new-devs.patch b/0107-RHBZ-1169935-no-new-devs.patch deleted file mode 100644 index c9ab012..0000000 --- a/0107-RHBZ-1169935-no-new-devs.patch +++ /dev/null @@ -1,231 +0,0 @@ ---- - libmultipath/config.c | 4 ++++ - libmultipath/config.h | 1 + - libmultipath/configure.c | 5 ++--- - libmultipath/dict.c | 33 +++++++++++++++++++++++++++++++++ - libmultipath/util.c | 30 ++++++++++++++++++++++++++++++ - libmultipath/util.h | 1 + - libmultipath/wwids.c | 21 ++++++++++++++------- - multipathd/main.c | 3 +-- - 8 files changed, 86 insertions(+), 12 deletions(-) - -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -131,6 +131,7 @@ struct config { - int detect_prio; - int force_sync; - int deferred_remove; -+ int ignore_new_boot_devs; - unsigned int version[3]; - - char * dev; -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -775,9 +775,8 @@ coalesce_paths (struct vectors * vecs, v - if (refwwid && strncmp(pp1->wwid, refwwid, WWID_SIZE)) - continue; - -- /* If find_multipaths was selected check if the path is valid */ -- if (conf->find_multipaths && !refwwid && -- !should_multipath(pp1, pathvec)) { -+ /* check if the path is valid */ -+ if (!refwwid && !should_multipath(pp1, pathvec)) { - orphan_path(pp1); - continue; - } -Index: multipath-tools-130222/libmultipath/wwids.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.c -+++ multipath-tools-130222/libmultipath/wwids.c -@@ -15,6 +15,7 @@ - #include "wwids.h" - #include "defaults.h" - #include "config.h" -+#include "util.h" - - /* - * Copyright (c) 2010 Benjamin Marzinski, Redhat -@@ -268,15 +269,21 @@ should_multipath(struct path *pp1, vecto - { - int i; - struct path *pp2; -+ int ignore_new_devs = (conf->ignore_new_boot_devs && in_initrd()); -+ -+ if (!conf->find_multipaths && !ignore_new_devs) -+ return 1; - - condlog(4, "checking if %s should be multipathed", pp1->dev); -- vector_foreach_slot(pathvec, pp2, i) { -- if (pp1->dev == pp2->dev) -- continue; -- if (strncmp(pp1->wwid, pp2->wwid, WWID_SIZE) == 0) { -- condlog(3, "found multiple paths with wwid %s, " -- "multipathing %s", pp1->wwid, pp1->dev); -- return 1; -+ if (!ignore_new_devs) { -+ vector_foreach_slot(pathvec, pp2, i) { -+ if (pp1->dev == pp2->dev) -+ continue; -+ if (strncmp(pp1->wwid, pp2->wwid, WWID_SIZE) == 0) { -+ condlog(3, "found multiple paths with wwid %s, " -+ "multipathing %s", pp1->wwid, pp1->dev); -+ return 1; -+ } - } - } - if (check_wwids_file(pp1->wwid, 0) < 0) { -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -503,8 +503,7 @@ rescan: - return 1; - } - -- if (conf->find_multipaths && -- !should_multipath(pp, vecs->pathvec)) { -+ if (!should_multipath(pp, vecs->pathvec)) { - orphan_path(pp); - return 0; - } -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -622,6 +622,7 @@ load_config (char * file, struct udev *u - conf->deferred_remove = DEFAULT_DEFERRED_REMOVE; - conf->hw_strmatch = 0; - conf->force_sync = 0; -+ conf->ignore_new_boot_devs = 0; - - /* - * preload default hwtable -@@ -730,6 +731,9 @@ load_config (char * file, struct udev *u - !conf->wwids_file) - goto out; - -+ if (conf->ignore_new_boot_devs) -+ in_initrd(); -+ - return 0; - out: - free_config(conf); -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -761,6 +761,29 @@ def_deferred_remove_handler(vector strve - return 0; - } - -+static int -+def_ignore_new_boot_devs_handler(vector strvec) -+{ -+ char * buff; -+ -+ buff = set_value(strvec); -+ -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ conf->ignore_new_boot_devs = 0; -+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) || -+ (strlen(buff) == 1 && !strcmp(buff, "1"))) -+ conf->ignore_new_boot_devs = 1; -+ else -+ conf->ignore_new_boot_devs = 0; -+ -+ FREE(buff); -+ return 0; -+} -+ - /* - * blacklist block handlers - */ -@@ -3011,6 +3034,15 @@ snprint_def_deferred_remove(char * buff, - } - - static int -+snprint_def_ignore_new_boot_devs(char * buff, int len, void * data) -+{ -+ if (conf->ignore_new_boot_devs == 1) -+ return snprintf(buff, len, "yes"); -+ else -+ return snprintf(buff, len, "no"); -+} -+ -+static int - snprint_ble_simple (char * buff, int len, void * data) - { - struct blentry * ble = (struct blentry *)data; -@@ -3080,6 +3112,7 @@ init_keywords(void) - install_keyword("hw_str_match", &def_hw_strmatch_handler, &snprint_def_hw_strmatch); - install_keyword("force_sync", &def_force_sync_handler, &snprint_def_force_sync); - install_keyword("deferred_remove", &def_deferred_remove_handler, &snprint_def_deferred_remove); -+ install_keyword("ignore_new_boot_devs", &def_ignore_new_boot_devs_handler, &snprint_def_ignore_new_boot_devs); - __deprecated install_keyword("default_selector", &def_selector_handler, NULL); - __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); - __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL); -Index: multipath-tools-130222/libmultipath/util.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/util.c -+++ multipath-tools-130222/libmultipath/util.c -@@ -3,6 +3,8 @@ - #include - #include - #include -+#include -+#include - - #include "debug.h" - #include "memory.h" -@@ -267,3 +269,31 @@ dev_t parse_devt(const char *dev_t) - - return makedev(maj, min); - } -+ -+/* This define was taken from systemd. src/shared/macro.h */ -+#define F_TYPE_EQUAL(a, b) (a == (typeof(a)) b) -+ -+/* This function was taken from systemd. src/shared/util.c */ -+int in_initrd(void) { -+ static int saved = -1; -+ struct statfs s; -+ -+ if (saved >= 0) -+ return saved; -+ -+ /* We make two checks here: -+ * -+ * 1. the flag file /etc/initrd-release must exist -+ * 2. the root file system must be a memory file system -+ * The second check is extra paranoia, since misdetecting an -+ * initrd can have bad bad consequences due the initrd -+ * emptying when transititioning to the main systemd. -+ */ -+ -+ saved = access("/etc/initrd-release", F_OK) >= 0 && -+ statfs("/", &s) >= 0 && -+ (F_TYPE_EQUAL(s.f_type, TMPFS_MAGIC) || -+ F_TYPE_EQUAL(s.f_type, RAMFS_MAGIC)); -+ -+ return saved; -+} -Index: multipath-tools-130222/libmultipath/util.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/util.h -+++ multipath-tools-130222/libmultipath/util.h -@@ -11,6 +11,7 @@ void remove_trailing_chars(char *path, c - int devt2devname (char *, int, char *); - dev_t parse_devt(const char *dev_t); - char *convert_dev(char *dev, int is_path_device); -+int in_initrd(void); - - #define safe_sprintf(var, format, args...) \ - snprintf(var, sizeof(var), format, ##args) >= sizeof(var) diff --git a/0108-RHBZ-1153832-kpartx-remove-devs.patch b/0108-RHBZ-1153832-kpartx-remove-devs.patch deleted file mode 100644 index f02551a..0000000 --- a/0108-RHBZ-1153832-kpartx-remove-devs.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- - multipath/multipath.rules | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/multipath/multipath.rules -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.rules -+++ multipath-tools-130222/multipath/multipath.rules -@@ -45,5 +45,5 @@ ACTION!="change", GOTO="end_mpath" - ENV{DM_UUID}!="mpath-?*", GOTO="end_mpath" - 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 -a $tempnode" -+ENV{DM_ACTIVATION}=="1", RUN+="$env{MPATH_SBIN_PATH}/kpartx -u $tempnode" - LABEL="end_mpath" diff --git a/0109-RH-read-only-bindings.patch b/0109-RH-read-only-bindings.patch deleted file mode 100644 index c08120f..0000000 --- a/0109-RH-read-only-bindings.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- - multipathd/main.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -1879,7 +1879,7 @@ main (int argc, char *argv[]) - if (!conf) - exit(1); - -- while ((arg = getopt(argc, argv, ":dv:k::")) != EOF ) { -+ while ((arg = getopt(argc, argv, ":dv:k::B")) != EOF ) { - switch(arg) { - case 'd': - logsink = 0; -@@ -1895,6 +1895,9 @@ main (int argc, char *argv[]) - case 'k': - uxclnt(optarg); - exit(0); -+ case 'B': -+ conf->bindings_read_only = 1; -+ break; - default: - ; - } diff --git a/0110-RHBZ-blacklist-vd-devs.patch b/0110-RHBZ-blacklist-vd-devs.patch deleted file mode 100644 index af52d0d..0000000 --- a/0110-RHBZ-blacklist-vd-devs.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmultipath/blacklist.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/blacklist.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/blacklist.c -+++ multipath-tools-130222/libmultipath/blacklist.c -@@ -169,7 +169,7 @@ setup_default_blist (struct config * con - if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT)) - return 1; - -- str = STRDUP("^(td|hd)[a-z]"); -+ str = STRDUP("^(td|hd|vd)[a-z]"); - if (!str) - return 1; - if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT)) diff --git a/0111-RH-dont-show-pg-timeout.patch b/0111-RH-dont-show-pg-timeout.patch deleted file mode 100644 index f545cc5..0000000 --- a/0111-RH-dont-show-pg-timeout.patch +++ /dev/null @@ -1,147 +0,0 @@ ---- - libmultipath/dict.c | 97 ---------------------------------------------------- - 1 file changed, 97 deletions(-) - -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -473,26 +473,6 @@ def_checker_timeout_handler(vector strve - static int - def_pg_timeout_handler(vector strvec) - { -- int pg_timeout; -- char * buff; -- -- buff = set_value(strvec); -- -- if (!buff) -- return 1; -- -- if (strlen(buff) == 4 && !strcmp(buff, "none")) -- conf->pg_timeout = -PGTIMEOUT_NONE; -- else if (sscanf(buff, "%d", &pg_timeout) == 1 && pg_timeout >= 0) { -- if (pg_timeout == 0) -- conf->pg_timeout = -PGTIMEOUT_NONE; -- else -- conf->pg_timeout = pg_timeout; -- } -- else -- conf->pg_timeout = PGTIMEOUT_UNDEF; -- -- FREE(buff); - return 0; - } - -@@ -1358,30 +1338,6 @@ hw_minio_rq_handler(vector strvec) - static int - hw_pg_timeout_handler(vector strvec) - { -- int pg_timeout; -- struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable); -- char *buff; -- -- if (!hwe) -- return 1; -- -- buff = set_value(strvec); -- -- if (!buff) -- return 1; -- -- if (strlen(buff) == 4 && !strcmp(buff, "none")) -- hwe->pg_timeout = -PGTIMEOUT_NONE; -- else if (sscanf(buff, "%d", &pg_timeout) == 1 && pg_timeout >= 0) { -- if (pg_timeout == 0) -- hwe->pg_timeout = -PGTIMEOUT_NONE; -- else -- hwe->pg_timeout = pg_timeout; -- } -- else -- hwe->pg_timeout = PGTIMEOUT_UNDEF; -- -- FREE(buff); - return 0; - } - -@@ -1819,29 +1775,6 @@ mp_minio_rq_handler(vector strvec) - static int - mp_pg_timeout_handler(vector strvec) - { -- int pg_timeout; -- struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable); -- char *buff; -- -- if (!mpe) -- return 1; -- -- buff = set_value(strvec); -- -- if (!buff) -- return 1; -- if (strlen(buff) == 4 && !strcmp(buff, "none")) -- mpe->pg_timeout = -PGTIMEOUT_NONE; -- else if (sscanf(buff, "%d", &pg_timeout) == 1 && pg_timeout >= 0) { -- if (pg_timeout == 0) -- mpe->pg_timeout = -PGTIMEOUT_NONE; -- else -- mpe->pg_timeout = pg_timeout; -- } -- else -- mpe->pg_timeout = PGTIMEOUT_UNDEF; -- -- FREE(buff); - return 0; - } - -@@ -2180,16 +2113,6 @@ snprint_mp_rr_min_io_rq (char * buff, in - static int - snprint_mp_pg_timeout (char * buff, int len, void * data) - { -- struct mpentry * mpe = (struct mpentry *)data; -- -- switch (mpe->pg_timeout) { -- case PGTIMEOUT_UNDEF: -- break; -- case -PGTIMEOUT_NONE: -- return snprintf(buff, len, "\"none\""); -- default: -- return snprintf(buff, len, "%i", mpe->pg_timeout); -- } - return 0; - } - -@@ -2551,19 +2474,6 @@ snprint_hw_rr_min_io_rq (char * buff, in - static int - snprint_hw_pg_timeout (char * buff, int len, void * data) - { -- struct hwentry * hwe = (struct hwentry *)data; -- -- if (!hwe->pg_timeout) -- return 0; -- -- switch (hwe->pg_timeout) { -- case PGTIMEOUT_UNDEF: -- break; -- case -PGTIMEOUT_NONE: -- return snprintf(buff, len, "\"none\""); -- default: -- return snprintf(buff, len, "%i", hwe->pg_timeout); -- } - return 0; - } - -@@ -2895,13 +2805,6 @@ snprint_def_checker_timeout (char *buff, - static int - snprint_def_pg_timeout (char * buff, int len, void * data) - { -- switch (conf->pg_timeout) { -- case PGTIMEOUT_UNDEF: -- case -PGTIMEOUT_NONE: -- return snprintf(buff, len, "\"none\""); -- default: -- return snprintf(buff, len, "%i", conf->pg_timeout); -- } - return 0; - } - diff --git a/0112-RHBZ-1194917-add-config_dir-option.patch b/0112-RHBZ-1194917-add-config_dir-option.patch deleted file mode 100644 index b256ff0..0000000 --- a/0112-RHBZ-1194917-add-config_dir-option.patch +++ /dev/null @@ -1,616 +0,0 @@ ---- - libmultipath/config.c | 56 +++++++++++++++++++++++++++++++- - libmultipath/config.h | 2 + - libmultipath/defaults.h | 1 - libmultipath/dict.c | 69 +++++++++++++++++++++++++++++++++++---- - libmultipath/parser.c | 78 +++++++++++++++++++++++---------------------- - libmultipath/parser.h | 3 - - multipath.conf.annotated | 10 +++++ - multipath.conf.defaults | 1 - multipath/multipath.conf.5 | 7 ++++ - 9 files changed, 179 insertions(+), 48 deletions(-) - -Index: multipath-tools-130222/libmultipath/parser.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/parser.c -+++ multipath-tools-130222/libmultipath/parser.c -@@ -18,6 +18,7 @@ - */ - - #include -+#include - - #include "parser.h" - #include "memory.h" -@@ -453,14 +454,15 @@ set_value(vector strvec) - /* non-recursive configuration stream handler */ - static int kw_level = 0; - --int warn_on_duplicates(vector uniques, char *str) -+int warn_on_duplicates(vector uniques, char *str, char *file) - { - char *tmp; - int i; - - vector_foreach_slot(uniques, tmp, i) { - if (!strcmp(str, tmp)) { -- condlog(1, "multipath.conf line %d, duplicate keyword: %s", line_nr, str); -+ condlog(1, "%s line %d, duplicate keyword: %s", -+ file, line_nr, str); - return 0; - } - } -@@ -496,65 +498,70 @@ is_sublevel_keyword(char *str) - } - - int --validate_config_strvec(vector strvec) -+validate_config_strvec(vector strvec, char *file) - { - char *str; - int i; - - str = VECTOR_SLOT(strvec, 0); - if (str == NULL) { -- condlog(0, "can't parse option on line %d of config file", -- line_nr); -+ condlog(0, "can't parse option on line %d of %s", -+ line_nr, file); - return -1; - } - if (*str == '}') { - if (VECTOR_SIZE(strvec) > 1) -- condlog(0, "ignoring extra data starting with '%s' on line %d of config file", (char *)VECTOR_SLOT(strvec, 1), line_nr); -+ condlog(0, "ignoring extra data starting with '%s' on line %d of %s", (char *)VECTOR_SLOT(strvec, 1), line_nr, file); - return 0; - } - if (*str == '{') { -- condlog(0, "invalid keyword '%s' on line %d of config file", str, line_nr); -+ condlog(0, "invalid keyword '%s' on line %d of %s", -+ str, line_nr, file); - return -1; - } - if (is_sublevel_keyword(str)) { - str = VECTOR_SLOT(strvec, 1); - if (str == NULL) -- condlog(0, "missing '{' on line %d of config file", line_nr); -+ condlog(0, "missing '{' on line %d of %s", -+ line_nr, file); - else if (*str != '{') -- condlog(0, "expecting '{' on line %d of config file. found '%s'", line_nr, str); -+ condlog(0, "expecting '{' on line %d of %s. found '%s'", -+ line_nr, file, str); - else if (VECTOR_SIZE(strvec) > 2) -- condlog(0, "ignoring extra data starting with '%s' on line %d of config file", (char *)VECTOR_SLOT(strvec, 2), line_nr); -+ condlog(0, "ignoring extra data starting with '%s' on line %d of %s", (char *)VECTOR_SLOT(strvec, 2), line_nr, file); - return 0; - } - str = VECTOR_SLOT(strvec, 1); - if (str == NULL) { -- condlog(0, "missing value for option '%s' on line %d of config file", (char *)VECTOR_SLOT(strvec, 0), line_nr); -+ condlog(0, "missing value for option '%s' on line %d of %s", -+ (char *)VECTOR_SLOT(strvec, 0), line_nr, file); - return -1; - } - if (*str != '"') { - if (VECTOR_SIZE(strvec) > 2) -- condlog(0, "ignoring extra data starting with '%s' on line %d of config file", (char *)VECTOR_SLOT(strvec, 2), line_nr); -+ condlog(0, "ignoring extra data starting with '%s' on line %d of %s", (char *)VECTOR_SLOT(strvec, 2), line_nr, file); - return 0; - } - for (i = 2; i < VECTOR_SIZE(strvec); i++) { - str = VECTOR_SLOT(strvec, i); - if (str == NULL) { -- condlog(0, "can't parse value on line %d of config file", line_nr); -+ condlog(0, "can't parse value on line %d of %s", -+ line_nr, file); - return -1; - } - if (*str == '"') { - if (VECTOR_SIZE(strvec) > i + 1) -- condlog(0, "ignoring extra data starting with '%s' on line %d of config file", (char *)VECTOR_SLOT(strvec, (i + 1)), line_nr); -+ condlog(0, "ignoring extra data starting with '%s' on line %d of %s", (char *)VECTOR_SLOT(strvec, (i + 1)), line_nr, file); - return 0; - } - } -- condlog(0, "missing closing quotes on line %d of config file", -- line_nr); -+ condlog(0, "missing closing quotes on line %d of %s", -+ line_nr, file); - return 0; - } - --int --process_stream(vector keywords) -+static int -+process_stream(vector keywords, char *file) - { - int i; - int r = 0; -@@ -583,7 +590,7 @@ process_stream(vector keywords) - if (!strvec) - continue; - -- if (validate_config_strvec(strvec) != 0) { -+ if (validate_config_strvec(strvec, file) != 0) { - free_strvec(strvec); - continue; - } -@@ -595,8 +602,8 @@ process_stream(vector keywords) - free_strvec(strvec); - break; - } -- condlog(0, "unmatched '%s' at line %d of config file", -- EOB, line_nr); -+ condlog(0, "unmatched '%s' at line %d of %s", -+ EOB, line_nr, file); - } - - for (i = 0; i < VECTOR_SIZE(keywords); i++) { -@@ -604,7 +611,7 @@ process_stream(vector keywords) - - if (!strcmp(keyword->string, str)) { - if (keyword->unique && -- warn_on_duplicates(uniques, str)) { -+ warn_on_duplicates(uniques, str, file)) { - r = 1; - free_strvec(strvec); - goto out; -@@ -614,15 +621,15 @@ process_stream(vector keywords) - - if (keyword->sub) { - kw_level++; -- r += process_stream(keyword->sub); -+ r += process_stream(keyword->sub, file); - kw_level--; - } - break; - } - } - if (i >= VECTOR_SIZE(keywords)) -- condlog(1, "multipath.conf +%d, invalid keyword: %s", -- line_nr, str); -+ condlog(1, "%s line %d, invalid keyword: %s", -+ file, line_nr, str); - - free_strvec(strvec); - } -@@ -646,27 +653,24 @@ int alloc_keywords(void) - - /* Data initialization */ - int --init_data(char *conf_file, void (*init_keywords) (void)) -+process_file(char *file) - { - int r; - -- stream = fopen(conf_file, "r"); -+ if (!keywords) { -+ condlog(0, "No keywords alocated"); -+ return 1; -+ } -+ stream = fopen(file, "r"); - if (!stream) { -- syslog(LOG_WARNING, "Configuration file open problem"); -+ condlog(0, "couldn't open configuration file '%s': %s", -+ file, strerror(errno)); - return 1; - } - -- /* Init Keywords structure */ -- (*init_keywords) (); -- --/* Dump configuration * -- vector_dump(keywords); -- dump_keywords(keywords, 0); --*/ -- - /* Stream handling */ - line_nr = 0; -- r = process_stream(keywords); -+ r = process_stream(keywords, file); - fclose(stream); - //free_keywords(keywords); - -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -117,6 +117,8 @@ reassign_maps_handler(vector strvec) - static int - multipath_dir_handler(vector strvec) - { -+ if (conf->multipath_dir) -+ FREE(conf->multipath_dir); - conf->multipath_dir = set_value(strvec); - - if (!conf->multipath_dir) -@@ -128,6 +130,8 @@ multipath_dir_handler(vector strvec) - static int - def_selector_handler(vector strvec) - { -+ if (conf->selector) -+ FREE(conf->selector); - conf->selector = set_value(strvec); - - if (!conf->selector) -@@ -155,6 +159,8 @@ def_pgpolicy_handler(vector strvec) - static int - def_uid_attribute_handler(vector strvec) - { -+ if (conf->uid_attribute) -+ FREE(conf->uid_attribute); - conf->uid_attribute = set_value(strvec); - - if (!conf->uid_attribute) -@@ -166,6 +172,8 @@ def_uid_attribute_handler(vector strvec) - static int - def_prio_handler(vector strvec) - { -+ if (conf->prio_name) -+ FREE(conf->prio_name); - conf->prio_name = set_value(strvec); - - if (!conf->prio_name) -@@ -177,6 +185,8 @@ def_prio_handler(vector strvec) - static int - def_alias_prefix_handler(vector strvec) - { -+ if (conf->alias_prefix) -+ FREE(conf->alias_prefix); - conf->alias_prefix = set_value(strvec); - - if (!conf->alias_prefix) -@@ -188,6 +198,8 @@ def_alias_prefix_handler(vector strvec) - static int - def_prio_args_handler(vector strvec) - { -+ if (conf->prio_args) -+ FREE(conf->prio_args); - conf->prio_args = set_value(strvec); - - if (!conf->prio_args) -@@ -199,6 +211,8 @@ def_prio_args_handler(vector strvec) - static int - def_features_handler(vector strvec) - { -+ if (conf->features) -+ FREE(conf->features); - conf->features = set_value(strvec); - - if (!conf->features) -@@ -210,6 +224,8 @@ def_features_handler(vector strvec) - static int - def_path_checker_handler(vector strvec) - { -+ if (conf->checker_name) -+ FREE(conf->checker_name); - conf->checker_name = set_value(strvec); - - if (!conf->checker_name) -@@ -432,6 +448,23 @@ def_no_path_retry_handler(vector strvec) - return 0; - } - -+ -+static int -+def_config_dir_handler(vector strvec) -+{ -+ /* this is only valid in the main config file */ -+ if (conf->processed_main_config) -+ return 0; -+ if (conf->config_dir) -+ FREE(conf->config_dir); -+ conf->config_dir = set_value(strvec); -+ -+ if (!conf->config_dir) -+ return 1; -+ -+ return 0; -+} -+ - static int - def_queue_without_daemon(vector strvec) - { -@@ -611,6 +644,8 @@ def_names_handler(vector strvec) - static int - bindings_file_handler(vector strvec) - { -+ if (conf->bindings_file) -+ FREE(conf->bindings_file); - conf->bindings_file = set_value(strvec); - - if (!conf->bindings_file) -@@ -622,6 +657,8 @@ bindings_file_handler(vector strvec) - static int - wwids_file_handler(vector strvec) - { -+ if (conf->wwids_file) -+ FREE(conf->wwids_file); - conf->wwids_file = set_value(strvec); - - if (!conf->wwids_file) -@@ -770,9 +807,12 @@ def_ignore_new_boot_devs_handler(vector - static int - blacklist_handler(vector strvec) - { -- conf->blist_devnode = vector_alloc(); -- conf->blist_wwid = vector_alloc(); -- conf->blist_device = vector_alloc(); -+ if (!conf->blist_devnode) -+ conf->blist_devnode = vector_alloc(); -+ if (!conf->blist_wwid) -+ conf->blist_wwid = vector_alloc(); -+ if (!conf->blist_device) -+ conf->blist_device = vector_alloc(); - - if (!conf->blist_devnode || !conf->blist_wwid || !conf->blist_device) - return 1; -@@ -783,9 +823,12 @@ blacklist_handler(vector strvec) - static int - blacklist_exceptions_handler(vector strvec) - { -- conf->elist_devnode = vector_alloc(); -- conf->elist_wwid = vector_alloc(); -- conf->elist_device = vector_alloc(); -+ if (!conf->elist_devnode) -+ conf->elist_devnode = vector_alloc(); -+ if (!conf->elist_wwid) -+ conf->elist_wwid = vector_alloc(); -+ if (!conf->elist_device) -+ conf->elist_device = vector_alloc(); - - if (!conf->elist_devnode || !conf->elist_wwid || !conf->elist_device) - return 1; -@@ -1480,7 +1523,8 @@ hw_deferred_remove_handler(vector strvec - static int - multipaths_handler(vector strvec) - { -- conf->mptable = vector_alloc(); -+ if (!conf->mptable) -+ conf->mptable = vector_alloc(); - - if (!conf->mptable) - return 1; -@@ -2945,6 +2989,16 @@ snprint_def_ignore_new_boot_devs(char * - return snprintf(buff, len, "no"); - } - -+ -+static int -+snprint_def_config_dir (char * buff, int len, void * data) -+{ -+ if (!conf->config_dir) -+ return 0; -+ -+ return snprintf(buff, len, "\"%s\"", conf->config_dir); -+} -+ - static int - snprint_ble_simple (char * buff, int len, void * data) - { -@@ -3016,6 +3070,7 @@ init_keywords(void) - install_keyword("force_sync", &def_force_sync_handler, &snprint_def_force_sync); - install_keyword("deferred_remove", &def_deferred_remove_handler, &snprint_def_deferred_remove); - install_keyword("ignore_new_boot_devs", &def_ignore_new_boot_devs_handler, &snprint_def_ignore_new_boot_devs); -+ install_keyword("config_dir", &def_config_dir_handler, &snprint_def_config_dir); - __deprecated install_keyword("default_selector", &def_selector_handler, NULL); - __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); - __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL); -Index: multipath-tools-130222/libmultipath/parser.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/parser.h -+++ multipath-tools-130222/libmultipath/parser.h -@@ -76,9 +76,8 @@ extern int read_line(char *buf, int size - extern vector read_value_block(void); - extern int alloc_value_block(vector strvec, void (*alloc_func) (vector)); - extern void *set_value(vector strvec); --extern int process_stream(vector keywords); - extern int alloc_keywords(void); --extern int init_data(char *conf_file, void (*init_keywords) (void)); -+extern int process_file(char *conf_file); - extern struct keyword * find_keyword(vector v, char * name); - void set_current_keywords (vector *k); - int snprint_keyword(char *buff, int len, char *fmt, struct keyword *kw, -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -6,6 +6,9 @@ - #include - #include - #include -+#include -+#include -+#include - - #include "checkers.h" - #include "memory.h" -@@ -556,6 +559,7 @@ free_config (struct config * conf) - - if (conf->wwids_file) - FREE(conf->wwids_file); -+ - if (conf->prio_name) - FREE(conf->prio_name); - -@@ -567,6 +571,10 @@ free_config (struct config * conf) - - if (conf->checker_name) - FREE(conf->checker_name); -+ -+ if (conf->config_dir) -+ FREE(conf->config_dir); -+ - if (conf->reservation_key) - FREE(conf->reservation_key); - -@@ -584,6 +592,43 @@ free_config (struct config * conf) - FREE(conf); - } - -+/* if multipath fails to process the config directory, it should continue, -+ * with just a warning message */ -+static void -+process_config_dir(vector keywords, char *dir) -+{ -+ struct dirent **namelist; -+ int i, n; -+ char path[LINE_MAX]; -+ int old_hwtable_size; -+ -+ if (dir[0] != '/') { -+ condlog(1, "config_dir '%s' must be a fully qualified path", -+ dir); -+ return; -+ } -+ n = scandir(dir, &namelist, NULL, alphasort); -+ if (n < 0) { -+ if (errno == ENOENT) -+ condlog(3, "No configuration dir '%s'", dir); -+ else -+ condlog(0, "couldn't open configuration dir '%s': %s", -+ dir, strerror(errno)); -+ return; -+ } -+ for (i = 0; i < n; i++) { -+ if (!strstr(namelist[i]->d_name, ".conf")) -+ continue; -+ old_hwtable_size = VECTOR_SIZE(conf->hwtable); -+ snprintf(path, LINE_MAX, "%s/%s", dir, namelist[i]->d_name); -+ path[LINE_MAX-1] = '\0'; -+ process_file(path); -+ if (VECTOR_SIZE(conf->hwtable) > old_hwtable_size) -+ factorize_hwtable(conf->hwtable, old_hwtable_size); -+ -+ } -+} -+ - int - load_config (char * file, struct udev *udev) - { -@@ -623,6 +668,7 @@ load_config (char * file, struct udev *u - conf->hw_strmatch = 0; - conf->force_sync = 0; - conf->ignore_new_boot_devs = 0; -+ conf->processed_main_config = 0; - - /* - * preload default hwtable -@@ -641,11 +687,12 @@ load_config (char * file, struct udev *u - */ - set_current_keywords(&conf->keywords); - alloc_keywords(); -+ init_keywords(); - if (filepresent(file)) { - int builtin_hwtable_size; - - builtin_hwtable_size = VECTOR_SIZE(conf->hwtable); -- if (init_data(file, init_keywords)) { -+ if (process_file(file)) { - condlog(0, "error parsing config file"); - goto out; - } -@@ -658,7 +705,6 @@ load_config (char * file, struct udev *u - } - - } else { -- init_keywords(); - condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); - condlog(0, "run \"/sbin/mpathconf --enable\" to create a default /etc/multipath.conf"); - if (conf->blist_devnode == NULL) { -@@ -675,6 +721,12 @@ load_config (char * file, struct udev *u - } - } - -+ conf->processed_main_config = 1; -+ if (conf->config_dir == NULL) -+ conf->config_dir = set_default(DEFAULT_CONFIG_DIR); -+ if (conf->config_dir && conf->config_dir[0] != '\0') -+ process_config_dir(conf->keywords, conf->config_dir); -+ - /* - * fill the voids left in the config file - */ -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -132,6 +132,7 @@ struct config { - int force_sync; - int deferred_remove; - int ignore_new_boot_devs; -+ int processed_main_config; - unsigned int version[3]; - - char * dev; -@@ -147,6 +148,7 @@ struct config { - char * prio_args; - char * checker_name; - char * alias_prefix; -+ char * config_dir; - unsigned char * reservation_key; - - vector keywords; -Index: multipath-tools-130222/libmultipath/defaults.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/defaults.h -+++ multipath-tools-130222/libmultipath/defaults.h -@@ -31,5 +31,6 @@ - #define DEFAULT_CONFIGFILE "/etc/multipath.conf" - #define DEFAULT_BINDINGS_FILE "/etc/multipath/bindings" - #define DEFAULT_WWIDS_FILE "/etc/multipath/wwids" -+#define DEFAULT_CONFIG_DIR "/etc/multipath/conf.d" - - char * set_default (char * str); -Index: multipath-tools-130222/multipath.conf.annotated -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.annotated -+++ multipath-tools-130222/multipath.conf.annotated -@@ -232,6 +232,16 @@ - # # values : yes|no - # # default : no - # force_sync yes -+# -+# # -+# # name : config_dir -+# # scope : multipath & multipathd -+# # desc : If not set to an empty string, multipath will search -+# # this directory alphabetically for files ending in ".conf" -+# # and it will read configuration information from these -+# # files, just as if it was in /etc/multipath.conf -+# # values : "" or a fully qualified pathname -+# # default : "/etc/multipath/conf.d" - #} - # - ## -Index: multipath-tools-130222/multipath.conf.defaults -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.defaults -+++ multipath-tools-130222/multipath.conf.defaults -@@ -26,6 +26,7 @@ - # log_checker_err always - # retain_attached_hw_handler no - # detect_prio no -+# config_dir "/etc/multipath/conf.d" - #} - #blacklist { - # devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -452,6 +452,13 @@ still in use, it will be freed when the - to the multipath device before the last user closes it, the deferred remove - will be canceled. Default is - .I no -+.TP -+.B config_dir -+If set to anything other than "", multipath will search this directory -+alphabetically for file ending in ".conf" and it will read configuration -+information from them, just as if it was in /etc/multipath.conf. config_dir -+must either be "" or a fully qualified directory name. Default is -+.I "/etc/multipath/conf.d" - . - .SH "blacklist section" - The diff --git a/0113-RHBZ-1194917-cleanup.patch b/0113-RHBZ-1194917-cleanup.patch deleted file mode 100644 index cf95c98..0000000 --- a/0113-RHBZ-1194917-cleanup.patch +++ /dev/null @@ -1,185 +0,0 @@ ---- - libmultipath/parser.c | 103 +++----------------------------------------------- - libmultipath/parser.h | 6 -- - 2 files changed, 8 insertions(+), 101 deletions(-) - -Index: multipath-tools-130222/libmultipath/parser.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/parser.c -+++ multipath-tools-130222/libmultipath/parser.c -@@ -280,8 +280,8 @@ out: - return NULL; - } - --int --read_line(char *buf, int size) -+static int -+read_line(FILE *stream, char *buf, int size) - { - int ch; - int count = 0; -@@ -297,95 +297,6 @@ read_line(char *buf, int size) - return (ch == EOF) ? 0 : 1; - } - --vector --read_value_block(void) --{ -- char *buf; -- int i; -- char *str = NULL; -- char *dup; -- vector vec = NULL; -- vector elements = vector_alloc(); -- -- if (!elements) -- return NULL; -- -- buf = (char *) MALLOC(MAXBUF); -- -- if (!buf) { -- vector_free(elements); -- return NULL; -- } -- -- while (read_line(buf, MAXBUF)) { -- vec = alloc_strvec(buf); -- if (vec) { -- str = VECTOR_SLOT(vec, 0); -- if (!strcmp(str, EOB)) { -- free_strvec(vec); -- break; -- } -- -- for (i = 0; i < VECTOR_SIZE(vec); i++) { -- str = VECTOR_SLOT(vec, i); -- dup = (char *) MALLOC(strlen(str) + 1); -- if (!dup) -- goto out; -- memcpy(dup, str, strlen(str)); -- -- if (!vector_alloc_slot(elements)) { -- free_strvec(vec); -- goto out1; -- } -- -- vector_set_slot(elements, dup); -- } -- free_strvec(vec); -- } -- memset(buf, 0, MAXBUF); -- } -- FREE(buf); -- return elements; --out1: -- FREE(dup); --out: -- FREE(buf); -- vector_free(elements); -- return NULL; --} -- --int --alloc_value_block(vector strvec, void (*alloc_func) (vector)) --{ -- char *buf; -- char *str = NULL; -- vector vec = NULL; -- -- buf = (char *) MALLOC(MAXBUF); -- -- if (!buf) -- return 1; -- -- while (read_line(buf, MAXBUF)) { -- vec = alloc_strvec(buf); -- if (vec) { -- str = VECTOR_SLOT(vec, 0); -- if (!strcmp(str, EOB)) { -- free_strvec(vec); -- break; -- } -- -- if (VECTOR_SIZE(vec)) -- (*alloc_func) (vec); -- -- free_strvec(vec); -- } -- memset(buf, 0, MAXBUF); -- } -- FREE(buf); -- return 0; --} -- - void * - set_value(vector strvec) - { -@@ -561,7 +472,7 @@ validate_config_strvec(vector strvec, ch - } - - static int --process_stream(vector keywords, char *file) -+process_stream(FILE *stream, vector keywords, char *file) - { - int i; - int r = 0; -@@ -582,7 +493,7 @@ process_stream(vector keywords, char *fi - return 1; - } - -- while (read_line(buf, MAXBUF)) { -+ while (read_line(stream, buf, MAXBUF)) { - line_nr++; - strvec = alloc_strvec(buf); - memset(buf,0, MAXBUF); -@@ -621,7 +532,8 @@ process_stream(vector keywords, char *fi - - if (keyword->sub) { - kw_level++; -- r += process_stream(keyword->sub, file); -+ r += process_stream(stream, -+ keyword->sub, file); - kw_level--; - } - break; -@@ -656,6 +568,7 @@ int - process_file(char *file) - { - int r; -+ FILE *stream; - - if (!keywords) { - condlog(0, "No keywords alocated"); -@@ -670,7 +583,7 @@ process_file(char *file) - - /* Stream handling */ - line_nr = 0; -- r = process_stream(keywords, file); -+ r = process_stream(stream, keywords, file); - fclose(stream); - //free_keywords(keywords); - -Index: multipath-tools-130222/libmultipath/parser.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/parser.h -+++ multipath-tools-130222/libmultipath/parser.h -@@ -47,9 +47,6 @@ struct keyword { - int unique; - }; - --/* global var exported */ --FILE *stream; -- - /* Reloading helpers */ - #define SET_RELOAD (reload = 1) - #define UNSET_RELOAD (reload = 0) -@@ -72,9 +69,6 @@ extern int _install_keyword(char *string - extern void dump_keywords(vector keydump, int level); - extern void free_keywords(vector keywords); - extern vector alloc_strvec(char *string); --extern int read_line(char *buf, int size); --extern vector read_value_block(void); --extern int alloc_value_block(vector strvec, void (*alloc_func) (vector)); - extern void *set_value(vector strvec); - extern int alloc_keywords(void); - extern int process_file(char *conf_file); diff --git a/0114-RHBZ-1196394-delayed-reintegration.patch b/0114-RHBZ-1196394-delayed-reintegration.patch deleted file mode 100644 index b0647a5..0000000 --- a/0114-RHBZ-1196394-delayed-reintegration.patch +++ /dev/null @@ -1,744 +0,0 @@ ---- - libmultipath/checkers.c | 3 - libmultipath/checkers.h | 9 + - libmultipath/config.c | 4 - libmultipath/config.h | 6 + - libmultipath/configure.c | 2 - libmultipath/defaults.h | 1 - libmultipath/dict.c | 204 ++++++++++++++++++++++++++++++++++++++++++++- - libmultipath/print.c | 2 - libmultipath/propsel.c | 52 +++++++++++ - libmultipath/propsel.h | 2 - libmultipath/structs.h | 9 + - multipath.conf.annotated | 40 ++++++++ - multipath.conf.defaults | 2 - multipath/multipath.conf.5 | 27 +++++ - multipathd/main.c | 34 ++++++- - 15 files changed, 388 insertions(+), 9 deletions(-) - -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -62,6 +62,8 @@ struct hwentry { - int retain_hwhandler; - int detect_prio; - int deferred_remove; -+ int delay_watch_checks; -+ int delay_wait_checks; - char * bl_product; - }; - -@@ -86,6 +88,8 @@ struct mpentry { - int attribute_flags; - int user_friendly_names; - int deferred_remove; -+ int delay_watch_checks; -+ int delay_wait_checks; - uid_t uid; - gid_t gid; - mode_t mode; -@@ -133,6 +137,8 @@ struct config { - int deferred_remove; - int ignore_new_boot_devs; - int processed_main_config; -+ int delay_watch_checks; -+ int delay_wait_checks; - unsigned int version[3]; - - char * dev; -Index: multipath-tools-130222/libmultipath/structs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.h -+++ multipath-tools-130222/libmultipath/structs.h -@@ -134,6 +134,11 @@ enum scsi_protocol { - SCSI_PROTOCOL_UNSPEC = 0xf, /* No specific protocol */ - }; - -+enum delay_checks_states { -+ DELAY_CHECKS_OFF = -1, -+ DELAY_CHECKS_UNDEF = 0, -+}; -+ - struct sg_id { - int host_no; - int channel; -@@ -180,6 +185,8 @@ struct path { - int priority; - int pgindex; - int detect_prio; -+ int watch_checks; -+ int wait_checks; - char * uid_attribute; - struct prio prio; - char * prio_args; -@@ -215,6 +222,8 @@ struct multipath { - int fast_io_fail; - int retain_hwhandler; - int deferred_remove; -+ int delay_watch_checks; -+ int delay_wait_checks; - unsigned int dev_loss; - uid_t uid; - gid_t gid; -Index: multipath-tools-130222/libmultipath/checkers.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/checkers.h -+++ multipath-tools-130222/libmultipath/checkers.h -@@ -46,6 +46,14 @@ - * PATH_PENDING: - * - Use: All async checkers - * - Description: Indicates a check IO is in flight. -+ * -+ * PATH_DELAYED: -+ * - Use: None of the checkers (returned if the path is being delayed before -+ * reintegration. -+ * - Description: If a path fails after being up for less than -+ * delay_watch_checks checks, when it comes back up again, it will not -+ * be marked as up until it has been up for delay_wait_checks checks. -+ * During this time, it is marked as "delayed" - */ - enum path_check_state { - PATH_WILD, -@@ -55,6 +63,7 @@ enum path_check_state { - PATH_SHAKY, - PATH_GHOST, - PATH_PENDING, -+ PATH_DELAYED, - PATH_MAX_STATE - }; - -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -291,6 +291,8 @@ setup_map (struct multipath * mpp, char - select_reservation_key(mpp); - select_retain_hwhandler(mpp); - select_deferred_remove(mpp); -+ select_delay_watch_checks(mpp); -+ select_delay_wait_checks(mpp); - - sysfs_set_scsi_tmo(mpp); - /* -Index: multipath-tools-130222/libmultipath/defaults.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/defaults.h -+++ multipath-tools-130222/libmultipath/defaults.h -@@ -20,6 +20,7 @@ - #define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_OFF - #define DEFAULT_DETECT_PRIO DETECT_PRIO_OFF - #define DEFAULT_DEFERRED_REMOVE DEFERRED_REMOVE_OFF -+#define DEFAULT_DELAY_CHECKS DELAY_CHECKS_OFF - - #define DEFAULT_CHECKINT 5 - #define MAX_CHECKINT(a) (a << 2) -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -801,6 +801,44 @@ def_ignore_new_boot_devs_handler(vector - return 0; - } - -+static int -+def_delay_watch_checks_handler(vector strvec) -+{ -+ char * buff; -+ -+ buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ conf->delay_watch_checks = DELAY_CHECKS_OFF; -+ else if ((conf->delay_watch_checks = atoi(buff)) < 1) -+ conf->delay_watch_checks = DELAY_CHECKS_OFF; -+ -+ FREE(buff); -+ return 0; -+} -+ -+static int -+def_delay_wait_checks_handler(vector strvec) -+{ -+ char * buff; -+ -+ buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ conf->delay_wait_checks = DELAY_CHECKS_OFF; -+ else if ((conf->delay_wait_checks = atoi(buff)) < 1) -+ conf->delay_wait_checks = DELAY_CHECKS_OFF; -+ -+ FREE(buff); -+ return 0; -+} -+ - /* - * blacklist block handlers - */ -@@ -1517,6 +1555,52 @@ hw_deferred_remove_handler(vector strvec - return 0; - } - -+static int -+hw_delay_watch_checks_handler(vector strvec) -+{ -+ struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable); -+ char * buff; -+ -+ if (!hwe) -+ return 1; -+ -+ buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ hwe->delay_watch_checks = DELAY_CHECKS_OFF; -+ else if ((hwe->delay_watch_checks = atoi(buff)) < 1) -+ hwe->delay_watch_checks = DELAY_CHECKS_OFF; -+ -+ FREE(buff); -+ return 0; -+} -+ -+static int -+hw_delay_wait_checks_handler(vector strvec) -+{ -+ struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable); -+ char * buff; -+ -+ if (!hwe) -+ return 1; -+ -+ buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ hwe->delay_wait_checks = DELAY_CHECKS_OFF; -+ else if ((hwe->delay_wait_checks = atoi(buff)) < 1) -+ hwe->delay_wait_checks = DELAY_CHECKS_OFF; -+ -+ FREE(buff); -+ return 0; -+} -+ - /* - * multipaths block handlers - */ -@@ -1996,6 +2080,52 @@ mp_deferred_remove_handler(vector strvec - return 0; - } - -+static int -+mp_delay_watch_checks_handler(vector strvec) -+{ -+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable); -+ char * buff; -+ -+ if (!mpe) -+ return 1; -+ -+ buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ mpe->delay_watch_checks = DELAY_CHECKS_OFF; -+ else if ((mpe->delay_watch_checks = atoi(buff)) < 1) -+ mpe->delay_watch_checks = DELAY_CHECKS_OFF; -+ -+ FREE(buff); -+ return 0; -+} -+ -+static int -+mp_delay_wait_checks_handler(vector strvec) -+{ -+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable); -+ char * buff; -+ -+ if (!mpe) -+ return 1; -+ -+ buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ mpe->delay_wait_checks = DELAY_CHECKS_OFF; -+ else if ((mpe->delay_wait_checks = atoi(buff)) < 1) -+ mpe->delay_wait_checks = DELAY_CHECKS_OFF; -+ -+ FREE(buff); -+ return 0; -+} -+ - /* - * config file keywords printing - */ -@@ -2258,6 +2388,30 @@ snprint_mp_deferred_remove (char * buff, - } - - static int -+snprint_mp_delay_watch_checks(char * buff, int len, void * data) -+{ -+ struct mpentry * mpe = (struct mpentry *)data; -+ -+ if (mpe->delay_watch_checks == DELAY_CHECKS_UNDEF) -+ return 0; -+ if (mpe->delay_watch_checks == DELAY_CHECKS_OFF) -+ return snprintf(buff, len, "no"); -+ return snprintf(buff, len, "%d", mpe->delay_watch_checks); -+} -+ -+static int -+snprint_mp_delay_wait_checks(char * buff, int len, void * data) -+{ -+ struct mpentry * mpe = (struct mpentry *)data; -+ -+ if (mpe->delay_wait_checks == DELAY_CHECKS_UNDEF) -+ return 0; -+ if (mpe->delay_wait_checks == DELAY_CHECKS_OFF) -+ return snprintf(buff, len, "no"); -+ return snprintf(buff, len, "%d", mpe->delay_wait_checks); -+} -+ -+static int - snprint_hw_fast_io_fail(char * buff, int len, void * data) - { - struct hwentry * hwe = (struct hwentry *)data; -@@ -2586,6 +2740,30 @@ snprint_hw_deferred_remove(char * buff, - } - - static int -+snprint_hw_delay_watch_checks(char * buff, int len, void * data) -+{ -+ struct hwentry * hwe = (struct hwentry *)data; -+ -+ if (hwe->delay_watch_checks == DELAY_CHECKS_UNDEF) -+ return 0; -+ if (hwe->delay_watch_checks == DELAY_CHECKS_OFF) -+ return snprintf(buff, len, "no"); -+ return snprintf(buff, len, "%d", hwe->delay_watch_checks); -+} -+ -+static int -+snprint_hw_delay_wait_checks(char * buff, int len, void * data) -+{ -+ struct hwentry * hwe = (struct hwentry *)data; -+ -+ if (hwe->delay_wait_checks == DELAY_CHECKS_UNDEF) -+ return 0; -+ if (hwe->delay_wait_checks == DELAY_CHECKS_OFF) -+ return snprintf(buff, len, "no"); -+ return snprintf(buff, len, "%d", hwe->delay_wait_checks); -+} -+ -+static int - snprint_detect_prio(char * buff, int len, void * data) - { - struct hwentry * hwe = (struct hwentry *)data; -@@ -2883,7 +3061,6 @@ snprint_def_find_multipaths (char * buff - return snprintf(buff, len, "yes"); - } - -- - static int - snprint_def_user_friendly_names (char * buff, int len, void * data) - { -@@ -2989,7 +3166,6 @@ snprint_def_ignore_new_boot_devs(char * - return snprintf(buff, len, "no"); - } - -- - static int - snprint_def_config_dir (char * buff, int len, void * data) - { -@@ -3000,6 +3176,24 @@ snprint_def_config_dir (char * buff, int - } - - static int -+snprint_def_delay_watch_checks(char * buff, int len, void * data) -+{ -+ if (conf->delay_watch_checks == DELAY_CHECKS_UNDEF || -+ conf->delay_watch_checks == DELAY_CHECKS_OFF) -+ return snprintf(buff, len, "no"); -+ return snprintf(buff, len, "%d", conf->delay_watch_checks); -+} -+ -+static int -+snprint_def_delay_wait_checks(char * buff, int len, void * data) -+{ -+ if (conf->delay_wait_checks == DELAY_CHECKS_UNDEF || -+ conf->delay_wait_checks == DELAY_CHECKS_OFF) -+ return snprintf(buff, len, "no"); -+ return snprintf(buff, len, "%d", conf->delay_wait_checks); -+} -+ -+static int - snprint_ble_simple (char * buff, int len, void * data) - { - struct blentry * ble = (struct blentry *)data; -@@ -3071,6 +3265,8 @@ init_keywords(void) - install_keyword("deferred_remove", &def_deferred_remove_handler, &snprint_def_deferred_remove); - install_keyword("ignore_new_boot_devs", &def_ignore_new_boot_devs_handler, &snprint_def_ignore_new_boot_devs); - install_keyword("config_dir", &def_config_dir_handler, &snprint_def_config_dir); -+ install_keyword("delay_watch_checks", &def_delay_watch_checks_handler, &snprint_def_delay_watch_checks); -+ install_keyword("delay_wait_checks", &def_delay_wait_checks_handler, &snprint_def_delay_wait_checks); - __deprecated install_keyword("default_selector", &def_selector_handler, NULL); - __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); - __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL); -@@ -3136,6 +3332,8 @@ init_keywords(void) - install_keyword("retain_attached_hw_handler", &hw_retain_hwhandler_handler, &snprint_hw_retain_hwhandler_handler); - install_keyword("detect_prio", &hw_detect_prio_handler, &snprint_detect_prio); - install_keyword("deferred_remove", &hw_deferred_remove_handler, &snprint_hw_deferred_remove); -+ install_keyword("delay_watch_checks", &hw_delay_watch_checks_handler, &snprint_hw_delay_watch_checks); -+ install_keyword("delay_wait_checks", &hw_delay_wait_checks_handler, &snprint_hw_delay_wait_checks); - install_sublevel_end(); - - install_keyword_root("multipaths", &multipaths_handler); -@@ -3161,5 +3359,7 @@ init_keywords(void) - install_keyword("reservation_key", &mp_reservation_key_handler, &snprint_mp_reservation_key); - install_keyword("user_friendly_names", &mp_names_handler, &snprint_mp_user_friendly_names); - install_keyword("deferred_remove", &mp_deferred_remove_handler, &snprint_mp_deferred_remove); -+ install_keyword("delay_watch_checks", &mp_delay_watch_checks_handler, &snprint_mp_delay_watch_checks); -+ install_keyword("delay_wait_checks", &mp_delay_wait_checks_handler, &snprint_mp_delay_wait_checks); - install_sublevel_end(); - } -Index: multipath-tools-130222/libmultipath/print.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.c -+++ multipath-tools-130222/libmultipath/print.c -@@ -336,6 +336,8 @@ snprint_chk_state (char * buff, size_t l - return snprintf(buff, len, "shaky"); - case PATH_GHOST: - return snprintf(buff, len, "ghost"); -+ case PATH_DELAYED: -+ return snprintf(buff, len, "delayed"); - default: - return snprintf(buff, len, "undef"); - } -Index: multipath-tools-130222/libmultipath/propsel.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.c -+++ multipath-tools-130222/libmultipath/propsel.c -@@ -788,3 +788,55 @@ select_detect_prio (struct path * pp) - condlog(3, "%s: detect_prio = %d (compiled in default)", pp->dev, pp->detect_prio); - return 0; - } -+ -+extern int -+select_delay_watch_checks (struct multipath * mp) -+{ -+ if (mp->mpe && mp->mpe->delay_watch_checks != DELAY_CHECKS_UNDEF) { -+ mp->delay_watch_checks = mp->mpe->delay_watch_checks; -+ condlog(3, "delay_watch_checks = %i (multipath setting)", -+ mp->delay_watch_checks); -+ return 0; -+ } -+ if (mp->hwe && mp->hwe->delay_watch_checks != DELAY_CHECKS_UNDEF) { -+ mp->delay_watch_checks = mp->hwe->delay_watch_checks; -+ condlog(3, "delay_watch_checks = %i (controler setting)", -+ mp->delay_watch_checks); -+ return 0; -+ } -+ if (conf->delay_watch_checks != DELAY_CHECKS_UNDEF) { -+ mp->delay_watch_checks = conf->delay_watch_checks; -+ condlog(3, "delay_watch_checks = %i (config file default)", -+ mp->delay_watch_checks); -+ return 0; -+ } -+ mp->delay_watch_checks = DEFAULT_DELAY_CHECKS; -+ condlog(3, "delay_watch_checks = DISABLED (internal default)"); -+ return 0; -+} -+ -+extern int -+select_delay_wait_checks (struct multipath * mp) -+{ -+ if (mp->mpe && mp->mpe->delay_wait_checks != DELAY_CHECKS_UNDEF) { -+ mp->delay_wait_checks = mp->mpe->delay_wait_checks; -+ condlog(3, "delay_wait_checks = %i (multipath setting)", -+ mp->delay_wait_checks); -+ return 0; -+ } -+ if (mp->hwe && mp->hwe->delay_wait_checks != DELAY_CHECKS_UNDEF) { -+ mp->delay_wait_checks = mp->hwe->delay_wait_checks; -+ condlog(3, "delay_wait_checks = %i (controler setting)", -+ mp->delay_wait_checks); -+ return 0; -+ } -+ if (conf->delay_wait_checks != DELAY_CHECKS_UNDEF) { -+ mp->delay_wait_checks = conf->delay_wait_checks; -+ condlog(3, "delay_wait_checks = %i (config file default)", -+ mp->delay_wait_checks); -+ return 0; -+ } -+ mp->delay_wait_checks = DEFAULT_DELAY_CHECKS; -+ condlog(3, "delay_wait_checks = DISABLED (internal default)"); -+ return 0; -+} -Index: multipath-tools-130222/libmultipath/propsel.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.h -+++ multipath-tools-130222/libmultipath/propsel.h -@@ -21,3 +21,5 @@ int select_reservation_key(struct multip - int select_retain_hwhandler (struct multipath * mp); - int select_detect_prio(struct path * pp); - int select_deferred_remove(struct multipath *mp); -+int select_delay_watch_checks (struct multipath * mp); -+int select_delay_wait_checks (struct multipath * mp); -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -188,7 +188,8 @@ sync_map_state(struct multipath *mpp) - vector_foreach_slot (mpp->pg, pgp, i){ - vector_foreach_slot (pgp->paths, pp, j){ - if (pp->state == PATH_UNCHECKED || -- pp->state == PATH_WILD) -+ pp->state == PATH_WILD || -+ pp->state == PATH_DELAYED) - continue; - if ((pp->dmstate == PSTATE_FAILED || - pp->dmstate == PSTATE_UNDEF) && -@@ -1165,6 +1166,16 @@ check_path (struct vectors * vecs, struc - if (!pp->mpp) - return; - -+ if ((newstate == PATH_UP || newstate == PATH_GHOST) && -+ pp->wait_checks > 0) { -+ if (pp->mpp && pp->mpp->nr_active > 0) { -+ pp->state = PATH_DELAYED; -+ pp->wait_checks--; -+ return; -+ } else -+ pp->wait_checks = 0; -+ } -+ - pp->chkrstate = newstate; - if (newstate != pp->state) { - int oldstate = pp->state; -@@ -1182,9 +1193,14 @@ check_path (struct vectors * vecs, struc - * proactively fail path in the DM - */ - if (oldstate == PATH_UP || -- oldstate == PATH_GHOST) -+ oldstate == PATH_GHOST) { - fail_path(pp, 1); -- else -+ if (pp->mpp->delay_wait_checks > 0 && -+ pp->watch_checks > 0) { -+ pp->wait_checks = pp->mpp->delay_wait_checks; -+ pp->watch_checks = 0; -+ } -+ }else - fail_path(pp, 0); - - /* -@@ -1211,11 +1227,15 @@ check_path (struct vectors * vecs, struc - * reinstate this path - */ - if (oldstate != PATH_UP && -- oldstate != PATH_GHOST) -+ oldstate != PATH_GHOST) { -+ if (pp->mpp->delay_watch_checks > 0) -+ pp->watch_checks = pp->mpp->delay_watch_checks; - reinstate_path(pp, 1); -- else -+ } else { -+ if (pp->watch_checks > 0) -+ pp->watch_checks--; - reinstate_path(pp, 0); -- -+ } - new_path_up = 1; - - if (oldchkrstate != PATH_UP && oldchkrstate != PATH_GHOST) -@@ -1245,6 +1265,8 @@ check_path (struct vectors * vecs, struc - else - pp->checkint = conf->max_checkint; - } -+ if (pp->watch_checks > 0) -+ pp->watch_checks--; - pp->tick = pp->checkint; - condlog(4, "%s: delay next check %is", - pp->dev_t, pp->tick); -Index: multipath-tools-130222/multipath.conf.annotated -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.annotated -+++ multipath-tools-130222/multipath.conf.annotated -@@ -242,6 +242,30 @@ - # # files, just as if it was in /etc/multipath.conf - # # values : "" or a fully qualified pathname - # # default : "/etc/multipath/conf.d" -+# -+# # -+# # name : delay_watch_checks -+# # scope : multipathd -+# # desc : If set to a value greater than 0, multipathd will watch -+# # paths that have recently become valid for this many -+# # checks. If they fail again while they are being watched, -+# # when they next become valid, they will not be used until -+# # they have stayed up for delay_wait_checks checks. -+# # values : no| > 0 -+# # default : no -+# delay_watch_checks 12 -+# -+# # -+# # name : delay_wait_checks -+# # scope : multipathd -+# # desc : If set to a value greater than 0, when a device that has -+# # recently come back online fails again within -+# # delay_watch_checks checks, the next time it comes back -+# # online, it will marked and delayed, and not used until -+# # it has passed delay_wait_checks checks. -+# # values : no| > 0 -+# # default : no -+# delay_wait_checks 12 - #} - # - ## -@@ -383,6 +407,13 @@ - # # - # flush_on_last_del yes - # -+# # -+# # name : delay_watch_checks -+# # See defualts section for information. -+# -+# # -+# # name : delay_wait_checks -+# # See defualts section for information. - # } - # multipath { - # wwid 1DEC_____321816758474 -@@ -566,6 +597,15 @@ - # # before removing it from the system. - # # values : n > 0 - # dev_loss_tmo 600 -+# -+# # -+# # name : delay_watch_checks -+# # See defaults section for information. -+# -+# # -+# # name : delay_wait_checks -+# # See defaults section for information. -+# - # } - # device { - # vendor "COMPAQ " -Index: multipath-tools-130222/multipath.conf.defaults -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.defaults -+++ multipath-tools-130222/multipath.conf.defaults -@@ -27,6 +27,8 @@ - # retain_attached_hw_handler no - # detect_prio no - # config_dir "/etc/multipath/conf.d" -+# delay_watch_checks no -+# delay_wait_checks no - #} - #blacklist { - # devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -459,6 +459,25 @@ alphabetically for file ending in ".conf - information from them, just as if it was in /etc/multipath.conf. config_dir - must either be "" or a fully qualified directory name. Default is - .I "/etc/multipath/conf.d" -+.TP -+.B delay_watch_checks -+If set to a value greater than 0, multipathd will watch paths that have -+recently become valid for this many checks. If they fail again while they are -+being watched, when they next become valid, they will not be used until they -+have stayed up for -+.I delay_wait_checks -+checks. Default is -+.I no -+.TP -+.B delay_wait_checks -+If set to a value greater than 0, when a device that has recently come back -+online fails again within -+.I delay_watch_checks -+checks, the next time it comes back online, it will marked and delayed, and not -+used until it has passed -+.I delay_wait_checks -+checks. Default is -+.I no - . - .SH "blacklist section" - The -@@ -562,6 +581,10 @@ section: - .B reservation_key - .TP - .B deferred_remove -+.TP -+.B delay_watch_checks -+.TP -+.B delay_wait_checks - .RE - .PD - .LP -@@ -654,6 +677,10 @@ section: - .B detect_prio - .TP - .B deferred_remove -+.TP -+.B delay_watch_checks -+.TP -+.B delay_wait_checks - .RE - .PD - .LP -Index: multipath-tools-130222/libmultipath/checkers.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/checkers.c -+++ multipath-tools-130222/libmultipath/checkers.c -@@ -16,7 +16,8 @@ char *checker_state_names[] = { - "up", - "shaky", - "ghost", -- "pending" -+ "pending", -+ "delayed" - }; - - static LIST_HEAD(checkers); -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -341,6 +341,8 @@ merge_hwe (struct hwentry * dst, struct - merge_num(retain_hwhandler); - merge_num(detect_prio); - merge_num(deferred_remove); -+ merge_num(delay_watch_checks); -+ merge_num(delay_wait_checks); - - /* - * Make sure features is consistent with -@@ -399,6 +401,8 @@ overwrite_hwe (struct hwentry * dst, str - overwrite_num(retain_hwhandler); - overwrite_num(detect_prio); - overwrite_num(deferred_remove); -+ overwrite_num(delay_watch_checks); -+ overwrite_num(delay_wait_checks); - - /* - * Make sure features is consistent with diff --git a/0115-RHBZ-1198418-fix-double-free.patch b/0115-RHBZ-1198418-fix-double-free.patch deleted file mode 100644 index a403760..0000000 --- a/0115-RHBZ-1198418-fix-double-free.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- - multipathd/main.c | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -310,10 +310,15 @@ ev_add_map (char * dev, char * alias, st - /* - * now we can register the map - */ -- if (map_present && (mpp = add_map_without_path(vecs, alias))) { -- sync_map_state(mpp); -- condlog(2, "%s: devmap %s registered", alias, dev); -- return 0; -+ if (map_present) { -+ if ((mpp = add_map_without_path(vecs, alias))) { -+ sync_map_state(mpp); -+ condlog(2, "%s: devmap %s registered", alias, dev); -+ return 0; -+ } else { -+ condlog(2, "%s: uev_add_map failed", dev); -+ return 1; -+ } - } - r = get_refwwid(dev, DEV_DEVMAP, vecs->pathvec, &refwwid); - diff --git a/0116-UPBZ-1188179-dell-36xxi.patch b/0116-UPBZ-1188179-dell-36xxi.patch deleted file mode 100644 index e32118b..0000000 --- a/0116-UPBZ-1188179-dell-36xxi.patch +++ /dev/null @@ -1,83 +0,0 @@ ---- - libmultipath/hwtable.c | 30 ++++++++++++++++++++++++++++++ - multipath.conf.defaults | 26 ++++++++++++++++++++++++++ - 2 files changed, 56 insertions(+) - -Index: multipath-tools-130222/libmultipath/hwtable.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/hwtable.c -+++ multipath-tools-130222/libmultipath/hwtable.c -@@ -772,6 +772,36 @@ static struct hwentry default_hw[] = { - .prio_name = PRIO_RDAC, - .prio_args = NULL, - }, -+ { -+ /* DELL MD36xxi */ -+ .vendor = "DELL", -+ .product = "MD36xxi", -+ .bl_product = "Universal Xport", -+ .features = "2 pg_init_retries 50", -+ .hwhandler = "1 rdac", -+ .pgpolicy = GROUP_BY_PRIO, -+ .pgfailback = -FAILBACK_IMMEDIATE, -+ .rr_weight = RR_WEIGHT_NONE, -+ .no_path_retry = 15, -+ .checker_name = RDAC, -+ .prio_name = PRIO_RDAC, -+ .prio_args = NULL, -+ }, -+ { -+ /* DELL MD36xxf */ -+ .vendor = "DELL", -+ .product = "MD36xxf", -+ .bl_product = "Universal Xport", -+ .features = "2 pg_init_retries 50", -+ .hwhandler = "1 rdac", -+ .pgpolicy = GROUP_BY_PRIO, -+ .pgfailback = -FAILBACK_IMMEDIATE, -+ .rr_weight = RR_WEIGHT_NONE, -+ .no_path_retry = 15, -+ .checker_name = RDAC, -+ .prio_name = PRIO_RDAC, -+ .prio_args = NULL, -+ }, - /* - * NETAPP controller family - * -Index: multipath-tools-130222/multipath.conf.defaults -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.defaults -+++ multipath-tools-130222/multipath.conf.defaults -@@ -655,6 +655,32 @@ - # no_path_retry 15 - # } - # device { -+# vendor "DELL" -+# product "MD36xxi" -+# product_blacklist "Universal Xport" -+# path_grouping_policy "group_by_prio" -+# path_checker "rdac" -+# features "2 pg_init_retries 50" -+# hardware_handler "1 rdac" -+# prio "rdac" -+# failback "immediate" -+# rr_weight "uniform" -+# no_path_retry 15 -+# } -+# device { -+# vendor "DELL" -+# product "MD36xxf" -+# product_blacklist "Universal Xport" -+# path_grouping_policy "group_by_prio" -+# path_checker "rdac" -+# features "2 pg_init_retries 50" -+# hardware_handler "1 rdac" -+# prio "rdac" -+# failback "immediate" -+# rr_weight "uniform" -+# no_path_retry 15 -+# } -+# device { - # vendor "NETAPP" - # product "LUN.*" - # path_grouping_policy "group_by_prio" diff --git a/0117-RHBZ-1198424-autodetect-clariion-alua.patch b/0117-RHBZ-1198424-autodetect-clariion-alua.patch deleted file mode 100644 index 64a302d..0000000 --- a/0117-RHBZ-1198424-autodetect-clariion-alua.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- - libmultipath/hwtable.c | 2 ++ - multipath.conf.defaults | 2 ++ - 2 files changed, 4 insertions(+) - -Index: multipath-tools-130222/libmultipath/hwtable.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/hwtable.c -+++ multipath-tools-130222/libmultipath/hwtable.c -@@ -272,6 +272,8 @@ static struct hwentry default_hw[] = { - .checker_name = EMC_CLARIION, - .prio_name = PRIO_EMC, - .prio_args = NULL, -+ .retain_hwhandler = RETAIN_HWHANDLER_ON, -+ .detect_prio = DETECT_PRIO_ON, - }, - { - .vendor = "EMC", -Index: multipath-tools-130222/multipath.conf.defaults -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.defaults -+++ multipath-tools-130222/multipath.conf.defaults -@@ -261,6 +261,8 @@ - # failback immediate - # rr_weight "uniform" - # no_path_retry 60 -+# retain_attached_hw_handler yes -+# detect_prio yes - # } - # device { - # vendor "EMC" diff --git a/0118-UPBZ-1200738-update-eternus-config.patch b/0118-UPBZ-1200738-update-eternus-config.patch deleted file mode 100644 index 10e96e3..0000000 --- a/0118-UPBZ-1200738-update-eternus-config.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- - libmultipath/hwtable.c | 2 +- - multipath.conf.defaults | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/libmultipath/hwtable.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/hwtable.c -+++ multipath-tools-130222/libmultipath/hwtable.c -@@ -310,7 +310,7 @@ static struct hwentry default_hw[] = { - }, - { - .vendor = "FUJITSU", -- .product = "ETERNUS_DX(L|400|8000)", -+ .product = "ETERNUS_DX(H|L|M|400|8000)", - .features = "1 queue_if_no_path", - .hwhandler = DEFAULT_HWHANDLER, - .pgpolicy = GROUP_BY_PRIO, -Index: multipath-tools-130222/multipath.conf.defaults -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.defaults -+++ multipath-tools-130222/multipath.conf.defaults -@@ -288,7 +288,7 @@ - # } - # device { - # vendor "FUJITSU" --# product "ETERNUS_DX(L|400|8000)" -+# product "ETERNUS_DX(H|L|M|400|8000)" - # path_grouping_policy "group_by_prio" - # path_checker "tur" - # features "1 queue_if_no_path" diff --git a/0119-RHBZ-1081397-save-alua-info.patch b/0119-RHBZ-1081397-save-alua-info.patch deleted file mode 100644 index c9913f3..0000000 --- a/0119-RHBZ-1081397-save-alua-info.patch +++ /dev/null @@ -1,565 +0,0 @@ ---- - libmultipath/prio.c | 34 ++++++++++++++++- - libmultipath/prio.h | 7 +++ - libmultipath/prioritizers/alua.c | 62 +++++++++++++++++++++++-------- - libmultipath/prioritizers/alua_rtpg.c | 22 +++++++++-- - libmultipath/prioritizers/alua_rtpg.h | 4 +- - libmultipath/prioritizers/const.c | 4 ++ - libmultipath/prioritizers/datacore.c | 3 + - libmultipath/prioritizers/def_func.h | 11 +++++ - libmultipath/prioritizers/emc.c | 4 ++ - libmultipath/prioritizers/hds.c | 4 ++ - libmultipath/prioritizers/hp_sw.c | 4 ++ - libmultipath/prioritizers/iet.c | 4 ++ - libmultipath/prioritizers/ontap.c | 4 ++ - libmultipath/prioritizers/random.c | 4 ++ - libmultipath/prioritizers/rdac.c | 4 ++ - libmultipath/prioritizers/weightedpath.c | 3 + - libmultipath/propsel.c | 4 +- - multipathd/main.c | 24 ++++++++---- - 18 files changed, 174 insertions(+), 32 deletions(-) - -Index: multipath-tools-130222/libmultipath/prio.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prio.c -+++ multipath-tools-130222/libmultipath/prio.c -@@ -112,9 +112,24 @@ struct prio * add_prio (char * name) - p->getprio = (int (*)(struct path *, char *)) dlsym(p->handle, "getprio"); - errstr = dlerror(); - if (errstr != NULL) -- condlog(0, "A dynamic linking error occurred: (%s)", errstr); -+ condlog(0, "A dynamic linking error occurred with getprio: (%s)", errstr); - if (!p->getprio) - goto out; -+ -+ p->initprio = (int (*)(struct prio *)) dlsym(p->handle, "initprio"); -+ errstr = dlerror(); -+ if (errstr != NULL) -+ condlog(0, "A dynamic linking error occurred with initprio: (%s)", errstr); -+ if (!p->initprio) -+ goto out; -+ -+ p->freeprio = (int (*)(struct prio *)) dlsym(p->handle, "freeprio"); -+ errstr = dlerror(); -+ if (errstr != NULL) -+ condlog(0, "A dynamic linking error occurred with freeprio: (%s)", errstr); -+ if (!p->freeprio) -+ goto out; -+ - list_add(&p->node, &prioritizers); - return p; - out: -@@ -122,6 +137,13 @@ out: - return NULL; - } - -+int prio_init (struct prio * p) -+{ -+ if (!p || !p->initprio) -+ return 1; -+ return p->initprio(p); -+} -+ - int prio_getprio (struct prio * p, struct path * pp) - { - return p->getprio(pp, p->args); -@@ -156,8 +178,16 @@ void prio_get (struct prio * dst, char * - strncpy(dst->name, src->name, PRIO_NAME_LEN); - if (args) - strncpy(dst->args, args, PRIO_ARGS_LEN); -+ dst->initprio = src->initprio; - dst->getprio = src->getprio; -+ dst->freeprio = src->freeprio; - dst->handle = NULL; -+ dst->context = NULL; -+ -+ if (dst->initprio(dst) != 0){ -+ memset(dst, 0x0, sizeof(struct prio)); -+ return; -+ } - - src->refcount++; - } -@@ -173,6 +203,8 @@ void prio_put (struct prio * dst) - src = NULL; - else - src = prio_lookup(dst->name); -+ if (dst->freeprio) -+ dst->freeprio(dst); - memset(dst, 0x0, sizeof(struct prio)); - free_prio(src); - } -Index: multipath-tools-130222/libmultipath/prio.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prio.h -+++ multipath-tools-130222/libmultipath/prio.h -@@ -46,9 +46,15 @@ struct prio { - void *handle; - int refcount; - struct list_head node; -+ void * context; - char name[PRIO_NAME_LEN]; - char args[PRIO_ARGS_LEN]; -+ int (*initprio)(struct prio * p); -+ /* You are allowed to call initprio multiple times without calling -+ * freeprio. Doing so will reinitialize it (possibly skipping -+ * allocations) */ - int (*getprio)(struct path *, char *); -+ int (*freeprio)(struct prio * p); - }; - - unsigned int get_prio_timeout(unsigned int default_timeout); -@@ -57,6 +63,7 @@ void cleanup_prio (void); - struct prio * add_prio (char *); - struct prio * prio_lookup (char *); - int prio_getprio (struct prio *, struct path *); -+int prio_init (struct prio *); - void prio_get (struct prio *, char *, char *); - void prio_put (struct prio *); - int prio_selected (struct prio *); -Index: multipath-tools-130222/libmultipath/prioritizers/alua.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/alua.c -+++ multipath-tools-130222/libmultipath/prioritizers/alua.c -@@ -37,6 +37,12 @@ static const char * aas_string[] = { - [AAS_TRANSITIONING] = "transitioning between states", - }; - -+struct alua_context { -+ int tpg_support; -+ int tpg; -+ int buflen; -+}; -+ - static const char *aas_print_string(int rc) - { - rc &= 0x7f; -@@ -51,25 +57,26 @@ static const char *aas_print_string(int - } - - int --get_alua_info(int fd) -+get_alua_info(int fd, struct alua_context *ct) - { - int rc; -- int tpg; - int aas; - -- rc = get_target_port_group_support(fd); -- if (rc < 0) -- return -ALUA_PRIO_TPGS_FAILED; -- -- if (rc == TPGS_NONE) -- return -ALUA_PRIO_NOT_SUPPORTED; -- -- tpg = get_target_port_group(fd); -- if (tpg < 0) -- return -ALUA_PRIO_RTPG_FAILED; -+ if (ct->tpg_support <= 0 || ct->tpg < 0) { -+ ct->tpg_support = get_target_port_group_support(fd); -+ if (ct->tpg_support < 0) -+ return -ALUA_PRIO_TPGS_FAILED; -+ -+ if (ct->tpg_support == TPGS_NONE) -+ return -ALUA_PRIO_NOT_SUPPORTED; -+ -+ ct->tpg = get_target_port_group(fd, &ct->buflen); -+ if (ct->tpg < 0) -+ return -ALUA_PRIO_RTPG_FAILED; -+ } - -- condlog(3, "reported target port group is %i", tpg); -- rc = get_asymmetric_access_state(fd, tpg); -+ condlog(3, "reported target port group is %i", ct->tpg); -+ rc = get_asymmetric_access_state(fd, ct->tpg, &ct->buflen); - if (rc < 0) - return -ALUA_PRIO_GETAAS_FAILED; - aas = (rc & 0x0f); -@@ -88,7 +95,7 @@ int getprio (struct path * pp, char * ar - if (pp->fd < 0) - return -ALUA_PRIO_NO_INFORMATION; - -- rc = get_alua_info(pp->fd); -+ rc = get_alua_info(pp->fd, pp->prio.context); - if (rc >= 0) { - aas = (rc & 0x0f); - priopath = (rc & 0x80); -@@ -128,3 +135,28 @@ int getprio (struct path * pp, char * ar - } - return rc; - } -+ -+int initprio(struct prio *p) -+{ -+ if (!p->context) { -+ struct alua_context *ct; -+ -+ ct = malloc(sizeof(struct alua_context)); -+ if (!ct) -+ return 1; -+ p->context = ct; -+ } -+ memset(p->context, 0, sizeof(struct alua_context)); -+ return 0; -+} -+ -+ -+int freeprio(struct prio *p) -+{ -+ if (p->context) { -+ free(p->context); -+ p->context = NULL; -+ } -+ return 0; -+} -+ -Index: multipath-tools-130222/libmultipath/prioritizers/alua_rtpg.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/alua_rtpg.c -+++ multipath-tools-130222/libmultipath/prioritizers/alua_rtpg.c -@@ -171,7 +171,7 @@ get_target_port_group_support(int fd) - } - - int --get_target_port_group(int fd) -+get_target_port_group(int fd, int *buflen_ptr) - { - unsigned char *buf; - struct vpd83_data * vpd83; -@@ -179,7 +179,12 @@ get_target_port_group(int fd) - int rc; - int buflen, scsi_buflen; - -- buflen = 128; /* Lets start from 128 */ -+ if (!buflen_ptr || *buflen_ptr == 0) { -+ buflen = 128; /* Lets start from 128 */ -+ if (buflen_ptr) -+ *buflen_ptr = 128; -+ } else -+ buflen = *buflen_ptr; - buf = (unsigned char *)malloc(buflen); - if (!buf) { - PRINT_DEBUG("malloc failed: could not allocate" -@@ -202,6 +207,8 @@ get_target_port_group(int fd) - return -RTPG_RTPG_FAILED; - } - buflen = scsi_buflen; -+ if (buflen_ptr) -+ *buflen_ptr = buflen; - memset(buf, 0, buflen); - rc = do_inquiry(fd, 1, 0x83, buf, buflen); - if (rc < 0) -@@ -269,7 +276,7 @@ do_rtpg(int fd, void* resp, long resplen - } - - int --get_asymmetric_access_state(int fd, unsigned int tpg) -+get_asymmetric_access_state(int fd, unsigned int tpg, int *buflen_ptr) - { - unsigned char *buf; - struct rtpg_data * tpgd; -@@ -278,7 +285,12 @@ get_asymmetric_access_state(int fd, unsi - int buflen; - uint32_t scsi_buflen; - -- buflen = 128; /* Initial value from old code */ -+ if (!buflen_ptr || *buflen_ptr == 0) { -+ buflen = 128; /* Initial value from old code */ -+ if (buflen_ptr) -+ *buflen_ptr = 128; -+ } else -+ buflen = *buflen_ptr; - buf = (unsigned char *)malloc(buflen); - if (!buf) { - PRINT_DEBUG ("malloc failed: could not allocate" -@@ -299,6 +311,8 @@ get_asymmetric_access_state(int fd, unsi - return -RTPG_RTPG_FAILED; - } - buflen = scsi_buflen; -+ if (buflen_ptr) -+ *buflen_ptr = buflen; - memset(buf, 0, buflen); - rc = do_rtpg(fd, buf, buflen); - if (rc < 0) -Index: multipath-tools-130222/libmultipath/prioritizers/alua_rtpg.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/alua_rtpg.h -+++ multipath-tools-130222/libmultipath/prioritizers/alua_rtpg.h -@@ -23,8 +23,8 @@ - #define RTPG_TPG_NOT_FOUND 4 - - int get_target_port_group_support(int fd); --int get_target_port_group(int fd); --int get_asymmetric_access_state(int fd, unsigned int tpg); -+int get_target_port_group(int fd, int *buflen_ptr); -+int get_asymmetric_access_state(int fd, unsigned int tpg, int *buflen_ptr); - - #endif /* __RTPG_H__ */ - -Index: multipath-tools-130222/libmultipath/prioritizers/const.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/const.c -+++ multipath-tools-130222/libmultipath/prioritizers/const.c -@@ -1,8 +1,12 @@ - #include - - #include -+#include "def_func.h" - - int getprio (struct path * pp, char * args) - { - return 1; - } -+ -+declare_nop_prio(initprio) -+declare_nop_prio(freeprio) -Index: multipath-tools-130222/libmultipath/prioritizers/datacore.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/datacore.c -+++ multipath-tools-130222/libmultipath/prioritizers/datacore.c -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include "def_func.h" - - #define INQ_REPLY_LEN 255 - #define INQ_CMD_CODE 0x12 -@@ -111,3 +112,5 @@ int getprio (struct path * pp, char * ar - return datacore_prio(pp->dev, pp->fd, args); - } - -+declare_nop_prio(initprio) -+declare_nop_prio(freeprio) -Index: multipath-tools-130222/libmultipath/prioritizers/def_func.h -=================================================================== ---- /dev/null -+++ multipath-tools-130222/libmultipath/prioritizers/def_func.h -@@ -0,0 +1,11 @@ -+#ifndef _DEF_FUNC_H -+#define _DEF_FUNC_H -+ -+#include "prio.h" -+ -+#define declare_nop_prio(name) \ -+int name (struct prio *p) \ -+{ \ -+ return 0; \ -+} -+#endif /* _DEF_FUNC_H */ -Index: multipath-tools-130222/libmultipath/prioritizers/emc.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/emc.c -+++ multipath-tools-130222/libmultipath/prioritizers/emc.c -@@ -6,6 +6,7 @@ - #include - #include - #include -+#include "def_func.h" - - #define INQUIRY_CMD 0x12 - #define INQUIRY_CMDLEN 6 -@@ -85,3 +86,6 @@ int getprio (struct path * pp, char * ar - { - return emc_clariion_prio(pp->dev, pp->fd); - } -+ -+declare_nop_prio(initprio) -+declare_nop_prio(freeprio) -Index: multipath-tools-130222/libmultipath/prioritizers/hds.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/hds.c -+++ multipath-tools-130222/libmultipath/prioritizers/hds.c -@@ -76,6 +76,7 @@ - #include - #include - #include -+#include "def_func.h" - - #define INQ_REPLY_LEN 255 - #define INQ_CMD_CODE 0x12 -@@ -170,3 +171,6 @@ int getprio (struct path * pp, char * ar - { - return hds_modular_prio(pp->dev, pp->fd); - } -+ -+declare_nop_prio(initprio) -+declare_nop_prio(freeprio) -Index: multipath-tools-130222/libmultipath/prioritizers/hp_sw.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/hp_sw.c -+++ multipath-tools-130222/libmultipath/prioritizers/hp_sw.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include "def_func.h" - - #define TUR_CMD_LEN 6 - #define SCSI_CHECK_CONDITION 0x2 -@@ -99,3 +100,6 @@ int getprio (struct path * pp, char * ar - { - return hp_sw_prio(pp->dev, pp->fd); - } -+ -+declare_nop_prio(initprio) -+declare_nop_prio(freeprio) -Index: multipath-tools-130222/libmultipath/prioritizers/iet.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/iet.c -+++ multipath-tools-130222/libmultipath/prioritizers/iet.c -@@ -9,6 +9,7 @@ - #include - #include - #include -+#include "def_func.h" - - // - // This prioritizer suits iSCSI needs, makes it possible to prefer one path. -@@ -141,3 +142,6 @@ int getprio(struct path * pp, char * arg - { - return iet_prio(pp->dev, args); - } -+ -+declare_nop_prio(initprio) -+declare_nop_prio(freeprio) -Index: multipath-tools-130222/libmultipath/prioritizers/ontap.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/ontap.c -+++ multipath-tools-130222/libmultipath/prioritizers/ontap.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include "def_func.h" - - #define INQUIRY_CMD 0x12 - #define INQUIRY_CMDLEN 6 -@@ -245,3 +246,6 @@ int getprio (struct path * pp, char * ar - { - return ontap_prio(pp->dev, pp->fd); - } -+ -+declare_nop_prio(initprio) -+declare_nop_prio(freeprio) -Index: multipath-tools-130222/libmultipath/prioritizers/random.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/random.c -+++ multipath-tools-130222/libmultipath/prioritizers/random.c -@@ -4,6 +4,7 @@ - #include - - #include -+#include "def_func.h" - - int getprio (struct path * pp, char * args) - { -@@ -13,3 +14,6 @@ int getprio (struct path * pp, char * ar - srand((unsigned int)tv.tv_usec); - return 1+(int) (10.0*rand()/(RAND_MAX+1.0)); - } -+ -+declare_nop_prio(initprio) -+declare_nop_prio(freeprio) -Index: multipath-tools-130222/libmultipath/prioritizers/rdac.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/rdac.c -+++ multipath-tools-130222/libmultipath/prioritizers/rdac.c -@@ -6,6 +6,7 @@ - #include - #include - #include -+#include "def_func.h" - - #define INQUIRY_CMD 0x12 - #define INQUIRY_CMDLEN 6 -@@ -95,3 +96,6 @@ int getprio (struct path * pp, char * ar - { - return rdac_prio(pp->dev, pp->fd); - } -+ -+declare_nop_prio(initprio) -+declare_nop_prio(freeprio) -Index: multipath-tools-130222/libmultipath/prioritizers/weightedpath.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/weightedpath.c -+++ multipath-tools-130222/libmultipath/prioritizers/weightedpath.c -@@ -32,6 +32,7 @@ - #include - #include - #include -+#include "def_func.h" - - char *get_next_string(char **temp, char *split_char) - { -@@ -104,3 +105,5 @@ int getprio(struct path *pp, char *args) - return prio_path_weight(pp, args); - } - -+declare_nop_prio(initprio) -+declare_nop_prio(freeprio) -Index: multipath-tools-130222/libmultipath/propsel.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.c -+++ multipath-tools-130222/libmultipath/propsel.c -@@ -401,10 +401,10 @@ detect_prio(struct path * pp) - - if (get_target_port_group_support(pp->fd) <= 0) - return; -- ret = get_target_port_group(pp->fd); -+ ret = get_target_port_group(pp->fd, NULL); - if (ret < 0) - return; -- if (get_asymmetric_access_state(pp->fd, ret) < 0) -+ if (get_asymmetric_access_state(pp->fd, ret, NULL) < 0) - return; - prio_get(p, PRIO_ALUA, DEFAULT_PRIO_ARGS); - } -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -700,20 +700,23 @@ static int - uev_update_path (struct uevent *uev, struct vectors * vecs) - { - int ro, retval = 0; -+ struct path * pp; -+ -+ pp = find_path_by_dev(vecs->pathvec, uev->kernel); -+ if (!pp) { -+ condlog(0, "%s: spurious uevent, path not found", -+ uev->kernel); -+ return 1; -+ } -+ /* reinit the prio values on change event, in case something is -+ * different */ -+ prio_init(&pp->prio); - - ro = uevent_get_disk_ro(uev); - - if (ro >= 0) { -- struct path * pp; -- - condlog(2, "%s: update path write_protect to '%d' (uevent)", - uev->kernel, ro); -- pp = find_path_by_dev(vecs->pathvec, uev->kernel); -- if (!pp) { -- condlog(0, "%s: spurious uevent, path not found", -- uev->kernel); -- return 1; -- } - if (pp->mpp) { - retval = reload_map(vecs, pp->mpp, 0); - -@@ -1218,6 +1221,11 @@ check_path (struct vectors * vecs, struc - } - - if(newstate == PATH_UP || newstate == PATH_GHOST){ -+ /* -+ * Reinitialize the prioritizer, in case something -+ * changed. -+ */ -+ prio_init(&pp->prio); - if ( pp->mpp && pp->mpp->prflag ){ - /* - * Check Persistent Reservation. diff --git a/0120-RHBZ-1043093-realloc-fix.patch b/0120-RHBZ-1043093-realloc-fix.patch deleted file mode 100644 index 96b812a..0000000 --- a/0120-RHBZ-1043093-realloc-fix.patch +++ /dev/null @@ -1,195 +0,0 @@ ---- - libmultipath/dmparser.c | 6 ++++-- - libmultipath/regex.c | 9 ++++++++- - multipath/main.c | 9 ++++++--- - multipathd/cli_handlers.c | 41 ++++++++++++----------------------------- - multipathd/uxlsnr.c | 13 ++++++++++++- - 5 files changed, 42 insertions(+), 36 deletions(-) - -Index: multipath-tools-130222/libmultipath/dmparser.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dmparser.c -+++ multipath-tools-130222/libmultipath/dmparser.c -@@ -20,14 +20,16 @@ - static int - merge_words (char ** dst, char * word, int space) - { -- char * p; -+ char * p = *dst; - int len; - - len = strlen(*dst) + strlen(word) + space; - *dst = REALLOC(*dst, len + 1); - -- if (!*dst) -+ if (!*dst) { -+ free(p); - return 1; -+ } - - p = *dst; - -Index: multipath-tools-130222/libmultipath/regex.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/regex.c -+++ multipath-tools-130222/libmultipath/regex.c -@@ -123,7 +123,14 @@ static void init_syntax_once(void) - - /* (Re)Allocate N items of type T using malloc, or fail. */ - #define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) --#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) -+#define RETALLOC(addr, n, t) \ -+do { \ -+ t *tmp = (t *) realloc (addr, (n) * sizeof (t)); \ -+ if (!tmp) \ -+ free(addr); \ -+ (addr) = tmp; \ -+} while(0) -+ - #define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) - - #define BYTEWIDTH 8 /* In bits. */ -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -394,7 +394,7 @@ out: - static int - dump_config (void) - { -- char * c; -+ char * c, * tmp = NULL; - char * reply; - unsigned int maxlen = 256; - int again = 1; -@@ -402,9 +402,12 @@ dump_config (void) - reply = MALLOC(maxlen); - - while (again) { -- if (!reply) -+ if (!reply) { -+ if (tmp) -+ free(tmp); - return 1; -- c = reply; -+ } -+ c = tmp = reply; - c += snprint_defaults(c, reply + maxlen - c); - again = ((c - reply) == maxlen); - if (again) { -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -26,11 +26,14 @@ - #define REALLOC_REPLY(r, a, m) \ - do { \ - if ((a)) { \ -+ char *tmp = (r); \ - (r) = REALLOC((r), (m) * 2); \ - if ((r)) { \ - memset((r) + (m), 0, (m)); \ - (m) *= 2; \ - } \ -+ else \ -+ free(tmp); \ - } \ - } while (0) - -@@ -144,7 +147,7 @@ show_config (char ** r, int * len) - unsigned int maxlen = INITIAL_REPLY_LEN; - int again = 1; - -- reply = MALLOC(maxlen); -+ c = reply = MALLOC(maxlen); - - while (again) { - if (!reply) -@@ -152,44 +155,24 @@ show_config (char ** r, int * len) - c = reply; - c += snprint_defaults(c, reply + maxlen - c); - again = ((c - reply) == maxlen); -- if (again) { -- reply = REALLOC(reply, maxlen * 2); -- if (!reply) -- return 1; -- memset(reply + maxlen, 0, maxlen); -- maxlen *= 2; -+ REALLOC_REPLY(reply, again, maxlen); -+ if (again) - continue; -- } - c += snprint_blacklist(c, reply + maxlen - c); - again = ((c - reply) == maxlen); -- if (again) { -- reply = REALLOC(reply, maxlen * 2); -- if (!reply) -- return 1; -- memset(reply + maxlen, 0, maxlen); -- maxlen *= 2; -+ REALLOC_REPLY(reply, again, maxlen); -+ if (again) - continue; -- } - c += snprint_blacklist_except(c, reply + maxlen - c); - again = ((c - reply) == maxlen); -- if (again) { -- reply = REALLOC(reply, maxlen * 2); -- if (!reply) -- return 1; -- memset(reply + maxlen, 0, maxlen); -- maxlen *= 2; -+ REALLOC_REPLY(reply, again, maxlen); -+ if (again) - continue; -- } - c += snprint_hwtable(c, reply + maxlen - c, conf->hwtable); - again = ((c - reply) == maxlen); -- if (again) { -- reply = REALLOC(reply, maxlen * 2); -- if (!reply) -- return 1; -- memset(reply + maxlen, 0, maxlen); -- maxlen *= 2; -+ REALLOC_REPLY(reply, again, maxlen); -+ if (again) - continue; -- } - c += snprint_mptable(c, reply + maxlen - c, conf->mptable); - again = ((c - reply) == maxlen); - REALLOC_REPLY(reply, again, maxlen); -Index: multipath-tools-130222/multipathd/uxlsnr.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/uxlsnr.c -+++ multipath-tools-130222/multipathd/uxlsnr.c -@@ -64,6 +64,10 @@ static void new_client(int ux_sock) - - /* put it in our linked list */ - c = (struct client *)MALLOC(sizeof(*c)); -+ if (!c) { -+ close(fd); -+ return; -+ } - memset(c, 0, sizeof(*c)); - c->fd = fd; - c->next = clients; -@@ -124,11 +128,18 @@ void * uxsock_listen(int (*uxsock_trigge - sigdelset(&mask, SIGHUP); - sigdelset(&mask, SIGUSR1); - while (1) { -+ struct pollfd *tmp; - struct client *c; - int i, poll_count; - - /* setup for a poll */ -- polls = REALLOC(polls, (1+num_clients) * sizeof(*polls)); -+ tmp = REALLOC(polls, (1+num_clients) * sizeof(*polls)); -+ /* If we can't allocate poliing space for the new client, -+ * close it */ -+ if (!tmp) -+ dead_client(clients); -+ else -+ polls = tmp; - polls[0].fd = ux_sock; - polls[0].events = POLLIN; - diff --git a/0121-RHBZ-1197234-rules-fix.patch b/0121-RHBZ-1197234-rules-fix.patch deleted file mode 100644 index 41d672b..0000000 --- a/0121-RHBZ-1197234-rules-fix.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- - 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" diff --git a/0122-RHBZ-1212590-dont-use-var.patch b/0122-RHBZ-1212590-dont-use-var.patch deleted file mode 100644 index 52d743a..0000000 --- a/0122-RHBZ-1212590-dont-use-var.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- - libmultipath/defaults.h | 4 ++-- - multipathd/multipathd.service | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -Index: multipath-tools-130222/libmultipath/defaults.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/defaults.h -+++ multipath-tools-130222/libmultipath/defaults.h -@@ -26,8 +26,8 @@ - #define MAX_CHECKINT(a) (a << 2) - - #define MAX_DEV_LOSS_TMO 0x7FFFFFFF --#define DEFAULT_PIDFILE "/var/run/multipathd/multipathd.pid" --#define DEFAULT_TIMESTAMP_FILE "/var/run/multipathd/timestamp" -+#define DEFAULT_PIDFILE "/run/multipathd/multipathd.pid" -+#define DEFAULT_TIMESTAMP_FILE "/run/multipathd/timestamp" - #define DEFAULT_SOCKET "/org/kernel/linux/storage/multipathd" - #define DEFAULT_CONFIGFILE "/etc/multipath.conf" - #define DEFAULT_BINDINGS_FILE "/etc/multipath/bindings" -Index: multipath-tools-130222/multipathd/multipathd.service -=================================================================== ---- multipath-tools-130222.orig/multipathd/multipathd.service -+++ multipath-tools-130222/multipathd/multipathd.service -@@ -9,7 +9,7 @@ Conflicts=shutdown.target - - [Service] - Type=forking --PIDFile=/var/run/multipathd/multipathd.pid -+PIDFile=/run/multipathd/multipathd.pid - ExecStartPre=/sbin/modprobe dm-multipath - ExecStartPre=-/sbin/multipath -A - ExecStart=/sbin/multipathd diff --git a/0123-UPBZ-1166072-fix-path-offline.patch b/0123-UPBZ-1166072-fix-path-offline.patch deleted file mode 100644 index 0f1a912..0000000 --- a/0123-UPBZ-1166072-fix-path-offline.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- - libmultipath/discovery.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -946,9 +946,7 @@ path_offline (struct path * pp) - - condlog(3, "%s: path state = %s", pp->dev, buff); - -- if (!strncmp(buff, "offline", 7) || -- !strncmp(buff, "quiesce", 7) || -- !strncmp(buff, "transport-offline", 17)) { -+ if (!strncmp(buff, "offline", 7)) { - pp->offline = 1; - return PATH_DOWN; - } diff --git a/0124-RHBZ-1209275-retrigger-uevents.patch b/0124-RHBZ-1209275-retrigger-uevents.patch deleted file mode 100644 index e0b1886..0000000 --- a/0124-RHBZ-1209275-retrigger-uevents.patch +++ /dev/null @@ -1,214 +0,0 @@ ---- - libmultipath/config.c | 2 ++ - libmultipath/config.h | 2 ++ - libmultipath/defaults.h | 2 ++ - libmultipath/dict.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ - libmultipath/discovery.c | 8 +++++--- - libmultipath/structs.h | 8 ++++++++ - multipathd/main.c | 15 ++++++++++++++- - 7 files changed, 79 insertions(+), 4 deletions(-) - -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -673,6 +673,8 @@ load_config (char * file, struct udev *u - conf->force_sync = 0; - conf->ignore_new_boot_devs = 0; - conf->processed_main_config = 0; -+ conf->retrigger_tries = DEFAULT_RETRIGGER_TRIES; -+ conf->retrigger_delay = DEFAULT_RETRIGGER_DELAY; - - /* - * preload default hwtable -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -139,6 +139,8 @@ struct config { - int processed_main_config; - int delay_watch_checks; - int delay_wait_checks; -+ int retrigger_tries; -+ int retrigger_delay; - unsigned int version[3]; - - char * dev; -Index: multipath-tools-130222/libmultipath/defaults.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/defaults.h -+++ multipath-tools-130222/libmultipath/defaults.h -@@ -21,6 +21,8 @@ - #define DEFAULT_DETECT_PRIO DETECT_PRIO_OFF - #define DEFAULT_DEFERRED_REMOVE DEFERRED_REMOVE_OFF - #define DEFAULT_DELAY_CHECKS DELAY_CHECKS_OFF -+#define DEFAULT_RETRIGGER_DELAY 10 -+#define DEFAULT_RETRIGGER_TRIES 3 - - #define DEFAULT_CHECKINT 5 - #define MAX_CHECKINT(a) (a << 2) -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -839,6 +839,38 @@ def_delay_wait_checks_handler(vector str - return 0; - } - -+static int -+def_retrigger_tries_handler(vector strvec) -+{ -+ char * buff; -+ -+ buff = set_value(strvec); -+ -+ if (!buff) -+ return 1; -+ -+ conf->retrigger_tries = atoi(buff); -+ FREE(buff); -+ -+ return 0; -+} -+ -+static int -+def_retrigger_delay_handler(vector strvec) -+{ -+ char * buff; -+ -+ buff = set_value(strvec); -+ -+ if (!buff) -+ return 1; -+ -+ conf->retrigger_delay = atoi(buff); -+ FREE(buff); -+ -+ return 0; -+} -+ - /* - * blacklist block handlers - */ -@@ -3194,6 +3226,18 @@ snprint_def_delay_wait_checks(char * buf - } - - static int -+snprint_def_retrigger_tries (char * buff, int len, void * data) -+{ -+ return snprintf(buff, len, "%i", conf->retrigger_tries); -+} -+ -+static int -+snprint_def_retrigger_delay (char * buff, int len, void * data) -+{ -+ return snprintf(buff, len, "%i", conf->retrigger_delay); -+} -+ -+static int - snprint_ble_simple (char * buff, int len, void * data) - { - struct blentry * ble = (struct blentry *)data; -@@ -3267,6 +3311,8 @@ init_keywords(void) - install_keyword("config_dir", &def_config_dir_handler, &snprint_def_config_dir); - install_keyword("delay_watch_checks", &def_delay_watch_checks_handler, &snprint_def_delay_watch_checks); - install_keyword("delay_wait_checks", &def_delay_wait_checks_handler, &snprint_def_delay_wait_checks); -+ install_keyword("retrigger_tries", &def_retrigger_tries_handler, &snprint_def_retrigger_tries); -+ install_keyword("retrigger_delay", &def_retrigger_delay_handler, &snprint_def_retrigger_delay); - __deprecated install_keyword("default_selector", &def_selector_handler, NULL); - __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); - __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL); -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -1111,9 +1111,13 @@ get_uid (struct path * pp) - len = strlen(value); - } - strncpy(pp->wwid, value, len); -+ pp->missing_udev_info = INFO_OK; -+ pp->tick = 0; - } else { - condlog(3, "%s: no %s attribute", pp->dev, - pp->uid_attribute); -+ pp->missing_udev_info = INFO_MISSING; -+ pp->tick = conf->retrigger_delay; - } - - /* Strip any trailing blanks */ -@@ -1201,10 +1205,8 @@ pathinfo (struct path *pp, vector hwtabl - * Retrieve path priority, even for PATH_DOWN paths if it has never - * been successfully obtained before. - */ -- if ((mask & DI_PRIO) && path_state == PATH_UP) { -+ if ((mask & DI_PRIO) && path_state == PATH_UP && strlen(pp->wwid)) { - if (pp->state != PATH_DOWN || pp->priority == PRIO_UNDEF) { -- if (!strlen(pp->wwid)) -- get_uid(pp); - get_prio(pp); - } - } -Index: multipath-tools-130222/libmultipath/structs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.h -+++ multipath-tools-130222/libmultipath/structs.h -@@ -139,6 +139,12 @@ enum delay_checks_states { - DELAY_CHECKS_UNDEF = 0, - }; - -+enum missing_udev_info_states { -+ INFO_OK, -+ INFO_MISSING, -+ INFO_REQUESTED, -+}; -+ - struct sg_id { - int host_no; - int channel; -@@ -193,6 +199,8 @@ struct path { - struct checker checker; - struct multipath * mpp; - int fd; -+ int missing_udev_info; -+ int retriggers; - - /* configlet pointers */ - struct hwentry * hwe; -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -708,6 +708,10 @@ uev_update_path (struct uevent *uev, str - uev->kernel); - return 1; - } -+ -+ if (pp->missing_udev_info == INFO_REQUESTED) -+ return uev_add_path(uev, vecs); -+ - /* reinit the prio values on change event, in case something is - * different */ - prio_init(&pp->prio); -@@ -1133,12 +1137,21 @@ check_path (struct vectors * vecs, struc - int chkr_new_path_up = 0; - int oldchkrstate = pp->chkrstate; - -- if (!pp->mpp) -+ if (!pp->mpp && (pp->missing_udev_info != INFO_MISSING || -+ pp->retriggers >= conf->retrigger_tries)) - return; - - if (pp->tick && --pp->tick) - return; /* don't check this path yet */ - -+ if (!pp->mpp) { -+ pp->missing_udev_info = INFO_REQUESTED; -+ pp->retriggers++; -+ sysfs_attr_set_value(pp->udev, "uevent", "change", -+ strlen("change")); -+ return; -+ } -+ - /* - * provision a next check soonest, - * in case we exit abnormaly from here diff --git a/0125-RHBZ-1153832-kpartx-delete.patch b/0125-RHBZ-1153832-kpartx-delete.patch deleted file mode 100644 index 329bc44..0000000 --- a/0125-RHBZ-1153832-kpartx-delete.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- - kpartx/kpartx.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/kpartx/kpartx.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.c -+++ multipath-tools-130222/kpartx/kpartx.c -@@ -409,7 +409,7 @@ main(int argc, char **argv){ - break; - - case DELETE: -- for (j = n-1; j >= 0; j--) { -+ for (j = MAXSLICES-1; j >= 0; j--) { - if (safe_sprintf(partname, "%s%s%d", - mapname, delim, j+1)) { - fprintf(stderr, "partname too small\n"); -@@ -417,7 +417,7 @@ main(int argc, char **argv){ - } - strip_slash(partname); - -- if (!slices[j].size || !dm_map_present(partname)) -+ if (!dm_map_present(partname)) - continue; - - if (!dm_simplecmd(DM_DEVICE_REMOVE, partname, diff --git a/0126-RHBZ-1211383-alias-collision.patch b/0126-RHBZ-1211383-alias-collision.patch deleted file mode 100644 index 128a8a7..0000000 --- a/0126-RHBZ-1211383-alias-collision.patch +++ /dev/null @@ -1,113 +0,0 @@ ---- - libmultipath/config.c | 4 ++++ - libmultipath/config.h | 1 + - libmultipath/configure.c | 3 +++ - libmultipath/dict.c | 33 +++++++++++++++++++++++++++++++++ - 4 files changed, 41 insertions(+) - -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -422,6 +422,9 @@ select_action (struct multipath * mpp, v - condlog(2, "%s: unable to rename %s to %s (%s is used by %s)", - mpp->wwid, cmpp->alias, mpp->alias, - mpp->alias, cmpp_by_name->wwid); -+ /* reset alias to existing alias */ -+ FREE(mpp->alias); -+ mpp->alias = STRDUP(cmpp->alias); - mpp->action = ACT_NOTHING; - return; - } -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -675,6 +675,7 @@ load_config (char * file, struct udev *u - conf->processed_main_config = 0; - conf->retrigger_tries = DEFAULT_RETRIGGER_TRIES; - conf->retrigger_delay = DEFAULT_RETRIGGER_DELAY; -+ conf->new_bindings_in_boot = 0; - - /* - * preload default hwtable -@@ -792,6 +793,9 @@ load_config (char * file, struct udev *u - if (conf->ignore_new_boot_devs) - in_initrd(); - -+ if (conf->new_bindings_in_boot == 0 && in_initrd()) -+ conf->bindings_read_only = 1; -+ - return 0; - out: - free_config(conf); -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -141,6 +141,7 @@ struct config { - int delay_wait_checks; - int retrigger_tries; - int retrigger_delay; -+ int new_bindings_in_boot; - unsigned int version[3]; - - char * dev; -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -871,6 +871,29 @@ def_retrigger_delay_handler(vector strve - return 0; - } - -+static int -+def_new_bindings_in_boot_handler(vector strvec) -+{ -+ char * buff; -+ -+ buff = set_value(strvec); -+ -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ conf->new_bindings_in_boot = 0; -+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) || -+ (strlen(buff) == 1 && !strcmp(buff, "1"))) -+ conf->new_bindings_in_boot = 1; -+ else -+ conf->new_bindings_in_boot = 0; -+ -+ FREE(buff); -+ return 0; -+} -+ - /* - * blacklist block handlers - */ -@@ -3238,6 +3261,15 @@ snprint_def_retrigger_delay (char * buff - } - - static int -+snprint_def_new_bindings_in_boot(char * buff, int len, void * data) -+{ -+ if (conf->new_bindings_in_boot == 1) -+ return snprintf(buff, len, "yes"); -+ else -+ return snprintf(buff, len, "no"); -+} -+ -+static int - snprint_ble_simple (char * buff, int len, void * data) - { - struct blentry * ble = (struct blentry *)data; -@@ -3313,6 +3345,7 @@ init_keywords(void) - install_keyword("delay_wait_checks", &def_delay_wait_checks_handler, &snprint_def_delay_wait_checks); - install_keyword("retrigger_tries", &def_retrigger_tries_handler, &snprint_def_retrigger_tries); - install_keyword("retrigger_delay", &def_retrigger_delay_handler, &snprint_def_retrigger_delay); -+ install_keyword("new_bindings_in_boot", &def_new_bindings_in_boot_handler, &snprint_def_new_bindings_in_boot); - __deprecated install_keyword("default_selector", &def_selector_handler, NULL); - __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); - __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL); diff --git a/0127-RHBZ-1201030-use-blk-availability.patch b/0127-RHBZ-1201030-use-blk-availability.patch deleted file mode 100644 index b2cd7cf..0000000 --- a/0127-RHBZ-1201030-use-blk-availability.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- - multipathd/multipathd.service | 1 + - 1 file changed, 1 insertion(+) - -Index: multipath-tools-130222/multipathd/multipathd.service -=================================================================== ---- multipath-tools-130222.orig/multipathd/multipathd.service -+++ multipath-tools-130222/multipathd/multipathd.service -@@ -1,5 +1,6 @@ - [Unit] - Description=Device-Mapper Multipath Device Controller -+Requires=blk-availability.service - Before=iscsi.service iscsid.service lvm2-activation-early.service - After=syslog.target - ConditionPathExists=/etc/multipath.conf diff --git a/0128-RHBZ-1222123-mpathconf-allow.patch b/0128-RHBZ-1222123-mpathconf-allow.patch deleted file mode 100644 index ad98737..0000000 --- a/0128-RHBZ-1222123-mpathconf-allow.patch +++ /dev/null @@ -1,244 +0,0 @@ ---- - multipath/mpathconf | 135 +++++++++++++++++++++++++++++++++++++++++++++++----- - 1 file changed, 124 insertions(+), 11 deletions(-) - -Index: multipath-tools-130222/multipath/mpathconf -=================================================================== ---- multipath-tools-130222.orig/multipath/mpathconf -+++ multipath-tools-130222/multipath/mpathconf -@@ -1,4 +1,4 @@ --#!/bin/sh -+#!/bin/bash - # - # Copyright (C) 2010 Red Hat, Inc. All rights reserved. - # -@@ -17,7 +17,7 @@ - # This program was largely ripped off from lvmconf - # - --unset ENABLE FIND FRIENDLY MODULE MULTIPATHD HAVE_DISABLE HAVE_FIND HAVE_BLACKLIST HAVE_DEFAULTS HAVE_FRIENDLY HAVE_MULTIPATHD HAVE_MODULE SHOW_STATUS CHANGED_CONFIG -+unset ENABLE FIND FRIENDLY MODULE MULTIPATHD HAVE_DISABLE HAVE_WWID_DISABLE HAVE_FIND HAVE_BLACKLIST HAVE_EXCEPTIONS HAVE_DEFAULTS HAVE_FRIENDLY HAVE_MULTIPATHD HAVE_MODULE HAVE_OUTFILE SHOW_STATUS CHANGED_CONFIG WWID_LIST - - DEFAULT_CONFIG="# device-mapper-multipath configuration file - -@@ -38,8 +38,10 @@ defaults { - }" - - CONFIGFILE="/etc/multipath.conf" -+OUTPUTFILE="/etc/multipath.conf" - MULTIPATHDIR="/etc/multipath" - TMPFILE="/etc/multipath/.multipath.conf.tmp" -+WWIDS=0 - - function usage - { -@@ -48,13 +50,60 @@ function usage - echo "Commands:" - echo "Enable: --enable " - echo "Disable: --disable" -+ echo "Only allow certain wwids (instead of enable): --allow " - echo "Set user_friendly_names (Default y): --user_friendly_names " - echo "Set find_multipaths (Default y): --find_multipaths " - echo "Load the dm-multipath modules on enable (Default y): --with_module " - echo "start/stop/reload multipathd (Default n): --with_multipathd " -+ echo "select output file (Default /etc/multipath.conf): --outfile " - echo "" - } - -+function get_dm_deps -+{ -+ shift 3 -+ while [ -n "$1" -a -n "$2" ]; do -+ MAJOR=$(echo $1 | tr -d '(,') -+ MINOR=$(echo $2 | tr -d ')') -+ UUID=`dmsetup info -c --noheadings -o uuid -j $MAJOR -m $MINOR 2> /dev/null` -+ if [ -n "$UUID" ] ; then -+ set_dm_wwid $UUID -+ fi -+ shift 2 -+ done -+} -+ -+function set_dm_wwid -+{ -+ if [[ "$1" =~ ^part[[:digit:]]+-mpath- ]] ; then -+ WWID_LIST[$WWIDS]="${1##part*-mpath-}" -+ ((WWIDS++)) -+ elif [[ "$1" =~ ^mpath- ]] ; then -+ WWID_LIST[$WWIDS]="${1##mpath-}" -+ ((WWIDS++)) -+ else -+ get_dm_deps `dmsetup deps -u $1` -+ fi -+} -+ -+function set_wwid -+{ -+ UUID="" -+ if [[ "$1" =~ ^[[:digit:]]+:[[:digit:]]+$ ]] ; then -+ MAJOR=${1%%:*} -+ MINOR=${1##*:} -+ UUID=`dmsetup info -c --noheadings -o uuid -j $MAJOR -m $MINOR 2> /dev/null` -+ else -+ UUID=`dmsetup info -c --noheadings -o uuid $1 2> /dev/null` -+ fi -+ if [ -n "$UUID" ] ; then -+ set_dm_wwid $UUID -+ else -+ WWID_LIST[$WWIDS]="$1" -+ ((WWIDS++)) -+ fi -+} -+ - function parse_args - { - while [ -n "$1" ]; do -@@ -67,6 +116,16 @@ function parse_args - ENABLE=0 - shift - ;; -+ --allow) -+ ENABLE=2 -+ if [ -n "$2" ]; then -+ set_wwid $2 -+ shift 2 -+ else -+ usage -+ exit 1 -+ fi -+ ;; - --user_friendly_names) - if [ -n "$2" ]; then - FRIENDLY=$2 -@@ -103,6 +162,16 @@ function parse_args - exit 1 - fi - ;; -+ --outfile) -+ if [ -n "$2" ]; then -+ OUTPUTFILE=$2 -+ HAVE_OUTFILE=1 -+ shift 2 -+ else -+ usage -+ exit 1 -+ fi -+ ;; - *) - usage - exit -@@ -137,6 +206,22 @@ function validate_args - echo "--with_multipathd must be either 'y' or 'n'" - exit 1 - fi -+ if [ "$ENABLE" = 2 -a -z "$HAVE_OUTFILE" ]; then -+ echo "Because --allow makes changes that cannot be automatically reversed," -+ echo "you must set --outfile when you set --allow" -+ exit 1 -+ fi -+} -+ -+function add_blacklist_exceptions -+{ -+ echo "blacklist_exceptions {" >> $TMPFILE -+ INDEX=0 -+ while [ "$INDEX" -lt "$WWIDS" ] ; do -+ echo " wwid \"${WWID_LIST[$INDEX]}\"" >> $TMPFILE -+ ((INDEX++)) -+ done -+ echo "}" >> $TMPFILE - } - - umask 0077 -@@ -160,6 +245,10 @@ if grep -q "^blacklist[[:space:]]*{" $TM - HAVE_BLACKLIST=1 - fi - -+if grep -q "^blacklist_exceptions[[:space:]]*{" $TMPFILE ; then -+ HAVE_EXCEPTIONS=1 -+fi -+ - if grep -q "^defaults[[:space:]]*{" $TMPFILE ; then - HAVE_DEFAULTS=1 - fi -@@ -183,11 +272,19 @@ fi - if [ "$HAVE_BLACKLIST" = "1" ]; then - if sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*devnode \"\.\?\*\"" ; then - HAVE_DISABLE=1 -- elif sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[#[:space:]]*devnode \"\.\?\*\"" ; then -+ elif sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[[:space:]]*devnode \"\.\?\*\"" ; then - HAVE_DISABLE=0 - fi - fi - -+if [ "$HAVE_BLACKLIST" = "1" ]; then -+ if sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*wwid \"\.\?\*\"" ; then -+ HAVE_WWID_DISABLE=1 -+ elif sed -n '/^blacklist[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[[:space:]]*wwid \"\.\?\*\"" ; then -+ HAVE_WWID_DISABLE=0 -+ fi -+fi -+ - if [ "$HAVE_DEFAULTS" = "1" ]; then - if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*find_multipaths[[:space:]]*\(yes\|1\)" ; then - HAVE_FIND=1 -@@ -255,17 +352,33 @@ defaults { - _EOF_ - fi - --if [ "$ENABLE" = 1 ]; then -+if [ "$ENABLE" = 2 ]; then -+ if [ "$HAVE_DISABLE" = 1 ]; then -+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*devnode \"\.\?\*\"/# devnode ".*"/' $TMPFILE -+ fi -+ if [ -z "$HAVE_WWID_DISABLE" ]; then -+ sed -i '/^blacklist[[:space:]]*{/ a\ -+ wwid ".*" -+' $TMPFILE -+ elif [ "$HAVE_WWID_DISABLE" = 0 ]; then -+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[[:space:]]*wwid \"\.\?\*\"/ wwid ".*"/' $TMPFILE -+ fi -+ if [ "$HAVE_EXCEPTIONS" = 1 ]; then -+ sed -i '/^blacklist_exceptions[[:space:]]*{/,/^}/d' $TMPFILE -+ fi -+ echo $HAVE_WWID_DISABLE -+ add_blacklist_exceptions -+elif [ "$ENABLE" = 1 ]; then - if [ "$HAVE_DISABLE" = 1 ]; then - sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*devnode \"\.\?\*\"/# devnode ".*"/' $TMPFILE - fi - elif [ "$ENABLE" = 0 ]; then - if [ -z "$HAVE_DISABLE" ]; then - sed -i '/^blacklist[[:space:]]*{/ a\ -- devnode "*" -+ devnode ".*" - ' $TMPFILE - elif [ "$HAVE_DISABLE" = 0 ]; then -- sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[#[:space:]]*devnode \"\.\?\*\"/ devnode ".*"/' $TMPFILE -+ sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[[:space:]]*devnode \"\.\?\*\"/ devnode ".*"/' $TMPFILE - fi - fi - -@@ -303,17 +416,17 @@ elif [ "$FRIENDLY" = "y" ]; then - fi - fi - --if [ -f "$CONFIGFILE" ]; then -- cp $CONFIGFILE $CONFIGFILE.old -+if [ -f "$OUTPUTFILE" ]; then -+ cp $OUTPUTFILE $OUTPUTFILE.old - if [ $? != 0 ]; then -- echo "failed to backup old config file, $CONFIGFILE not updated" -+ echo "failed to backup old config file, $OUTPUTFILE not updated" - exit 1 - fi - fi - --cp $TMPFILE $CONFIGFILE -+cp $TMPFILE $OUTPUTFILE - if [ $? != 0 ]; then -- echo "failed to copy new config file into place, check $CONFIGFILE is still OK" -+ echo "failed to copy new config file into place, check $OUTPUTFILE is still OK" - exit 1 - fi - diff --git a/0129-RHBZ-1241774-sun-partition-numbering.patch b/0129-RHBZ-1241774-sun-partition-numbering.patch deleted file mode 100644 index 1cf555f..0000000 --- a/0129-RHBZ-1241774-sun-partition-numbering.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - kpartx/sun.c | 2 -- - 1 file changed, 2 deletions(-) - -Index: multipath-tools-130222/kpartx/sun.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/sun.c -+++ multipath-tools-130222/kpartx/sun.c -@@ -82,8 +82,6 @@ read_sun_pt(int fd, struct slice all, st - for(i=0, n=0; ipartitions[i]; - -- if (s->num_sectors == 0) -- continue; - if (n < ns) { - sp[n].start = offset + - be32_to_cpu(s->start_cylinder) * be16_to_cpu(l->nsect) * be16_to_cpu(l->ntrks); diff --git a/0130-UPBZ-1254292-iscsi-targetname.patch b/0130-UPBZ-1254292-iscsi-targetname.patch deleted file mode 100644 index 26a6831..0000000 --- a/0130-UPBZ-1254292-iscsi-targetname.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmultipath/discovery.c | 2 ++ - 1 file changed, 2 insertions(+) - -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -280,6 +280,8 @@ sysfs_get_tgt_nodename (struct path *pp, - const char *value; - - value = udev_device_get_sysattr_value(tgtdev, "tgtname"); -+ if (!value) -+ value = udev_device_get_sysattr_value(tgtdev, "targetname"); - if (value) { - pp->sg_id.proto_id = SCSI_PROTOCOL_ISCSI; - pp->sg_id.transport_id = tgtid; diff --git a/0131-RHBZ-1259523-host_name_len.patch b/0131-RHBZ-1259523-host_name_len.patch deleted file mode 100644 index 1460550..0000000 --- a/0131-RHBZ-1259523-host_name_len.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmultipath/structs.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/structs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.h -+++ multipath-tools-130222/libmultipath/structs.h -@@ -15,7 +15,7 @@ - #define BLK_DEV_SIZE 33 - #define PATH_SIZE 512 - #define NAME_SIZE 512 --#define HOST_NAME_LEN 8 -+#define HOST_NAME_LEN 16 - #define SLOT_NAME_SIZE 40 - - #define SCSI_VENDOR_SIZE 9 diff --git a/0132-UPBZ-1259831-lock-retry.patch b/0132-UPBZ-1259831-lock-retry.patch deleted file mode 100644 index 3f5bd4d..0000000 --- a/0132-UPBZ-1259831-lock-retry.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- - multipathd/main.c | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -462,6 +462,7 @@ ev_add_path (struct path * pp, struct ve - char params[PARAMS_SIZE] = {0}; - int retries = 3; - int start_waiter = 0; -+ int ret; - - /* - * need path UID to go any further -@@ -540,7 +541,15 @@ rescan: - /* - * reload the map for the multipath mapped device - */ -- if (domap(mpp, params) <= 0) { -+retry: -+ ret = domap(mpp, params); -+ if (ret <= 0) { -+ if (ret < 0 && retries-- > 0) { -+ condlog(0, "%s: retry domap for addition of new " -+ "path %s", mpp->alias, pp->dev); -+ sleep(1); -+ goto retry; -+ } - condlog(0, "%s: failed in domap for addition of new " - "path %s", mpp->alias, pp->dev); - /* diff --git a/0133-RHBZ-1296979-fix-define.patch b/0133-RHBZ-1296979-fix-define.patch deleted file mode 100644 index cc50722..0000000 --- a/0133-RHBZ-1296979-fix-define.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmultipath/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-bz1296979/libmultipath/Makefile -=================================================================== ---- multipath-bz1296979.orig/libmultipath/Makefile -+++ multipath-bz1296979/libmultipath/Makefile -@@ -30,7 +30,7 @@ ifneq ($(strip $(LIBDM_API_COOKIE)),0) - CFLAGS += -DLIBDM_API_COOKIE - endif - --LIBUDEV_API_RECVBUF = $(shell grep -Ecs '^[a-z]*[[:space:]]+udev_monitor_set_resolve_buffer_size' /usr/include/libudev.h) -+LIBUDEV_API_RECVBUF = $(shell grep -Ecs '^[a-z]*[[:space:]]+udev_monitor_set_receive_buffer_size' /usr/include/libudev.h) - - ifneq ($(strip $(LIBUDEV_API_RECVBUF)),0) - CFLAGS += -DLIBUDEV_API_RECVBUF diff --git a/0134-RHBZ-1241528-check-mpath-prefix.patch b/0134-RHBZ-1241528-check-mpath-prefix.patch deleted file mode 100644 index 9701a36..0000000 --- a/0134-RHBZ-1241528-check-mpath-prefix.patch +++ /dev/null @@ -1,168 +0,0 @@ ---- - libmpathpersist/mpath_persist.c | 4 +- - libmultipath/devmapper.c | 67 +++++++++++++++++++++++++++++----------- - libmultipath/devmapper.h | 1 - multipathd/main.c | 2 - - 4 files changed, 53 insertions(+), 21 deletions(-) - -Index: multipath-tools-130222/libmpathpersist/mpath_persist.c -=================================================================== ---- multipath-tools-130222.orig/libmpathpersist/mpath_persist.c -+++ multipath-tools-130222/libmpathpersist/mpath_persist.c -@@ -160,7 +160,7 @@ int mpath_persistent_reserve_in (int fd, - - condlog(3, "alias = %s", alias); - map_present = dm_map_present(alias); -- if (map_present && dm_type(alias, TGT_MPATH) <= 0){ -+ if (map_present && !dm_is_mpath(alias)){ - condlog( 0, "%s: not a multipath device.", alias); - ret = MPATH_PR_DMMP_ERROR; - goto out; -@@ -250,7 +250,7 @@ int mpath_persistent_reserve_out ( int f - condlog(3, "alias = %s", alias); - map_present = dm_map_present(alias); - -- if (map_present && dm_type(alias, TGT_MPATH) <= 0){ -+ if (map_present && !dm_is_mpath(alias)){ - condlog(3, "%s: not a multipath device.", alias); - ret = MPATH_PR_DMMP_ERROR; - goto out; -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -564,6 +564,48 @@ out: - return r; - } - -+extern int -+dm_is_mpath(const char * name) -+{ -+ int r = 0; -+ struct dm_task *dmt; -+ struct dm_info info; -+ uint64_t start, length; -+ char *target_type = NULL; -+ char *params; -+ const char *uuid; -+ -+ if (!(dmt = dm_task_create(DM_DEVICE_TABLE))) -+ return 0; -+ -+ if (!dm_task_set_name(dmt, name)) -+ goto out; -+ -+ dm_task_no_open_count(dmt); -+ -+ if (!dm_task_run(dmt)) -+ goto out; -+ -+ if (!dm_task_get_info(dmt, &info) || !info.exists) -+ goto out; -+ -+ uuid = dm_task_get_uuid(dmt); -+ -+ if (!uuid || strncmp(uuid, UUID_PREFIX, UUID_PREFIX_LEN) != 0) -+ goto out; -+ -+ /* Fetch 1st target */ -+ dm_get_next_target(dmt, NULL, &start, &length, &target_type, ¶ms); -+ -+ if (!target_type || strcmp(target_type, TGT_MPATH) != 0) -+ goto out; -+ -+ r = 1; -+out: -+ dm_task_destroy(dmt); -+ return r; -+} -+ - static int - dm_dev_t (const char * mapname, char * dev_t, int len) - { -@@ -672,10 +714,7 @@ _dm_flush_map (const char * mapname, int - { - int r; - -- if (!dm_map_present(mapname)) -- return 0; -- -- if (dm_type(mapname, TGT_MPATH) <= 0) -+ if (!dm_is_mpath(mapname)) - return 0; /* nothing to do */ - - if (dm_remove_partmaps(mapname, need_sync, deferred_remove)) -@@ -725,10 +764,7 @@ dm_suspend_and_flush_map (const char * m - unsigned long long mapsize; - char params[PARAMS_SIZE] = {0}; - -- if (!dm_map_present(mapname)) -- return 0; -- -- if (dm_type(mapname, TGT_MPATH) <= 0) -+ if (!dm_is_mpath(mapname)) - return 0; /* nothing to do */ - - if (!dm_get_map(mapname, &mapsize, params)) { -@@ -899,7 +935,6 @@ dm_get_maps (vector mp) - { - struct multipath * mpp; - int r = 1; -- int info; - struct dm_task *dmt; - struct dm_names *names; - unsigned next = 0; -@@ -924,9 +959,7 @@ dm_get_maps (vector mp) - } - - do { -- info = dm_type(names->name, TGT_MPATH); -- -- if (info <= 0) -+ if (!dm_is_mpath(names->name)) - goto next; - - mpp = alloc_multipath(); -@@ -939,13 +972,11 @@ dm_get_maps (vector mp) - if (!mpp->alias) - goto out1; - -- if (info > 0) { -- if (dm_get_map(names->name, &mpp->size, NULL)) -- goto out1; -+ if (dm_get_map(names->name, &mpp->size, NULL)) -+ goto out1; - -- dm_get_uuid(names->name, mpp->wwid); -- dm_get_info(names->name, &mpp->dmi); -- } -+ dm_get_uuid(names->name, mpp->wwid); -+ dm_get_info(names->name, &mpp->dmi); - - if (!vector_alloc_slot(mp)) - goto out1; -Index: multipath-tools-130222/libmultipath/devmapper.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.h -+++ multipath-tools-130222/libmultipath/devmapper.h -@@ -23,6 +23,7 @@ int dm_map_present (const char *); - int dm_get_map(const char *, unsigned long long *, char *); - int dm_get_status(char *, char *); - int dm_type(const char *, char *); -+int dm_is_mpath(const char *); - int _dm_flush_map (const char *, int, int); - int dm_flush_map_nopaths(const char * mapname, int deferred_remove); - #define dm_flush_map(mapname) _dm_flush_map(mapname, 1, 0) -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -285,7 +285,7 @@ ev_add_map (char * dev, char * alias, st - - map_present = dm_map_present(alias); - -- if (map_present && dm_type(alias, TGT_MPATH) <= 0) { -+ if (map_present && !dm_is_mpath(alias)) { - condlog(4, "%s: not a multipath map", alias); - return 0; - } diff --git a/0135-RHBZ-1299600-path-dev-uevents.patch b/0135-RHBZ-1299600-path-dev-uevents.patch deleted file mode 100644 index 2de58a4..0000000 --- a/0135-RHBZ-1299600-path-dev-uevents.patch +++ /dev/null @@ -1,121 +0,0 @@ ---- - libmultipath/configure.c | 30 ++++++++++++++++++++++++++++-- - libmultipath/configure.h | 1 + - libmultipath/wwids.c | 4 ++-- - multipath/main.c | 2 +- - multipathd/main.c | 3 ++- - 5 files changed, 34 insertions(+), 6 deletions(-) - -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -38,6 +38,7 @@ - #include "util.h" - #include "uxsock.h" - #include "wwids.h" -+#include "sysfs.h" - - /* group paths in pg by host adapter - */ -@@ -569,6 +570,29 @@ fail: - return 1; - } - -+void -+trigger_uevents (struct multipath *mpp) -+{ -+ struct pathgroup * pgp; -+ struct path * pp; -+ int i, j; -+ -+ if (!mpp || !mpp->pg) -+ return; -+ -+ vector_foreach_slot (mpp->pg, pgp, i) { -+ if (!pgp->paths) -+ continue; -+ vector_foreach_slot(pgp->paths, pp, j) { -+ if (!pp->udev) -+ continue; -+ sysfs_attr_set_value(pp->udev, "uevent", "change", -+ strlen("change")); -+ } -+ } -+} -+ -+ - /* - * Return value: - */ -@@ -658,8 +682,10 @@ domap (struct multipath * mpp, char * pa - * DM_DEVICE_CREATE, DM_DEVICE_RENAME, or DM_DEVICE_RELOAD - * succeeded - */ -- if (mpp->action == ACT_CREATE) -- remember_wwid(mpp->wwid); -+ if (mpp->action == ACT_CREATE) { -+ if (remember_wwid(mpp->wwid) == 1) -+ trigger_uevents(mpp); -+ } - if (!conf->daemon) { - /* multipath client mode */ - dm_switchgroup(mpp->alias, mpp->bestpg); -Index: multipath-tools-130222/libmultipath/wwids.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/wwids.c -+++ multipath-tools-130222/libmultipath/wwids.c -@@ -310,7 +310,7 @@ remember_wwid(char *wwid) - } - else - condlog(4, "wwid %s already in wwids file", wwid); -- return 0; -+ return ret; - } - - int remember_cmdline_wwid(void) -@@ -344,7 +344,7 @@ int remember_cmdline_wwid(void) - next++; - } - if (strlen(ptr)) { -- if (remember_wwid(ptr) != 0) -+ if (remember_wwid(ptr) < 0) - ret = -1; - } - else { -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -303,7 +303,7 @@ configure (void) - } - if (conf->cmd == CMD_ADD_WWID) { - r = remember_wwid(refwwid); -- if (r == 0) -+ if (r >= 0) - printf("wwid '%s' added\n", refwwid); - else - printf("failed adding '%s' to wwids file\n", -Index: multipath-tools-130222/libmultipath/configure.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.h -+++ multipath-tools-130222/libmultipath/configure.h -@@ -31,3 +31,4 @@ int coalesce_paths (struct vectors *vecs - int get_refwwid (char * dev, enum devtypes dev_type, vector pathvec, char **wwid); - int reload_map(struct vectors *vecs, struct multipath *mpp, int refresh); - int sysfs_get_host_adapter_name(struct path *pp, char *adapter_name); -+void trigger_uevents (struct multipath *mpp); -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -1435,7 +1435,8 @@ configure (struct vectors * vecs, int st - - sync_maps_state(mpvec); - vector_foreach_slot(mpvec, mpp, i){ -- remember_wwid(mpp->wwid); -+ if (remember_wwid(mpp->wwid) > 0) -+ trigger_uevents(mpp); - update_map_pr(mpp); - } - diff --git a/0136-RHBZ-1304687-wait-for-map-add.patch b/0136-RHBZ-1304687-wait-for-map-add.patch deleted file mode 100644 index cd9cdee..0000000 --- a/0136-RHBZ-1304687-wait-for-map-add.patch +++ /dev/null @@ -1,495 +0,0 @@ ---- - libmultipath/config.c | 1 - libmultipath/config.h | 2 - libmultipath/configure.c | 4 + - libmultipath/defaults.h | 1 - libmultipath/dict.c | 25 +++++++++ - libmultipath/structs.h | 2 - multipath.conf.defaults | 1 - multipath/multipath.conf.5 | 8 +++ - multipathd/cli_handlers.c | 65 ++++++++++++++++++++---- - multipathd/main.c | 119 +++++++++++++++++++++++++++++++++++++++++++-- - multipathd/main.h | 1 - 11 files changed, 216 insertions(+), 13 deletions(-) - -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -701,6 +701,10 @@ domap (struct multipath * mpp, char * pa - */ - if (mpp->action != ACT_CREATE) - mpp->action = ACT_NOTHING; -+ else { -+ mpp->wait_for_udev = 1; -+ mpp->uev_msg_tick = conf->uev_msg_delay; -+ } - } - dm_setgeometry(mpp); - return DOMAP_OK; -Index: multipath-tools-130222/libmultipath/structs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.h -+++ multipath-tools-130222/libmultipath/structs.h -@@ -217,6 +217,8 @@ struct multipath { - int bestpg; - int queuedio; - int action; -+ int wait_for_udev; -+ int uev_msg_tick; - int pgfailback; - int failback_tick; - int rr_weight; -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -548,6 +548,11 @@ cli_reload(void *v, char **reply, int *l - condlog(0, "%s: invalid map name. cannot reload", mapname); - return 1; - } -+ if (mpp->wait_for_udev) { -+ condlog(2, "%s: device not fully created, failing reload", -+ mpp->alias); -+ return 1; -+ } - - return reload_map(vecs, mpp, 0); - } -@@ -592,6 +597,12 @@ cli_resize(void *v, char **reply, int *l - return 1; - } - -+ if (mpp->wait_for_udev) { -+ condlog(2, "%s: device not fully created, failing resize", -+ mpp->alias); -+ return 1; -+ } -+ - pgp = VECTOR_SLOT(mpp->pg, 0); - - if (!pgp){ -@@ -756,6 +767,12 @@ cli_reconfigure(void * v, char ** reply, - { - struct vectors * vecs = (struct vectors *)data; - -+ if (need_to_delay_reconfig(vecs)) { -+ conf->delayed_reconfig = 1; -+ condlog(2, "delaying reconfigure (operator)"); -+ return 0; -+ } -+ - condlog(2, "reconfigure (operator)"); - - return reconfigure(vecs); -@@ -766,17 +783,25 @@ cli_suspend(void * v, char ** reply, int - { - struct vectors * vecs = (struct vectors *)data; - char * param = get_keyparam(v, MAP); -- int r = dm_simplecmd_noflush(DM_DEVICE_SUSPEND, param, 0); -+ int r; -+ struct multipath * mpp; - - param = convert_dev(param, 0); -- condlog(2, "%s: suspend (operator)", param); -+ mpp = find_mp_by_alias(vecs->mpvec, param); -+ if (!mpp) -+ return 1; - -- if (!r) /* error */ -+ if (mpp->wait_for_udev) { -+ condlog(2, "%s: device not fully created, failing suspend", -+ mpp->alias); - return 1; -+ } - -- struct multipath * mpp = find_mp_by_alias(vecs->mpvec, param); -+ r = dm_simplecmd_noflush(DM_DEVICE_SUSPEND, param, 0); - -- if (!mpp) -+ condlog(2, "%s: suspend (operator)", param); -+ -+ if (!r) /* error */ - return 1; - - dm_get_info(param, &mpp->dmi); -@@ -788,17 +813,25 @@ cli_resume(void * v, char ** reply, int - { - struct vectors * vecs = (struct vectors *)data; - char * param = get_keyparam(v, MAP); -- int r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param, 0); -+ int r; -+ struct multipath * mpp; - - param = convert_dev(param, 0); -- condlog(2, "%s: resume (operator)", param); -+ mpp = find_mp_by_alias(vecs->mpvec, param); -+ if (!mpp) -+ return 1; - -- if (!r) /* error */ -+ if (mpp->wait_for_udev) { -+ condlog(2, "%s: device not fully created, failing resume", -+ mpp->alias); - return 1; -+ } - -- struct multipath * mpp = find_mp_by_alias(vecs->mpvec, param); -+ r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param, 0); - -- if (!mpp) -+ condlog(2, "%s: resume (operator)", param); -+ -+ if (!r) /* error */ - return 1; - - dm_get_info(param, &mpp->dmi); -@@ -831,9 +864,21 @@ cli_reinstate(void * v, char ** reply, i - int - cli_reassign (void * v, char ** reply, int * len, void * data) - { -+ struct vectors * vecs = (struct vectors *)data; - char * param = get_keyparam(v, MAP); -+ struct multipath *mpp; - - param = convert_dev(param, 0); -+ mpp = find_mp_by_alias(vecs->mpvec, param); -+ if (!mpp) -+ return 1; -+ -+ if (mpp->wait_for_udev) { -+ condlog(2, "%s: device not fully created, failing reassign", -+ mpp->alias); -+ return 1; -+ } -+ - condlog(3, "%s: reset devices (operator)", param); - - dm_reassign(param); -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -142,6 +142,8 @@ struct config { - int retrigger_tries; - int retrigger_delay; - int new_bindings_in_boot; -+ int delayed_reconfig; -+ int uev_msg_delay; - unsigned int version[3]; - - char * dev; -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -251,6 +251,47 @@ flush_map(struct multipath * mpp, struct - return 0; - } - -+int -+update_map (struct multipath *mpp, struct vectors *vecs) -+{ -+ int retries = 3; -+ char params[PARAMS_SIZE] = {0}; -+ -+retry: -+ condlog(4, "%s: updating new map", mpp->alias); -+ if (adopt_paths(vecs->pathvec, mpp, 1)) { -+ condlog(0, "%s: failed to adopt paths for new map update", -+ mpp->alias); -+ retries = -1; -+ goto fail; -+ } -+ verify_paths(mpp, vecs, NULL); -+ mpp->flush_on_last_del = FLUSH_UNDEF; -+ mpp->action = ACT_RELOAD; -+ -+ if (setup_map(mpp, params, PARAMS_SIZE)) { -+ condlog(0, "%s: failed to setup new map in update", mpp->alias); -+ retries = -1; -+ goto fail; -+ } -+ if (domap(mpp, params) <= 0 && retries-- > 0) { -+ condlog(0, "%s: map_udate sleep", mpp->alias); -+ sleep(1); -+ goto retry; -+ } -+ dm_lib_release(); -+ -+fail: -+ if (setup_multipath(vecs, mpp)) -+ return 1; -+ -+ sync_map_state(mpp); -+ -+ if (retries < 0) -+ condlog(0, "%s: failed reload in new map update", mpp->alias); -+ return 0; -+} -+ - static int - uev_add_map (struct uevent * uev, struct vectors * vecs) - { -@@ -293,6 +334,20 @@ ev_add_map (char * dev, char * alias, st - mpp = find_mp_by_alias(vecs->mpvec, alias); - - if (mpp) { -+ if (mpp->wait_for_udev > 1) { -+ if (update_map(mpp, vecs)) -+ /* setup multipathd removed the map */ -+ return 1; -+ } -+ if (mpp->wait_for_udev) { -+ mpp->wait_for_udev = 0; -+ if (conf->delayed_reconfig && -+ !need_to_delay_reconfig(vecs)) { -+ condlog(2, "reconfigure (delayed)"); -+ reconfigure(vecs); -+ return 0; -+ } -+ } - /* - * Not really an error -- we generate our own uevent - * if we create a multipath mapped device as a result -@@ -471,7 +526,14 @@ ev_add_path (struct path * pp, struct ve - condlog(0, "%s: failed to get path uid", pp->dev); - goto fail; /* leave path added to pathvec */ - } -- mpp = pp->mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid); -+ mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid); -+ if (mpp && mpp->wait_for_udev) { -+ mpp->wait_for_udev = 2; -+ orphan_path(pp); -+ return 0; -+ } -+ -+ pp->mpp = mpp; - rescan: - if (mpp) { - if ((!pp->size) || (mpp->size != pp->size)) { -@@ -670,6 +732,12 @@ ev_remove_path (struct path *pp, struct - " removal of path %s", mpp->alias, pp->dev); - goto fail; - } -+ -+ if (mpp->wait_for_udev) { -+ mpp->wait_for_udev = 2; -+ goto out; -+ } -+ - /* - * reload the map - */ -@@ -731,6 +799,11 @@ uev_update_path (struct uevent *uev, str - condlog(2, "%s: update path write_protect to '%d' (uevent)", - uev->kernel, ro); - if (pp->mpp) { -+ if (pp->mpp->wait_for_udev) { -+ pp->mpp->wait_for_udev = 2; -+ return 0; -+ } -+ - retval = reload_map(vecs, pp->mpp, 0); - - condlog(2, "%s: map %s reloaded (retval %d)", -@@ -1063,6 +1136,20 @@ followover_should_failback(struct path * - } - - static void -+missing_uev_message_tick(vector mpvec) -+{ -+ struct multipath * mpp; -+ unsigned int i; -+ -+ vector_foreach_slot (mpvec, mpp, i) { -+ if (mpp->wait_for_udev && --mpp->uev_msg_tick <= 0) { -+ condlog(0, "%s: startup incomplete. Still waiting on udev", mpp->alias); -+ mpp->uev_msg_tick = conf->uev_msg_delay; -+ } -+ } -+} -+ -+static void - defered_failback_tick (vector mpvec) - { - struct multipath * mpp; -@@ -1316,6 +1403,9 @@ check_path (struct vectors * vecs, struc - - pp->state = newstate; - -+ -+ if (pp->mpp->wait_for_udev) -+ return; - /* - * path prio refreshing - */ -@@ -1369,6 +1459,7 @@ checkerloop (void *ap) - if (vecs->mpvec) { - defered_failback_tick(vecs->mpvec); - retry_count_tick(vecs->mpvec); -+ missing_uev_message_tick(vecs->mpvec); - } - if (count) - count--; -@@ -1465,6 +1556,22 @@ configure (struct vectors * vecs, int st - } - - int -+need_to_delay_reconfig(struct vectors * vecs) -+{ -+ struct multipath *mpp; -+ int i; -+ -+ if (!VECTOR_SIZE(vecs->mpvec)) -+ return 0; -+ -+ vector_foreach_slot(vecs->mpvec, mpp, i) { -+ if (mpp->wait_for_udev) -+ return 1; -+ } -+ return 0; -+} -+ -+int - reconfigure (struct vectors * vecs) - { - struct config * old = conf; -@@ -1544,12 +1651,18 @@ void - handle_signals(void) - { - if (reconfig_sig && running_state == DAEMON_RUNNING) { -- condlog(2, "reconfigure (signal)"); - pthread_cleanup_push(cleanup_lock, - &gvecs->lock); - lock(gvecs->lock); - pthread_testcancel(); -- reconfigure(gvecs); -+ if (need_to_delay_reconfig(gvecs)) { -+ conf->delayed_reconfig = 1; -+ condlog(2, "delaying reconfigure (signal)"); -+ } -+ else { -+ condlog(2, "reconfigure (signal)"); -+ reconfigure(gvecs); -+ } - lock_cleanup_pop(gvecs->lock); - } - if (log_reset_sig) { -Index: multipath-tools-130222/multipathd/main.h -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.h -+++ multipath-tools-130222/multipathd/main.h -@@ -18,6 +18,7 @@ extern pid_t daemon_pid; - - void exit_daemon(void); - const char * daemon_status(void); -+int need_to_delay_reconfig (struct vectors *); - int reconfigure (struct vectors *); - int ev_add_path (struct path *, struct vectors *); - int ev_remove_path (struct path *, struct vectors *); -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -676,6 +676,7 @@ load_config (char * file, struct udev *u - conf->retrigger_tries = DEFAULT_RETRIGGER_TRIES; - conf->retrigger_delay = DEFAULT_RETRIGGER_DELAY; - conf->new_bindings_in_boot = 0; -+ conf->uev_msg_delay = DEFAULT_UEV_MSG_DELAY; - - /* - * preload default hwtable -Index: multipath-tools-130222/libmultipath/defaults.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/defaults.h -+++ multipath-tools-130222/libmultipath/defaults.h -@@ -23,6 +23,7 @@ - #define DEFAULT_DELAY_CHECKS DELAY_CHECKS_OFF - #define DEFAULT_RETRIGGER_DELAY 10 - #define DEFAULT_RETRIGGER_TRIES 3 -+#define DEFAULT_UEV_MSG_DELAY 30 - - #define DEFAULT_CHECKINT 5 - #define MAX_CHECKINT(a) (a << 2) -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -872,6 +872,24 @@ def_retrigger_delay_handler(vector strve - } - - static int -+def_uev_msg_delay_handler(vector strvec) -+{ -+ char *buff; -+ -+ buff = set_value(strvec); -+ -+ if (!buff) -+ return 1; -+ -+ conf->uev_msg_delay = atoi(buff); -+ if (conf->uev_msg_delay <= 0) -+ conf->uev_msg_delay = DEFAULT_UEV_MSG_DELAY; -+ FREE(buff); -+ -+ return 0; -+} -+ -+static int - def_new_bindings_in_boot_handler(vector strvec) - { - char * buff; -@@ -3261,6 +3279,12 @@ snprint_def_retrigger_delay (char * buff - } - - static int -+snprint_def_uev_msg_delay (char * buff, int len, void * data) -+{ -+ return snprintf(buff, len, "%i", conf->uev_msg_delay); -+} -+ -+static int - snprint_def_new_bindings_in_boot(char * buff, int len, void * data) - { - if (conf->new_bindings_in_boot == 1) -@@ -3345,6 +3369,7 @@ init_keywords(void) - install_keyword("delay_wait_checks", &def_delay_wait_checks_handler, &snprint_def_delay_wait_checks); - install_keyword("retrigger_tries", &def_retrigger_tries_handler, &snprint_def_retrigger_tries); - install_keyword("retrigger_delay", &def_retrigger_delay_handler, &snprint_def_retrigger_delay); -+ install_keyword("missing_uev_msg_delay", &def_uev_msg_delay_handler, &snprint_def_uev_msg_delay); - install_keyword("new_bindings_in_boot", &def_new_bindings_in_boot_handler, &snprint_def_new_bindings_in_boot); - __deprecated install_keyword("default_selector", &def_selector_handler, NULL); - __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); -Index: multipath-tools-130222/multipath.conf.defaults -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.defaults -+++ multipath-tools-130222/multipath.conf.defaults -@@ -29,6 +29,7 @@ - # config_dir "/etc/multipath/conf.d" - # delay_watch_checks no - # delay_wait_checks no -+# missing_uev_msg_delay 30 - #} - #blacklist { - # devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -478,6 +478,14 @@ used until it has passed - .I delay_wait_checks - checks. Default is - .I no -+.TP -+.B missing_uev_msg_delay -+Controls how long multipathd will wait, after a new multipath device is created, -+to receive a change event from udev for the device, before printing a warning -+message. This warning message will print every -+.I missing_uev_msg_delay -+seconds until the uevent is received. the default is -+.I 30 - . - .SH "blacklist section" - The diff --git a/0137-RHBZ-1280524-clear-chkr-msg.patch b/0137-RHBZ-1280524-clear-chkr-msg.patch deleted file mode 100644 index b7cd118..0000000 --- a/0137-RHBZ-1280524-clear-chkr-msg.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - multipathd/main.c | 2 ++ - 1 file changed, 2 insertions(+) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -1257,6 +1257,8 @@ check_path (struct vectors * vecs, struc - newstate = path_offline(pp); - if (newstate == PATH_UP) - newstate = get_state(pp, 1); -+ else -+ checker_clear_message(&pp->checker); - - if (newstate == PATH_WILD || newstate == PATH_UNCHECKED) { - condlog(2, "%s: unusable path", pp->dev); diff --git a/0138-RHBZ-1288660-fix-mpathconf-allow.patch b/0138-RHBZ-1288660-fix-mpathconf-allow.patch deleted file mode 100644 index 421f877..0000000 --- a/0138-RHBZ-1288660-fix-mpathconf-allow.patch +++ /dev/null @@ -1,86 +0,0 @@ ---- - multipath/mpathconf | 37 ++++++++++++++++++++++++++----------- - 1 file changed, 26 insertions(+), 11 deletions(-) - -Index: multipath-tools-130222/multipath/mpathconf -=================================================================== ---- multipath-tools-130222.orig/multipath/mpathconf -+++ multipath-tools-130222/multipath/mpathconf -@@ -59,6 +59,19 @@ function usage - echo "" - } - -+function add_wwid -+{ -+ INDEX=0 -+ while [ "$INDEX" -lt "$WWIDS" ] ; do -+ if [ "$1" = "${WWID_LIST[$INDEX]}" ] ; then -+ return -+ fi -+ ((INDEX++)) -+ done -+ WWID_LIST[$WWIDS]="$1" -+ ((WWIDS++)) -+} -+ - function get_dm_deps - { - shift 3 -@@ -76,11 +89,9 @@ function get_dm_deps - function set_dm_wwid - { - if [[ "$1" =~ ^part[[:digit:]]+-mpath- ]] ; then -- WWID_LIST[$WWIDS]="${1##part*-mpath-}" -- ((WWIDS++)) -+ add_wwid "${1##part*-mpath-}" - elif [[ "$1" =~ ^mpath- ]] ; then -- WWID_LIST[$WWIDS]="${1##mpath-}" -- ((WWIDS++)) -+ add_wwid "${1##mpath-}" - else - get_dm_deps `dmsetup deps -u $1` - fi -@@ -99,8 +110,7 @@ function set_wwid - if [ -n "$UUID" ] ; then - set_dm_wwid $UUID - else -- WWID_LIST[$WWIDS]="$1" -- ((WWIDS++)) -+ add_wwid "$1" - fi - } - -@@ -215,13 +225,13 @@ function validate_args - - function add_blacklist_exceptions - { -- echo "blacklist_exceptions {" >> $TMPFILE - INDEX=0 - while [ "$INDEX" -lt "$WWIDS" ] ; do -- echo " wwid \"${WWID_LIST[$INDEX]}\"" >> $TMPFILE -+ sed -i '/^blacklist_exceptions[[:space:]]*{/ a\ -+ wwid '"\"${WWID_LIST[$INDEX]}\""' -+' $TMPFILE - ((INDEX++)) - done -- echo "}" >> $TMPFILE - } - - umask 0077 -@@ -364,9 +374,14 @@ if [ "$ENABLE" = 2 ]; then - sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[[:space:]]*wwid \"\.\?\*\"/ wwid ".*"/' $TMPFILE - fi - if [ "$HAVE_EXCEPTIONS" = 1 ]; then -- sed -i '/^blacklist_exceptions[[:space:]]*{/,/^}/d' $TMPFILE -+ sed -i '/^blacklist_exceptions[[:space:]]*{/,/^}/ {/^[[:space:]]*wwid/ d}' $TMPFILE -+ else -+ cat >> $TMPFILE <<- _EOF_ -+ -+blacklist_exceptions { -+} -+_EOF_ - fi -- echo $HAVE_WWID_DISABLE - add_blacklist_exceptions - elif [ "$ENABLE" = 1 ]; then - if [ "$HAVE_DISABLE" = 1 ]; then diff --git a/0139-RHBZ-1273173-queue-no-daemon-doc.patch b/0139-RHBZ-1273173-queue-no-daemon-doc.patch deleted file mode 100644 index 4531c1d..0000000 --- a/0139-RHBZ-1273173-queue-no-daemon-doc.patch +++ /dev/null @@ -1,162 +0,0 @@ ---- - multipath.conf.defaults | 57 +++++++++++++++++++++++++++++++++++++-------- - multipath/multipath.conf.5 | 2 - - 2 files changed, 48 insertions(+), 11 deletions(-) - -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -377,7 +377,7 @@ multipathd running, access to the paths - cannot be told to stop queueing IO. Setting queue_without_daemon to - .I no - , avoids this problem. Default is --.I yes -+.I no - .TP - .B bindings_file - The full pathname of the binding file to be used when the user_friendly_names option is set. Defaults to -Index: multipath-tools-130222/multipath.conf.defaults -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.defaults -+++ multipath-tools-130222/multipath.conf.defaults -@@ -1,9 +1,12 @@ - # These are the compiled in default settings. They will be used unless you - # overwrite these values in your config file. -- -+ - #defaults { - # verbosity 2 - # polling_interval 5 -+# max_polling_interval 20 -+# reassign_maps "yes" -+# multipath_dir "/lib64/multipath" - # path_selector "service-time 0" - # path_grouping_policy "failover" - # uid_attribute "ID_SERIAL" -@@ -12,28 +15,35 @@ - # features "0" - # path_checker "directio" - # alias_prefix "mpath" -+# failback "manual" - # rr_min_io 1000 - # rr_min_io_rq 1 - # max_fds 1048576 - # rr_weight "uniform" --# queue_without_daemon "yes" --# pg_timeout "none" -+# queue_without_daemon "no" - # flush_on_last_del "no" - # user_friendly_names "no" - # fast_io_fail_tmo 5 - # bindings_file "/etc/multipath/bindings" - # wwids_file /etc/multipath/wwids - # log_checker_err always -+# find_multipaths no - # retain_attached_hw_handler no - # detect_prio no -+# hw_str_match no -+# force_sync no -+# deferred_remove no -+# ignore_new_boot_devs no - # config_dir "/etc/multipath/conf.d" - # delay_watch_checks no - # delay_wait_checks no --# missing_uev_msg_delay 30 -+# retrigger_tries 3 -+# retrigger_delay 10 -+# new_bindings_in_boot no - #} - #blacklist { - # devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" --# devnode "^hd[a-z]" -+# devnode "^(td|hd|vd)[a-z]" - # devnode "^dcssblk[0-9]*" - # device { - # vendor "DGC" -@@ -68,7 +78,7 @@ - # product "Universal Xport" - # } - # device { --# vendor "(LSI|ENGENIO)" -+# vendor "(NETAPP|LSI|ENGENIO)" - # product "Universal Xport" - # } - #} -@@ -666,7 +676,7 @@ - # features "2 pg_init_retries 50" - # hardware_handler "1 rdac" - # prio "rdac" --# failback "immediate" -+# failback immediate - # rr_weight "uniform" - # no_path_retry 15 - # } -@@ -679,7 +689,7 @@ - # features "2 pg_init_retries 50" - # hardware_handler "1 rdac" - # prio "rdac" --# failback "immediate" -+# failback immediate - # rr_weight "uniform" - # no_path_retry 15 - # } -@@ -696,6 +706,7 @@ - # rr_min_io 128 - # flush_on_last_del "yes" - # dev_loss_tmo "infinity" -+# user_friendly_names no - # retain_attached_hw_handler yes - # detect_prio yes - # } -@@ -876,7 +887,7 @@ - # rr_min_io_rq 1 - # } - # device { --# vendor "(LSI|ENGENIO)" -+# vendor "(NETAPP|LSI|ENGENIO)" - # product "INF-01-00" - # product_blacklist "Universal Xport" - # path_grouping_policy "group_by_prio" -@@ -886,7 +897,9 @@ - # prio "rdac" - # failback immediate - # rr_weight "uniform" --# no_path_retry 15 -+# no_path_retry 30 -+# retain_attached_hw_handler yes -+# detect_prio yes - # } - # device { - # vendor "STK" -@@ -925,6 +938,30 @@ - # rr_weight "uniform" - # no_path_retry "queue" - # } -+# device { -+# vendor "DataCore" -+# product "Virtual Disk" -+# path_grouping_policy "group_by_prio" -+# path_checker "tur" -+# features "0" -+# hardware_handler "0" -+# prio "alua" -+# failback immediate -+# rr_weight "uniform" -+# no_path_retry "queue" -+# } -+# device { -+# vendor "XtremIO" -+# product "XtremApp" -+# path_grouping_policy "multibus" -+# path_selector "queue-length 0" -+# path_checker "directio" -+# features "0" -+# hardware_handler "0" -+# prio "const" -+# failback immediate -+# fast_io_fail_tmo 15 -+# } - #} - #multipaths { - #} diff --git a/0140-RHBZ-1299647-fix-help.patch b/0140-RHBZ-1299647-fix-help.patch deleted file mode 100644 index c504974..0000000 --- a/0140-RHBZ-1299647-fix-help.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- - multipath/main.c | 1 - - 1 file changed, 1 deletion(-) - -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -111,7 +111,6 @@ usage (char * progname) - " -r force devmap reload\n" \ - " -i ignore wwids file\n" \ - " -B treat the bindings file as read only\n" \ -- " -p policy failover|multibus|group_by_serial|group_by_prio\n" \ - " -b fil bindings file location\n" \ - " -w remove a device from the wwids file\n" \ - " -W reset the wwids file include only the current devices\n" \ diff --git a/0141-RHBZ-1303953-mpathpersist-typo.patch b/0141-RHBZ-1303953-mpathpersist-typo.patch deleted file mode 100644 index 7525902..0000000 --- a/0141-RHBZ-1303953-mpathpersist-typo.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmpathpersist/mpath_persist.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/libmpathpersist/mpath_persist.c -=================================================================== ---- multipath-tools-130222.orig/libmpathpersist/mpath_persist.c -+++ multipath-tools-130222/libmpathpersist/mpath_persist.c -@@ -822,7 +822,7 @@ int update_map_pr(struct multipath *mpp) - if (!mpp->reservation_key) - { - /* Nothing to do. Assuming pr mgmt feature is disabled*/ -- condlog(3, "%s: reservation_key not set in multiapth.conf", mpp->alias); -+ condlog(3, "%s: reservation_key not set in multipath.conf", mpp->alias); - return MPATH_PR_SUCCESS; - } - diff --git a/0142-RHBZ-1283750-kpartx-fix.patch b/0142-RHBZ-1283750-kpartx-fix.patch deleted file mode 100644 index 0bc21b8..0000000 --- a/0142-RHBZ-1283750-kpartx-fix.patch +++ /dev/null @@ -1,189 +0,0 @@ ---- - kpartx/devmapper.c | 17 +++++++++++++-- - kpartx/devmapper.h | 2 - - kpartx/kpartx.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++--- - 3 files changed, 69 insertions(+), 7 deletions(-) - -Index: multipath-tools-130222/kpartx/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/devmapper.c -+++ multipath-tools-130222/kpartx/devmapper.c -@@ -140,12 +140,16 @@ addout: - } - - extern int --dm_map_present (char * str) -+dm_map_present (char * str, char **uuid) - { - int r = 0; - struct dm_task *dmt; -+ const char *uuidtmp; - struct dm_info info; - -+ if (uuid) -+ *uuid = NULL; -+ - if (!(dmt = dm_task_create(DM_DEVICE_INFO))) - return 0; - -@@ -160,8 +164,15 @@ dm_map_present (char * str) - if (!dm_task_get_info(dmt, &info)) - goto out; - -- if (info.exists) -- r = 1; -+ if (!info.exists) -+ goto out; -+ -+ r = 1; -+ if (uuid) { -+ uuidtmp = dm_task_get_uuid(dmt); -+ if (uuidtmp && strlen(uuidtmp)) -+ *uuid = strdup(uuidtmp); -+ } - out: - dm_task_destroy(dmt); - return r; -Index: multipath-tools-130222/kpartx/devmapper.h -=================================================================== ---- multipath-tools-130222.orig/kpartx/devmapper.h -+++ multipath-tools-130222/kpartx/devmapper.h -@@ -14,7 +14,7 @@ int dm_prereq (char *, int, int, int); - int dm_simplecmd (int, const char *, int, uint32_t *, uint16_t); - int dm_addmap (int, const char *, const char *, const char *, uint64_t, - int, const char *, int, mode_t, uid_t, gid_t, uint32_t *); --int dm_map_present (char *); -+int dm_map_present (char *, char **); - char * dm_mapname(int major, int minor); - dev_t dm_get_first_dep(char *devname); - char * dm_mapuuid(int major, int minor); -Index: multipath-tools-130222/kpartx/kpartx.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.c -+++ multipath-tools-130222/kpartx/kpartx.c -@@ -191,6 +191,21 @@ get_hotplug_device(void) - return device; - } - -+static int -+check_uuid(char *uuid, char *part_uuid, char **err_msg) { -+ char *map_uuid = strchr(part_uuid, '-'); -+ if (!map_uuid || strncmp(part_uuid, "part", 4) != 0) { -+ *err_msg = "not a kpartx partition"; -+ return -1; -+ } -+ map_uuid++; -+ if (strcmp(uuid, map_uuid) != 0) { -+ *err_msg = "a partition of a different device"; -+ return -1; -+ } -+ return 0; -+} -+ - int - main(int argc, char **argv){ - int i, j, m, n, op, off, arg, ro=0; -@@ -410,6 +425,8 @@ main(int argc, char **argv){ - - case DELETE: - for (j = MAXSLICES-1; j >= 0; j--) { -+ char *part_uuid, *reason; -+ - if (safe_sprintf(partname, "%s%s%d", - mapname, delim, j+1)) { - fprintf(stderr, "partname too small\n"); -@@ -417,9 +434,18 @@ main(int argc, char **argv){ - } - strip_slash(partname); - -- if (!dm_map_present(partname)) -+ if (!dm_map_present(partname, &part_uuid)) - continue; - -+ if (part_uuid && uuid) { -+ if (check_uuid(uuid, part_uuid, &reason) != 0) { -+ fprintf(stderr, "%s is %s. Not removing\n", partname, reason); -+ free(part_uuid); -+ continue; -+ } -+ free(part_uuid); -+ } -+ - if (!dm_simplecmd(DM_DEVICE_REMOVE, partname, - 0, &cookie, 0)) { - r++; -@@ -444,6 +470,8 @@ main(int argc, char **argv){ - case UPDATE: - /* ADD and UPDATE share the same code that adds new partitions. */ - for (j = 0; j < n; j++) { -+ char *part_uuid, *reason; -+ - if (slices[j].size == 0) - continue; - -@@ -460,9 +488,19 @@ main(int argc, char **argv){ - exit(1); - } - -- op = (dm_map_present(partname) ? -+ op = (dm_map_present(partname, &part_uuid) ? - DM_DEVICE_RELOAD : DM_DEVICE_CREATE); - -+ if (part_uuid && uuid) { -+ if (check_uuid(uuid, part_uuid, &reason) != 0) { -+ fprintf(stderr, "%s is already in use, and %s\n", partname, reason); -+ r++; -+ free(part_uuid); -+ continue; -+ } -+ free(part_uuid); -+ } -+ - if (!dm_addmap(op, partname, DM_TARGET, params, - slices[j].size, ro, uuid, j+1, - buf.st_mode & 0777, buf.st_uid, -@@ -470,6 +508,7 @@ main(int argc, char **argv){ - fprintf(stderr, "create/reload failed on %s\n", - partname); - r++; -+ continue; - } - if (op == DM_DEVICE_RELOAD && - !dm_simplecmd(DM_DEVICE_RESUME, partname, -@@ -477,6 +516,7 @@ main(int argc, char **argv){ - fprintf(stderr, "resume failed on %s\n", - partname); - r++; -+ continue; - } - dm_devn(partname, &slices[j].major, - &slices[j].minor); -@@ -494,6 +534,7 @@ main(int argc, char **argv){ - } - - for (j = MAXSLICES-1; j >= 0; j--) { -+ char *part_uuid, *reason; - if (safe_sprintf(partname, "%s%s%d", - mapname, delim, j+1)) { - fprintf(stderr, "partname too small\n"); -@@ -501,9 +542,19 @@ main(int argc, char **argv){ - } - strip_slash(partname); - -- if (slices[j].size || !dm_map_present(partname)) -+ if (slices[j].size || -+ !dm_map_present(partname, &part_uuid)) - continue; - -+ if (part_uuid && uuid) { -+ if (check_uuid(uuid, part_uuid, &reason) != 0) { -+ fprintf(stderr, "%s is %s. Not removing\n", partname, reason); -+ free(part_uuid); -+ continue; -+ } -+ free(part_uuid); -+ } -+ - if (!dm_simplecmd(DM_DEVICE_REMOVE, - partname, 1, &cookie, 0)) { - r++; diff --git a/0143-RHBZ-1299648-kpartx-sync.patch b/0143-RHBZ-1299648-kpartx-sync.patch deleted file mode 100644 index 5e9928d..0000000 --- a/0143-RHBZ-1299648-kpartx-sync.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- - kpartx/kpartx.c | 10 +++++++--- - multipath/multipath.rules | 2 +- - 2 files changed, 8 insertions(+), 4 deletions(-) - -Index: multipath-tools-130222/kpartx/kpartx.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.c -+++ multipath-tools-130222/kpartx/kpartx.c -@@ -57,7 +57,7 @@ struct pt { - } pts[MAXTYPES]; - - int ptct = 0; --int udev_sync = 0; -+int udev_sync = 1; - - static void - addpts(char *t, ptreader f) -@@ -85,7 +85,7 @@ initpts(void) - addpts("ps3", read_ps3_pt); - } - --static char short_opts[] = "rladfgvp:t:su"; -+static char short_opts[] = "rladfgvp:t:snu"; - - /* Used in gpt.c */ - int force_gpt=0; -@@ -104,7 +104,8 @@ usage(void) { - printf("\t-g force GUID partition table (GPT)\n"); - printf("\t-f force devmap create\n"); - printf("\t-v verbose\n"); -- printf("\t-s sync mode. Don't return until the partitions are created\n"); -+ printf("\t-n nosync mode. Return before the partitions are created\n"); -+ printf("\t-s sync mode. Don't return until the partitions are created. Default.\n"); - return 1; - } - -@@ -285,6 +286,9 @@ main(int argc, char **argv){ - case 's': - udev_sync = 1; - break; -+ case 'n': -+ udev_sync = 0; -+ break; - case 'u': - what = UPDATE; - break; -Index: multipath-tools-130222/multipath/multipath.rules -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.rules -+++ multipath-tools-130222/multipath/multipath.rules -@@ -48,6 +48,6 @@ ENV{DM_ACTIVATION}=="1", ENV{DM_MULTIPAT - ENV{DM_SUSPENDED}=="1", GOTO="end_mpath" - ENV{DM_ACTION}=="PATH_FAILED", GOTO="end_mpath" - ENV{DM_ACTIVATION}!="1", ENV{DM_MULTIPATH_NEED_KPARTX}!="1", GOTO="end_mpath" --RUN+="$env{MPATH_SBIN_PATH}/kpartx -a $tempnode", \ -+RUN+="$env{MPATH_SBIN_PATH}/kpartx -an $tempnode", \ - ENV{DM_MULTIPATH_NEED_KPARTX}="" - LABEL="end_mpath" diff --git a/0144-RHBZ-1299652-alua-pref-arg.patch b/0144-RHBZ-1299652-alua-pref-arg.patch deleted file mode 100644 index 9ae0b40..0000000 --- a/0144-RHBZ-1299652-alua-pref-arg.patch +++ /dev/null @@ -1,136 +0,0 @@ ---- - libmultipath/prioritizers/alua.c | 20 +++++++++++++++++++- - libmultipath/propsel.c | 18 ++++++++++-------- - multipath/multipath.conf.5 | 19 ++++++++++++++++--- - 3 files changed, 45 insertions(+), 12 deletions(-) - -Index: multipath-tools-130222/libmultipath/prioritizers/alua.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/alua.c -+++ multipath-tools-130222/libmultipath/prioritizers/alua.c -@@ -86,15 +86,33 @@ get_alua_info(int fd, struct alua_contex - return rc; - } - -+int get_exclusive_perf_arg(char *args) -+{ -+ char *ptr; -+ -+ if (args == NULL) -+ return 0; -+ ptr = strstr(args, "exclusive_pref_bit"); -+ if (!ptr) -+ return 0; -+ if (ptr[18] != '\0' && ptr[18] != ' ' && ptr[18] != '\t') -+ return 0; -+ if (ptr != args && ptr[-1] != ' ' && ptr[-1] != '\t') -+ return 0; -+ return 1; -+} -+ - int getprio (struct path * pp, char * args) - { - int rc; - int aas; - int priopath; -+ int exclusive_perf; - - if (pp->fd < 0) - return -ALUA_PRIO_NO_INFORMATION; - -+ exclusive_perf = get_exclusive_perf_arg(args); - rc = get_alua_info(pp->fd, pp->prio.context); - if (rc >= 0) { - aas = (rc & 0x0f); -@@ -115,7 +133,7 @@ int getprio (struct path * pp, char * ar - default: - rc = 0; - } -- if (priopath && aas != AAS_OPTIMIZED) -+ if (priopath && (aas != AAS_OPTIMIZED || exclusive_perf)) - rc += 80; - } else { - switch(-rc) { -Index: multipath-tools-130222/libmultipath/propsel.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.c -+++ multipath-tools-130222/libmultipath/propsel.c -@@ -420,17 +420,19 @@ select_prio (struct path * pp) - if (prio_selected(p)) { - condlog(3, "%s: prio = %s (detected setting)", - pp->dev, prio_name(p)); -+ condlog(3, "%s: prio args = %s (detected setting)", -+ pp->dev, prio_args(p)); - return 0; - } - } - -- if ((mpe = find_mpe(pp->wwid))) { -- if (mpe->prio_name) { -- prio_get(p, mpe->prio_name, mpe->prio_args); -- condlog(3, "%s: prio = %s (LUN setting)", -- pp->dev, prio_name(p)); -- return 0; -- } -+ if ((mpe = find_mpe(pp->wwid)) && mpe->prio_name) { -+ prio_get(p, mpe->prio_name, mpe->prio_args); -+ condlog(3, "%s: prio = %s (LUN setting)", -+ pp->dev, prio_name(p)); -+ condlog(3, "%s: prio args = %s (LUN setting)", -+ pp->dev, prio_args(p)); -+ return 0; - } - - if (pp->hwe && pp->hwe->prio_name) { -@@ -452,7 +454,7 @@ select_prio (struct path * pp) - prio_get(p, DEFAULT_PRIO, DEFAULT_PRIO_ARGS); - condlog(3, "%s: prio = %s (internal default)", - pp->dev, DEFAULT_PRIO); -- condlog(3, "%s: prio = %s (internal default)", -+ condlog(3, "%s: prio args = %s (internal default)", - pp->dev, DEFAULT_PRIO_ARGS); - return 0; - } -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -182,7 +182,9 @@ Return a constant priority of \fI1\fR. - Generate the path priority for EMC arrays. - .TP - .B alua --Generate the path priority based on the SCSI-3 ALUA settings. -+Generate the path priority based on the SCSI-3 ALUA settings. This prioritizer -+accepts the optional prio_arg -+.I exclusive_pref_bit - .TP - .B ontap - Generate the path priority for NetApp arrays. -@@ -208,14 +210,25 @@ Default value is \fBconst\fR. - .RE - .TP - .B prio_args --Arguments to pass to to the prio function. Currently only used with --.I weighted, which needs a value of the form -+Arguments to pass to to the prio function. This only applies to certain -+prioritizers -+.RS -+.TP 12 -+.B weighted -+Needs a value of the form - .I " ..." - .I hbtl - regex can be of SCSI H:B:T:L format Ex: 1:0:.:. , *:0:0:. - .I devname - regex can be of device name format Ex: sda , sd.e - .TP -+.B alua -+If -+.I exclusive_pref_bit -+is set, paths with the TPGS pref bit set will always be in their own path -+group. -+.RE -+.TP - .B features - Specify any device-mapper features to be used. Syntax is - .I num list diff --git a/0145-UP-resize-help-msg.patch b/0145-UP-resize-help-msg.patch deleted file mode 100644 index 33ca0f6..0000000 --- a/0145-UP-resize-help-msg.patch +++ /dev/null @@ -1,172 +0,0 @@ -diff --git a/multipathd/cli.c b/multipathd/cli.c -index acc4249..8d26956 100644 ---- a/multipathd/cli.c -+++ b/multipathd/cli.c -@@ -320,52 +320,90 @@ alloc_handlers (void) - } - - static int --genhelp_sprint_aliases (char * reply, vector keys, struct key * refkw) -+genhelp_sprint_aliases (char * reply, int maxlen, vector keys, -+ struct key * refkw) - { -- int i, fwd = 0; -+ int i, len = 0; - struct key * kw; - -- vector_foreach_slot (keys, kw, i) -- if (kw->code == refkw->code && kw != refkw) -- fwd += sprintf(reply, "|%s", kw->str); -+ vector_foreach_slot (keys, kw, i) { -+ if (kw->code == refkw->code && kw != refkw) { -+ len += snprintf(reply + len, maxlen - len, -+ "|%s", kw->str); -+ if (len >= maxlen) -+ return len; -+ } -+ } - -- return fwd; -+ return len; - } - --static char * --genhelp_handler (void) --{ -+static int -+do_genhelp(char *reply, int maxlen) { -+ int len = 0; - int i, j; - unsigned long fp; - struct handler * h; - struct key * kw; -- char * reply; -- char * p; -- -- reply = MALLOC(INITIAL_REPLY_LEN); - -- if (!reply) -- return NULL; -- -- p = reply; -- p += sprintf(p, VERSION_STRING); -- p += sprintf(p, "CLI commands reference:\n"); -+ len += snprintf(reply + len, maxlen - len, VERSION_STRING); -+ if (len >= maxlen) -+ goto out; -+ len += snprintf(reply + len, maxlen - len, "CLI commands reference:\n"); -+ if (len >= maxlen) -+ goto out; - - vector_foreach_slot (handlers, h, i) { - fp = h->fingerprint; - vector_foreach_slot (keys, kw, j) { - if ((kw->code & fp)) { - fp -= kw->code; -- p += sprintf(p, " %s", kw->str); -- p += genhelp_sprint_aliases(p, keys, kw); -- -- if (kw->has_param) -- p += sprintf(p, " $%s", kw->str); -+ len += snprintf(reply + len , maxlen - len, -+ " %s", kw->str); -+ if (len >= maxlen) -+ goto out; -+ len += genhelp_sprint_aliases(reply + len, -+ maxlen - len, -+ keys, kw); -+ if (len >= maxlen) -+ goto out; -+ -+ if (kw->has_param) { -+ len += snprintf(reply + len, -+ maxlen - len, -+ " $%s", kw->str); -+ if (len >= maxlen) -+ goto out; -+ } - } - } -- p += sprintf(p, "\n"); -+ len += snprintf(reply + len, maxlen - len, "\n"); -+ if (len >= maxlen) -+ goto out; - } -+out: -+ return len; -+} -+ - -+static char * -+genhelp_handler (void) -+{ -+ char * reply; -+ char * p = NULL; -+ int maxlen = INITIAL_REPLY_LEN; -+ int again = 1; -+ -+ reply = MALLOC(maxlen); -+ -+ while (again) { -+ if (!reply) -+ return NULL; -+ p = reply; -+ p += do_genhelp(reply, maxlen); -+ again = ((p - reply) >= maxlen); -+ REALLOC_REPLY(reply, again, maxlen); -+ } - return reply; - } - -diff --git a/multipathd/cli.h b/multipathd/cli.h -index 09fdc68..2e0e1da 100644 ---- a/multipathd/cli.h -+++ b/multipathd/cli.h -@@ -71,7 +71,21 @@ enum { - #define SETPRSTATUS (1UL << __SETPRSTATUS) - #define UNSETPRSTATUS (1UL << __UNSETPRSTATUS) - --#define INITIAL_REPLY_LEN 1100 -+#define INITIAL_REPLY_LEN 1200 -+ -+#define REALLOC_REPLY(r, a, m) \ -+ do { \ -+ if ((a)) { \ -+ char *tmp = (r); \ -+ (r) = REALLOC((r), (m) * 2); \ -+ if ((r)) { \ -+ memset((r) + (m), 0, (m)); \ -+ (m) *= 2; \ -+ } \ -+ else \ -+ free(tmp); \ -+ } \ -+ } while (0) - - struct key { - char * str; -diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c -index e47899a..23683f2 100644 ---- a/multipathd/cli_handlers.c -+++ b/multipathd/cli_handlers.c -@@ -23,20 +23,6 @@ - #include "cli.h" - #include "uevent.h" - --#define REALLOC_REPLY(r, a, m) \ -- do { \ -- if ((a)) { \ -- char *tmp = (r); \ -- (r) = REALLOC((r), (m) * 2); \ -- if ((r)) { \ -- memset((r) + (m), 0, (m)); \ -- (m) *= 2; \ -- } \ -- else \ -- free(tmp); \ -- } \ -- } while (0) -- - int - show_paths (char ** r, int * len, struct vectors * vecs, char * style) - { diff --git a/0146-UPBZ-1299651-raw-output.patch b/0146-UPBZ-1299651-raw-output.patch deleted file mode 100644 index 93a171e..0000000 --- a/0146-UPBZ-1299651-raw-output.patch +++ /dev/null @@ -1,393 +0,0 @@ ---- - libmultipath/print.c | 42 ++++++++++++++++++++++++---------------- - libmultipath/print.h | 4 +-- - multipathd/cli.c | 5 +++- - multipathd/cli.h | 6 +++-- - multipathd/cli_handlers.c | 48 ++++++++++++++++++++++++++++++++++------------ - multipathd/cli_handlers.h | 2 + - multipathd/main.c | 2 + - 7 files changed, 76 insertions(+), 33 deletions(-) - -Index: multipath-tools-130222/libmultipath/print.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.c -+++ multipath-tools-130222/libmultipath/print.c -@@ -32,14 +32,21 @@ - #define MAX(x,y) (x > y) ? x : y - #define TAIL (line + len - 1 - c) - #define NOPAD s = c --#define PAD(x) while ((int)(c - s) < (x) && (c < (line + len - 1))) \ -- *c++ = ' '; s = c -+#define PAD(x) \ -+do { \ -+ while ((int)(c - s) < (x) && (c < (line + len - 1))) \ -+ *c++ = ' '; \ -+ s = c; \ -+} while (0) -+ - #define ENDLINE \ - if (c > line) \ - line[c - line - 1] = '\n' --#define PRINT(var, size, format, args...) \ -- fwd = snprintf(var, size, format, ##args); \ -- c += (fwd >= size) ? size : fwd; -+#define PRINT(var, size, format, args...) \ -+do { \ -+ fwd = snprintf(var, size, format, ##args); \ -+ c += (fwd >= size) ? size : fwd; \ -+} while (0) - - /* - * information printing helpers -@@ -720,7 +727,7 @@ snprint_multipath_header (char * line, i - - int - snprint_multipath (char * line, int len, char * format, -- struct multipath * mpp) -+ struct multipath * mpp, int pad) - { - char * c = line; /* line cursor */ - char * s = line; /* for padding */ -@@ -747,7 +754,8 @@ snprint_multipath (char * line, int len, - - data->snprint(buff, MAX_FIELD_LEN, mpp); - PRINT(c, TAIL, "%s", buff); -- PAD(data->width); -+ if (pad) -+ PAD(data->width); - buff[0] = '\0'; - } while (*f++); - -@@ -790,7 +798,7 @@ snprint_path_header (char * line, int le - - int - snprint_path (char * line, int len, char * format, -- struct path * pp) -+ struct path * pp, int pad) - { - char * c = line; /* line cursor */ - char * s = line; /* for padding */ -@@ -817,7 +825,8 @@ snprint_path (char * line, int len, char - - data->snprint(buff, MAX_FIELD_LEN, pp); - PRINT(c, TAIL, "%s", buff); -- PAD(data->width); -+ if (pad) -+ PAD(data->width); - } while (*f++); - - ENDLINE; -@@ -909,7 +918,7 @@ snprint_multipath_topology (char * buff, - reset_multipath_layout(); - - if (verbosity == 1) -- return snprint_multipath(buff, len, "%n", mpp); -+ return snprint_multipath(buff, len, "%n", mpp, 1); - - if(isatty(1)) - c += sprintf(c, "%c[%dm", 0x1B, 1); /* bold on */ -@@ -928,10 +937,11 @@ snprint_multipath_topology (char * buff, - if(isatty(1)) - c += sprintf(c, "%c[%dm", 0x1B, 0); /* bold off */ - -- fwd += snprint_multipath(buff + fwd, len - fwd, style, mpp); -+ fwd += snprint_multipath(buff + fwd, len - fwd, style, mpp, 1); - if (fwd > len) - return len; -- fwd += snprint_multipath(buff + fwd, len - fwd, PRINT_MAP_PROPS, mpp); -+ fwd += snprint_multipath(buff + fwd, len - fwd, PRINT_MAP_PROPS, mpp, -+ 1); - if (fwd > len) - return len; - -@@ -958,7 +968,7 @@ snprint_multipath_topology (char * buff, - strcpy(f, " |- " PRINT_PATH_INDENT); - else - strcpy(f, " `- " PRINT_PATH_INDENT); -- fwd += snprint_path(buff + fwd, len - fwd, fmt, pp); -+ fwd += snprint_path(buff + fwd, len - fwd, fmt, pp, 1); - if (fwd > len) - return len; - } -@@ -1425,7 +1435,7 @@ snprint_devices (char * buff, int len, s - if (r > 0) - fwd += snprintf(buff + fwd, len - fwd, - " devnode blacklisted, unmonitored"); -- else if (r < 0) -+ else if (r <= 0) - fwd += snprintf(buff + fwd, len - fwd, - " devnode whitelisted, unmonitored"); - } else -@@ -1455,7 +1465,7 @@ print_path (struct path * pp, char * sty - char line[MAX_LINE_LEN]; - - memset(&line[0], 0, MAX_LINE_LEN); -- snprint_path(&line[0], MAX_LINE_LEN, style, pp); -+ snprint_path(&line[0], MAX_LINE_LEN, style, pp, 1); - printf("%s", line); - } - -@@ -1465,7 +1475,7 @@ print_multipath (struct multipath * mpp, - char line[MAX_LINE_LEN]; - - memset(&line[0], 0, MAX_LINE_LEN); -- snprint_multipath(&line[0], MAX_LINE_LEN, style, mpp); -+ snprint_multipath(&line[0], MAX_LINE_LEN, style, mpp, 1); - printf("%s", line); - } - -Index: multipath-tools-130222/libmultipath/print.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.h -+++ multipath-tools-130222/libmultipath/print.h -@@ -37,8 +37,8 @@ void get_path_layout (vector pathvec, in - void get_multipath_layout (vector mpvec, int header); - int snprint_path_header (char *, int, char *); - int snprint_multipath_header (char *, int, char *); --int snprint_path (char *, int, char *, struct path *); --int snprint_multipath (char *, int, char *, struct multipath *); -+int snprint_path (char *, int, char *, struct path *, int); -+int snprint_multipath (char *, int, char *, struct multipath *, int); - int snprint_multipath_topology (char *, int, struct multipath * mpp, - int verbosity); - int snprint_defaults (char *, int); -Index: multipath-tools-130222/multipathd/cli.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli.c -+++ multipath-tools-130222/multipathd/cli.c -@@ -180,7 +180,7 @@ load_keys (void) - r += add_key(keys, "config", CONFIG, 0); - r += add_key(keys, "blacklist", BLACKLIST, 0); - r += add_key(keys, "devices", DEVICES, 0); -- r += add_key(keys, "format", FMT, 1); -+ r += add_key(keys, "raw", RAW, 0); - r += add_key(keys, "wildcards", WILDCARDS, 0); - r += add_key(keys, "quit", QUIT, 0); - r += add_key(keys, "exit", QUIT, 0); -@@ -188,6 +188,7 @@ load_keys (void) - r += add_key(keys, "getprstatus", GETPRSTATUS, 0); - r += add_key(keys, "setprstatus", SETPRSTATUS, 0); - r += add_key(keys, "unsetprstatus", UNSETPRSTATUS, 0); -+ r += add_key(keys, "format", FMT, 1); - - if (r) { - free_keys(keys); -@@ -463,12 +464,14 @@ cli_init (void) { - - add_handler(LIST+PATHS, NULL); - add_handler(LIST+PATHS+FMT, NULL); -+ add_handler(LIST+PATHS+RAW+FMT, NULL); - add_handler(LIST+STATUS, NULL); - add_handler(LIST+DAEMON, NULL); - add_handler(LIST+MAPS, NULL); - add_handler(LIST+MAPS+STATUS, NULL); - add_handler(LIST+MAPS+STATS, NULL); - add_handler(LIST+MAPS+FMT, NULL); -+ add_handler(LIST+MAPS+RAW+FMT, NULL); - add_handler(LIST+MAPS+TOPOLOGY, NULL); - add_handler(LIST+TOPOLOGY, NULL); - add_handler(LIST+MAP+TOPOLOGY, NULL); -Index: multipath-tools-130222/multipathd/cli.h -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli.h -+++ multipath-tools-130222/multipathd/cli.h -@@ -26,13 +26,14 @@ enum { - __CONFIG, - __BLACKLIST, - __DEVICES, -- __FMT, -+ __RAW, - __WILDCARDS, - __QUIT, - __SHUTDOWN, - __GETPRSTATUS, - __SETPRSTATUS, - __UNSETPRSTATUS, -+ __FMT, - }; - - #define LIST (1 << __LIST) -@@ -62,7 +63,7 @@ enum { - #define CONFIG (1 << __CONFIG) - #define BLACKLIST (1 << __BLACKLIST) - #define DEVICES (1 << __DEVICES) --#define FMT (1 << __FMT) -+#define RAW (1 << __RAW) - #define COUNT (1 << __COUNT) - #define WILDCARDS (1 << __WILDCARDS) - #define QUIT (1 << __QUIT) -@@ -70,6 +71,7 @@ enum { - #define GETPRSTATUS (1UL << __GETPRSTATUS) - #define SETPRSTATUS (1UL << __SETPRSTATUS) - #define UNSETPRSTATUS (1UL << __UNSETPRSTATUS) -+#define FMT (1UL << __FMT) - - #define INITIAL_REPLY_LEN 1200 - -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -24,7 +24,8 @@ - #include "uevent.h" - - int --show_paths (char ** r, int * len, struct vectors * vecs, char * style) -+show_paths (char ** r, int * len, struct vectors * vecs, char * style, -+ int pretty) - { - int i; - struct path * pp; -@@ -42,13 +43,13 @@ show_paths (char ** r, int * len, struct - - c = reply; - -- if (VECTOR_SIZE(vecs->pathvec) > 0) -+ if (pretty && VECTOR_SIZE(vecs->pathvec) > 0) - c += snprint_path_header(c, reply + maxlen - c, - style); - - vector_foreach_slot(vecs->pathvec, pp, i) - c += snprint_path(c, reply + maxlen - c, -- style, pp); -+ style, pp, pretty); - - again = ((c - reply) == (maxlen - 1)); - -@@ -183,7 +184,7 @@ cli_list_paths (void * v, char ** reply, - - condlog(3, "list paths (operator)"); - -- return show_paths(reply, len, vecs, PRINT_PATH_CHECKER); -+ return show_paths(reply, len, vecs, PRINT_PATH_CHECKER, 1); - } - - int -@@ -194,7 +195,18 @@ cli_list_paths_fmt (void * v, char ** re - - condlog(3, "list paths (operator)"); - -- return show_paths(reply, len, vecs, fmt); -+ return show_paths(reply, len, vecs, fmt, 1); -+} -+ -+int -+cli_list_paths_raw (void * v, char ** reply, int * len, void * data) -+{ -+ struct vectors * vecs = (struct vectors *)data; -+ char * fmt = get_keyparam(v, FMT); -+ -+ condlog(3, "list paths (operator)"); -+ -+ return show_paths(reply, len, vecs, fmt, 0); - } - - int -@@ -285,7 +297,8 @@ show_daemon (char ** r, int *len) - } - - int --show_maps (char ** r, int *len, struct vectors * vecs, char * style) -+show_maps (char ** r, int *len, struct vectors * vecs, char * style, -+ int pretty) - { - int i; - struct multipath * mpp; -@@ -302,13 +315,13 @@ show_maps (char ** r, int *len, struct v - return 1; - - c = reply; -- if (VECTOR_SIZE(vecs->mpvec) > 0) -+ if (pretty && VECTOR_SIZE(vecs->mpvec) > 0) - c += snprint_multipath_header(c, reply + maxlen - c, - style); - - vector_foreach_slot(vecs->mpvec, mpp, i) - c += snprint_multipath(c, reply + maxlen - c, -- style, mpp); -+ style, mpp, pretty); - - again = ((c - reply) == (maxlen - 1)); - -@@ -327,7 +340,18 @@ cli_list_maps_fmt (void * v, char ** rep - - condlog(3, "list maps (operator)"); - -- return show_maps(reply, len, vecs, fmt); -+ return show_maps(reply, len, vecs, fmt, 1); -+} -+ -+int -+cli_list_maps_raw (void * v, char ** reply, int * len, void * data) -+{ -+ struct vectors * vecs = (struct vectors *)data; -+ char * fmt = get_keyparam(v, FMT); -+ -+ condlog(3, "list maps (operator)"); -+ -+ return show_maps(reply, len, vecs, fmt, 0); - } - - int -@@ -337,7 +361,7 @@ cli_list_maps (void * v, char ** reply, - - condlog(3, "list maps (operator)"); - -- return show_maps(reply, len, vecs, PRINT_MAP_NAMES); -+ return show_maps(reply, len, vecs, PRINT_MAP_NAMES, 1); - } - - int -@@ -357,7 +381,7 @@ cli_list_maps_status (void * v, char ** - - condlog(3, "list maps status (operator)"); - -- return show_maps(reply, len, vecs, PRINT_MAP_STATUS); -+ return show_maps(reply, len, vecs, PRINT_MAP_STATUS, 1); - } - - int -@@ -367,7 +391,7 @@ cli_list_maps_stats (void * v, char ** r - - condlog(3, "list maps stats (operator)"); - -- return show_maps(reply, len, vecs, PRINT_MAP_STATS); -+ return show_maps(reply, len, vecs, PRINT_MAP_STATS, 1); - } - - int -Index: multipath-tools-130222/multipathd/cli_handlers.h -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.h -+++ multipath-tools-130222/multipathd/cli_handlers.h -@@ -1,9 +1,11 @@ - int cli_list_paths (void * v, char ** reply, int * len, void * data); - int cli_list_paths_fmt (void * v, char ** reply, int * len, void * data); -+int cli_list_paths_raw (void * v, char ** reply, int * len, void * data); - int cli_list_status (void * v, char ** reply, int * len, void * data); - int cli_list_daemon (void * v, char ** reply, int * len, void * data); - int cli_list_maps (void * v, char ** reply, int * len, void * data); - int cli_list_maps_fmt (void * v, char ** reply, int * len, void * data); -+int cli_list_maps_raw (void * v, char ** reply, int * len, void * data); - int cli_list_maps_status (void * v, char ** reply, int * len, void * data); - int cli_list_maps_stats (void * v, char ** reply, int * len, void * data); - int cli_list_map_topology (void * v, char ** reply, int * len, void * data); -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -967,12 +967,14 @@ uxlsnrloop (void * ap) - - set_handler_callback(LIST+PATHS, cli_list_paths); - set_handler_callback(LIST+PATHS+FMT, cli_list_paths_fmt); -+ set_handler_callback(LIST+PATHS+RAW+FMT, cli_list_paths_raw); - set_handler_callback(LIST+MAPS, cli_list_maps); - set_handler_callback(LIST+STATUS, cli_list_status); - set_handler_callback(LIST+DAEMON, cli_list_daemon); - set_handler_callback(LIST+MAPS+STATUS, cli_list_maps_status); - set_handler_callback(LIST+MAPS+STATS, cli_list_maps_stats); - set_handler_callback(LIST+MAPS+FMT, cli_list_maps_fmt); -+ set_handler_callback(LIST+MAPS+RAW+FMT, cli_list_maps_raw); - set_handler_callback(LIST+MAPS+TOPOLOGY, cli_list_maps_topology); - set_handler_callback(LIST+TOPOLOGY, cli_list_maps_topology); - set_handler_callback(LIST+MAP+TOPOLOGY, cli_list_map_topology); diff --git a/0147-RHBZ-1272620-fail-rm-msg.patch b/0147-RHBZ-1272620-fail-rm-msg.patch deleted file mode 100644 index b48ed6b..0000000 --- a/0147-RHBZ-1272620-fail-rm-msg.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- - multipathd/cli_handlers.c | 8 ++++---- - multipathd/main.c | 4 ++-- - 2 files changed, 6 insertions(+), 6 deletions(-) - -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -459,7 +459,7 @@ cli_del_path (void * v, char ** reply, i - pp = find_path_by_dev(vecs->pathvec, param); - if (!pp) { - condlog(0, "%s: path already removed", param); -- return 0; -+ return 1; - } - return ev_remove_path(pp, vecs); - } -@@ -520,19 +520,19 @@ cli_del_map (void * v, char ** reply, in - minor = dm_get_minor(param); - if (minor < 0) { - condlog(2, "%s: not a device mapper table", param); -- return 0; -+ return 1; - } - major = dm_get_major(param); - if (major < 0) { - condlog(2, "%s: not a device mapper table", param); -- return 0; -+ return 1; - } - sprintf(dev_path,"dm-%d", minor); - alias = dm_mapname(major, minor); - if (!alias) { - condlog(2, "%s: mapname not found for %d:%d", - param, major, minor); -- return 0; -+ return 1; - } - rc = ev_remove_map(param, alias, minor, vecs); - FREE(alias); -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -437,12 +437,12 @@ ev_remove_map (char * devname, char * al - if (!mpp) { - condlog(2, "%s: devmap not registered, can't remove", - devname); -- return 0; -+ return 1; - } - if (strcmp(mpp->alias, alias)) { - condlog(2, "%s: minor number mismatch (map %d, event %d)", - mpp->alias, mpp->dmi->minor, minor); -- return 0; -+ return 1; - } - return flush_map(mpp, vecs, 0); - } diff --git a/0148-RHBZ-1292599-verify-before-remove.patch b/0148-RHBZ-1292599-verify-before-remove.patch deleted file mode 100644 index 3e33b89..0000000 --- a/0148-RHBZ-1292599-verify-before-remove.patch +++ /dev/null @@ -1,142 +0,0 @@ ---- - libmultipath/devmapper.c | 45 +++++++++++++++++++++++++++++++++++++-------- - libmultipath/devmapper.h | 2 +- - 2 files changed, 38 insertions(+), 9 deletions(-) - -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -33,6 +33,9 @@ - #define UUID_PREFIX_LEN 6 - - static int dm_cancel_remove_partmaps(const char * mapname); -+static int do_foreach_partmaps (const char * mapname, -+ int (*partmap_func)(const char *, void *), -+ void *data); - - #ifndef LIBDM_API_COOKIE - static inline int dm_task_set_cookie(struct dm_task *dmt, uint32_t *c, int a) -@@ -709,6 +712,26 @@ out: - return r; - } - -+static int -+partmap_in_use(const char *name, void *data) -+{ -+ int part_count, *ret_count = (int *)data; -+ int open_count = dm_get_opencount(name); -+ -+ if (ret_count) -+ (*ret_count)++; -+ part_count = 0; -+ if (open_count) { -+ if (do_foreach_partmaps(name, partmap_in_use, &part_count)) -+ return 1; -+ if (open_count != part_count) { -+ condlog(2, "%s: map in use", name); -+ return 1; -+ } -+ } -+ return 0; -+} -+ - extern int - _dm_flush_map (const char * mapname, int need_sync, int deferred_remove) - { -@@ -717,6 +740,11 @@ _dm_flush_map (const char * mapname, int - if (!dm_is_mpath(mapname)) - return 0; /* nothing to do */ - -+ /* If you aren't doing a deferred remove, make sure that no -+ * devices are in use */ -+ if (!do_deferred(deferred_remove) && partmap_in_use(mapname, NULL)) -+ return 1; -+ - if (dm_remove_partmaps(mapname, need_sync, deferred_remove)) - return 1; - -@@ -825,7 +853,7 @@ dm_flush_maps (void) - } - - int --dm_message(char * mapname, char * message) -+dm_message(const char * mapname, char * message) - { - int r = 1; - struct dm_task *dmt; -@@ -1076,7 +1104,8 @@ bad: - } - - static int --do_foreach_partmaps (const char * mapname, int (*partmap_func)(char *, void *), -+do_foreach_partmaps (const char * mapname, -+ int (*partmap_func)(const char *, void *), - void *data) - { - struct dm_task *dmt; -@@ -1149,7 +1178,7 @@ struct remove_data { - }; - - static int --remove_partmap(char *name, void *data) -+remove_partmap(const char *name, void *data) - { - struct remove_data *rd = (struct remove_data *)data; - -@@ -1176,7 +1205,7 @@ dm_remove_partmaps (const char * mapname - #ifdef LIBDM_API_DEFERRED - - static int --cancel_remove_partmap (char *name, void *unused) -+cancel_remove_partmap (const char *name, void *unused) - { - if (dm_get_opencount(name)) - dm_cancel_remove_partmaps(name); -@@ -1296,13 +1325,13 @@ out: - } - - struct rename_data { -- char *old; -+ const char *old; - char *new; - char *delim; - }; - - static int --rename_partmap (char *name, void *data) -+rename_partmap (const char *name, void *data) - { - char buff[PARAMS_SIZE]; - int offset; -@@ -1319,7 +1348,7 @@ rename_partmap (char *name, void *data) - } - - int --dm_rename_partmaps (char * old, char * new) -+dm_rename_partmaps (const char * old, char * new) - { - struct rename_data rd; - -@@ -1333,7 +1362,7 @@ dm_rename_partmaps (char * old, char * n - } - - int --dm_rename (char * old, char * new) -+dm_rename (const char * old, char * new) - { - int r = 0; - struct dm_task *dmt; -Index: multipath-tools-130222/libmultipath/devmapper.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.h -+++ multipath-tools-130222/libmultipath/devmapper.h -@@ -47,7 +47,7 @@ int dm_remove_partmaps (const char * map - int deferred_remove); - int dm_get_uuid(char *name, char *uuid); - int dm_get_info (char * mapname, struct dm_info ** dmi); --int dm_rename (char * old, char * new); -+int dm_rename (const char * old, char * new); - int dm_reassign(const char * mapname); - int dm_reassign_table(const char *name, char *old, char *new); - int dm_setgeometry(struct multipath *mpp); diff --git a/0149-RHBZ-1292599-restore-removed-parts.patch b/0149-RHBZ-1292599-restore-removed-parts.patch deleted file mode 100644 index 62757c4..0000000 --- a/0149-RHBZ-1292599-restore-removed-parts.patch +++ /dev/null @@ -1,82 +0,0 @@ ---- - libmultipath/configure.c | 8 ++++++-- - libmultipath/structs.h | 1 + - multipathd/main.c | 1 + - 3 files changed, 8 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -398,6 +398,7 @@ select_action (struct multipath * mpp, v - cmpp->alias, mpp->alias); - strncpy(mpp->alias_old, cmpp->alias, WWID_SIZE); - mpp->action = ACT_RENAME; -+ mpp->force_udev_reload = force_reload; - if (force_reload) - mpp->action = ACT_RENAME2; - return; -@@ -437,11 +438,13 @@ select_action (struct multipath * mpp, v - return; - } - if (force_reload) { -+ mpp->force_udev_reload = 1; - mpp->action = ACT_RELOAD; - condlog(3, "%s: set ACT_RELOAD (forced by user)", - mpp->alias); - return; - } -+ mpp->force_udev_reload = !pathcount(mpp, PATH_WILD); - if (cmpp->size != mpp->size) { - mpp->action = ACT_RESIZE; - condlog(3, "%s: set ACT_RESIZE (size change)", -@@ -651,7 +654,7 @@ domap (struct multipath * mpp, char * pa - case ACT_RELOAD: - r = dm_addmap_reload(mpp, params); - if (r) -- r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, MPATH_UDEV_RELOAD_FLAG); -+ r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, (mpp->force_udev_reload)? 0 : MPATH_UDEV_RELOAD_FLAG); - break; - - case ACT_RESIZE: -@@ -669,7 +672,7 @@ domap (struct multipath * mpp, char * pa - if (r) { - r = dm_addmap_reload(mpp, params); - if (r) -- r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, MPATH_UDEV_RELOAD_FLAG); -+ r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, (mpp->force_udev_reload)? 0 : MPATH_UDEV_RELOAD_FLAG); - } - break; - -@@ -682,6 +685,7 @@ domap (struct multipath * mpp, char * pa - * DM_DEVICE_CREATE, DM_DEVICE_RENAME, or DM_DEVICE_RELOAD - * succeeded - */ -+ mpp->force_udev_reload = 0; - if (mpp->action == ACT_CREATE) { - if (remember_wwid(mpp->wwid) == 1) - trigger_uevents(mpp); -Index: multipath-tools-130222/libmultipath/structs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.h -+++ multipath-tools-130222/libmultipath/structs.h -@@ -234,6 +234,7 @@ struct multipath { - int deferred_remove; - int delay_watch_checks; - int delay_wait_checks; -+ int force_udev_reload; - unsigned int dev_loss; - uid_t uid; - gid_t gid; -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -554,6 +554,7 @@ rescan: - - condlog(4,"%s: adopting all paths for path %s", - mpp->alias, pp->dev); -+ mpp->force_udev_reload = !pathcount(mpp, PATH_WILD); - if (adopt_paths(vecs->pathvec, mpp, 1)) - goto fail; /* leave path added to pathvec */ - diff --git a/0150-RHBZ-1253913-fix-startup-msg.patch b/0150-RHBZ-1253913-fix-startup-msg.patch deleted file mode 100644 index 7dc5125..0000000 --- a/0150-RHBZ-1253913-fix-startup-msg.patch +++ /dev/null @@ -1,128 +0,0 @@ ---- - multipathd/main.c | 38 +++++++++++++++++++++++++++++--------- - 1 file changed, 29 insertions(+), 9 deletions(-) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -87,6 +87,7 @@ unsigned int mpath_mx_alloc_len; - int logsink; - enum daemon_status running_state; - pid_t daemon_pid; -+pid_t parent_pid = -1; - - static sem_t exit_sem; - /* -@@ -1705,6 +1706,12 @@ sigusr2 (int sig) - } - - static void -+sigalrm (int sig) -+{ -+ exit(0); -+} -+ -+static void - signal_init(void) - { - sigset_t set; -@@ -1807,6 +1814,9 @@ child (void * param) - } - - running_state = DAEMON_START; -+ pid_rc = pidfile_create(DEFAULT_PIDFILE, daemon_pid); -+ if (parent_pid > 0) -+ kill(parent_pid, SIGALRM); - - condlog(2, "--------start up--------"); - condlog(2, "read " DEFAULT_CONFIGFILE); -@@ -1898,8 +1908,6 @@ child (void * param) - } - pthread_attr_destroy(&misc_attr); - -- /* Startup complete, create logfile */ -- pid_rc = pidfile_create(DEFAULT_PIDFILE, daemon_pid); - update_timestamp(1); - /* Ignore errors, we can live without */ - -@@ -1979,7 +1987,10 @@ daemonize(void) - { - int pid; - int dev_null_fd; -+ struct sigaction oldsig; - -+ oldsig.sa_handler = signal_set(SIGALRM, sigalrm); -+ parent_pid = getpid(); - if( (pid = fork()) < 0){ - fprintf(stderr, "Failed first fork : %s\n", strerror(errno)); - return -1; -@@ -1987,10 +1998,13 @@ daemonize(void) - else if (pid != 0) - return pid; - -+ signal_set(SIGALRM, oldsig.sa_handler); - setsid(); - -- if ( (pid = fork()) < 0) -+ if ( (pid = fork()) < 0) { - fprintf(stderr, "Failed second fork : %s\n", strerror(errno)); -+ goto fail; -+ } - else if (pid != 0) - _exit(0); - -@@ -2001,30 +2015,34 @@ daemonize(void) - if (dev_null_fd < 0){ - fprintf(stderr, "cannot open /dev/null for input & output : %s\n", - strerror(errno)); -- _exit(0); -+ goto fail; - } - - close(STDIN_FILENO); - if (dup(dev_null_fd) < 0) { - fprintf(stderr, "cannot dup /dev/null to stdin : %s\n", - strerror(errno)); -- _exit(0); -+ goto fail; - } - close(STDOUT_FILENO); - if (dup(dev_null_fd) < 0) { - fprintf(stderr, "cannot dup /dev/null to stdout : %s\n", - strerror(errno)); -- _exit(0); -+ goto fail; - } - close(STDERR_FILENO); - if (dup(dev_null_fd) < 0) { - fprintf(stderr, "cannot dup /dev/null to stderr : %s\n", - strerror(errno)); -- _exit(0); -+ goto fail; - } - close(dev_null_fd); - daemon_pid = getpid(); - return 0; -+ -+fail: -+ kill(parent_pid, SIGALRM); -+ _exit(0); - } - - int -@@ -2103,10 +2121,12 @@ main (int argc, char *argv[]) - if (err < 0) - /* error */ - exit(1); -- else if (err > 0) -+ else if (err > 0) { -+ /* wait up to 3 seconds for the child to start */ -+ sleep(3); - /* parent dies */ - exit(0); -- else -+ } else - /* child lives */ - return (child(NULL)); - } diff --git a/0151-RHBZ-1297456-weighted-fix.patch b/0151-RHBZ-1297456-weighted-fix.patch deleted file mode 100644 index 57b2fed..0000000 --- a/0151-RHBZ-1297456-weighted-fix.patch +++ /dev/null @@ -1,156 +0,0 @@ ---- - libmultipath/print.c | 8 +++--- - libmultipath/print.h | 4 +++ - libmultipath/prioritizers/weightedpath.c | 37 +++++++++++++++++++++++++++++++ - libmultipath/prioritizers/weightedpath.h | 1 - multipath/multipath.conf.5 | 8 +++++- - 5 files changed, 53 insertions(+), 5 deletions(-) - -Index: multipath-tools-130222/libmultipath/print.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.c -+++ multipath-tools-130222/libmultipath/print.c -@@ -468,19 +468,19 @@ out: - return ret; - } - --static int -+int - snprint_host_wwnn (char * buff, size_t len, struct path * pp) - { - return snprint_host_attr(buff, len, pp, "node_name"); - } - --static int -+int - snprint_host_wwpn (char * buff, size_t len, struct path * pp) - { - return snprint_host_attr(buff, len, pp, "port_name"); - } - --static int -+int - snprint_tgt_wwpn (char * buff, size_t len, struct path * pp) - { - struct udev_device *rport_dev = NULL; -@@ -510,7 +510,7 @@ out: - } - - --static int -+int - snprint_tgt_wwnn (char * buff, size_t len, struct path * pp) - { - if (pp->tgt_node_name[0] == '\0') -Index: multipath-tools-130222/libmultipath/print.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.h -+++ multipath-tools-130222/libmultipath/print.h -@@ -50,6 +50,10 @@ int snprint_status (char *, int, struct - int snprint_devices (char *, int, struct vectors *); - int snprint_hwtable (char *, int, vector); - int snprint_mptable (char *, int, vector); -+int snprint_host_wwnn (char *, size_t, struct path *); -+int snprint_host_wwpn (char *, size_t, struct path *); -+int snprint_tgt_wwnn (char *, size_t, struct path *); -+int snprint_tgt_wwpn (char *, size_t, struct path *); - - void print_multipath_topology (struct multipath * mpp, int verbosity); - void print_path (struct path * pp, char * style); -Index: multipath-tools-130222/libmultipath/prioritizers/weightedpath.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/weightedpath.c -+++ multipath-tools-130222/libmultipath/prioritizers/weightedpath.c -@@ -32,6 +32,8 @@ - #include - #include - #include -+#include -+#include - #include "def_func.h" - - char *get_next_string(char **temp, char *split_char) -@@ -43,6 +45,36 @@ char *get_next_string(char **temp, char - return token; - } - -+#define CHECK_LEN \ -+do { \ -+ if ((p - str) >= (len - 1)) { \ -+ condlog(0, "%s: %s - buffer size too small", pp->dev, pp->prio.name); \ -+ return -1; \ -+ } \ -+} while(0) -+ -+static int -+build_wwn_path(struct path *pp, char *str, int len) -+{ -+ char *p = str; -+ -+ p += snprint_host_wwnn(p, str + len - p, pp); -+ CHECK_LEN; -+ p += snprintf(p, str + len - p, ":"); -+ CHECK_LEN; -+ p += snprint_host_wwpn(p, str + len - p, pp); -+ CHECK_LEN; -+ p += snprintf(p, str + len - p, ":"); -+ CHECK_LEN; -+ p += snprint_tgt_wwnn(p, str + len - p, pp); -+ CHECK_LEN; -+ p += snprintf(p, str + len - p, ":"); -+ CHECK_LEN; -+ p += snprint_tgt_wwpn(p, str + len - p, pp); -+ CHECK_LEN; -+ return 0; -+} -+ - /* main priority routine */ - int prio_path_weight(struct path *pp, char *prio_args) - { -@@ -72,6 +104,11 @@ int prio_path_weight(struct path *pp, ch - pp->sg_id.channel, pp->sg_id.scsi_id, pp->sg_id.lun); - } else if (!strcmp(regex, DEV_NAME)) { - strcpy(path, pp->dev); -+ } else if (!strcmp(regex, WWN)) { -+ if (build_wwn_path(pp, path, FILE_NAME_SIZE) != 0) { -+ FREE(arg); -+ return priority; -+ } - } else { - condlog(0, "%s: %s - Invalid arguments", pp->dev, - pp->prio.name); -Index: multipath-tools-130222/libmultipath/prioritizers/weightedpath.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/prioritizers/weightedpath.h -+++ multipath-tools-130222/libmultipath/prioritizers/weightedpath.h -@@ -4,6 +4,7 @@ - #define PRIO_WEIGHTED_PATH "weightedpath" - #define HBTL "hbtl" - #define DEV_NAME "devname" -+#define WWN "wwn" - #define DEFAULT_PRIORITY 0 - - int prio_path_weight(struct path *pp, char *prio_args); -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -216,11 +216,17 @@ prioritizers - .TP 12 - .B weighted - Needs a value of the form --.I " ..." -+.I " ..." - .I hbtl - regex can be of SCSI H:B:T:L format Ex: 1:0:.:. , *:0:0:. - .I devname - regex can be of device name format Ex: sda , sd.e -+.I wwn -+regex can be of the form -+.I "host_wwnn:host_wwpn:target_wwnn:target_wwpn" -+these values can be looked up through sysfs or by running -+.I mulitpathd show paths format "%N:%R:%n:%r" -+Ex: 0x200100e08ba0aea0:0x210100e08ba0aea0:.*:.* , .*:.*:iqn.2009-10.com.redhat.msp.lab.ask-06:.* - .TP - .B alua - If diff --git a/0152-RHBZ-1269293-fix-blk-unit-file.patch b/0152-RHBZ-1269293-fix-blk-unit-file.patch deleted file mode 100644 index cadc3f3..0000000 --- a/0152-RHBZ-1269293-fix-blk-unit-file.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- - multipathd/multipathd.service | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/multipathd/multipathd.service -=================================================================== ---- multipath-tools-130222.orig/multipathd/multipathd.service -+++ multipath-tools-130222/multipathd/multipathd.service -@@ -1,6 +1,6 @@ - [Unit] - Description=Device-Mapper Multipath Device Controller --Requires=blk-availability.service -+Wants=blk-availability.service - Before=iscsi.service iscsid.service lvm2-activation-early.service - After=syslog.target - ConditionPathExists=/etc/multipath.conf diff --git a/0153-RH-fix-i686-size-bug.patch b/0153-RH-fix-i686-size-bug.patch deleted file mode 100644 index 325ec9d..0000000 --- a/0153-RH-fix-i686-size-bug.patch +++ /dev/null @@ -1,156 +0,0 @@ ---- - multipathd/cli.c | 22 +++++++++++----------- - multipathd/cli.h | 20 +++++++++++--------- - 2 files changed, 22 insertions(+), 20 deletions(-) - -Index: multipath-tools-130222/multipathd/cli.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli.c -+++ multipath-tools-130222/multipathd/cli.c -@@ -26,7 +26,7 @@ alloc_handler (void) - } - - static int --add_key (vector vec, char * str, unsigned long code, int has_param) -+add_key (vector vec, char * str, uint64_t code, int has_param) - { - struct key * kw; - -@@ -57,7 +57,7 @@ out: - } - - int --add_handler (unsigned long fp, int (*fn)(void *, char **, int *, void *)) -+add_handler (uint64_t fp, int (*fn)(void *, char **, int *, void *)) - { - struct handler * h; - -@@ -79,7 +79,7 @@ add_handler (unsigned long fp, int (*fn) - } - - static struct handler * --find_handler (unsigned long fp) -+find_handler (uint64_t fp) - { - int i; - struct handler *h; -@@ -92,7 +92,7 @@ find_handler (unsigned long fp) - } - - int --set_handler_callback (unsigned long fp, int (*fn)(void *, char **, int *, void *)) -+set_handler_callback (uint64_t fp, int (*fn)(void *, char **, int *, void *)) - { - struct handler * h = find_handler(fp); - -@@ -293,11 +293,11 @@ out: - return r; - } - --static unsigned long -+static uint64_t - fingerprint(vector vec) - { - int i; -- unsigned long fp = 0; -+ uint64_t fp = 0; - struct key * kw; - - if (!vec) -@@ -343,7 +343,7 @@ static int - do_genhelp(char *reply, int maxlen) { - int len = 0; - int i, j; -- unsigned long fp; -+ uint64_t fp; - struct handler * h; - struct key * kw; - -@@ -442,7 +442,7 @@ parse_cmd (char * cmd, char ** reply, in - } - - char * --get_keyparam (vector v, unsigned long code) -+get_keyparam (vector v, uint64_t code) - { - struct key * kw; - int i; -@@ -515,7 +515,7 @@ void cli_exit(void) - } - - static int --key_match_fingerprint (struct key * kw, unsigned long fp) -+key_match_fingerprint (struct key * kw, uint64_t fp) - { - if (!fp) - return 0; -@@ -530,7 +530,7 @@ char * - key_generator (const char * str, int state) - { - static int index, len, has_param; -- static unsigned long rlfp; -+ static uint64_t rlfp; - struct key * kw; - int i; - struct handler *h; -@@ -600,7 +600,7 @@ key_generator (const char * str, int sta - * nfp is the candidate fingerprint we try to - * validate against all known command fingerprints. - */ -- unsigned long nfp = rlfp | kw->code; -+ uint64_t nfp = rlfp | kw->code; - vector_foreach_slot(handlers, h, i) { - if (!rlfp || ((h->fingerprint & nfp) == nfp)) { - /* -Index: multipath-tools-130222/multipathd/cli.h -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli.h -+++ multipath-tools-130222/multipathd/cli.h -@@ -1,3 +1,5 @@ -+#include -+ - enum { - __LIST, - __ADD, -@@ -68,10 +70,10 @@ enum { - #define WILDCARDS (1 << __WILDCARDS) - #define QUIT (1 << __QUIT) - #define SHUTDOWN (1 << __SHUTDOWN) --#define GETPRSTATUS (1UL << __GETPRSTATUS) --#define SETPRSTATUS (1UL << __SETPRSTATUS) --#define UNSETPRSTATUS (1UL << __UNSETPRSTATUS) --#define FMT (1UL << __FMT) -+#define GETPRSTATUS (1ULL << __GETPRSTATUS) -+#define SETPRSTATUS (1ULL << __SETPRSTATUS) -+#define UNSETPRSTATUS (1ULL << __UNSETPRSTATUS) -+#define FMT (1ULL << __FMT) - - #define INITIAL_REPLY_LEN 1200 - -@@ -92,21 +94,21 @@ enum { - struct key { - char * str; - char * param; -- unsigned long code; -+ uint64_t code; - int has_param; - }; - - struct handler { -- unsigned long fingerprint; -+ uint64_t fingerprint; - int (*fn)(void *, char **, int *, void *); - }; - - int alloc_handlers (void); --int add_handler (unsigned long fp, int (*fn)(void *, char **, int *, void *)); --int set_handler_callback (unsigned long fp, int (*fn)(void *, char **, int *, void *)); -+int add_handler (uint64_t fp, int (*fn)(void *, char **, int *, void *)); -+int set_handler_callback (uint64_t fp, int (*fn)(void *, char **, int *, void *)); - int parse_cmd (char * cmd, char ** reply, int * len, void *); - int load_keys (void); --char * get_keyparam (vector v, unsigned long code); -+char * get_keyparam (vector v, uint64_t code); - void free_keys (vector vec); - void free_handlers (void); - int cli_init (void); diff --git a/0154-UPBZ-1291406-disable-reinstate.patch b/0154-UPBZ-1291406-disable-reinstate.patch deleted file mode 100644 index a652e5c..0000000 --- a/0154-UPBZ-1291406-disable-reinstate.patch +++ /dev/null @@ -1,154 +0,0 @@ ---- - libmultipath/propsel.c | 20 ++++++++++++++++---- - libmultipath/structs.h | 1 + - multipathd/main.c | 37 ++++++++++++++++++++++++++----------- - 3 files changed, 43 insertions(+), 15 deletions(-) - -Index: multipath-tools-130222/libmultipath/propsel.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.c -+++ multipath-tools-130222/libmultipath/propsel.c -@@ -398,9 +398,11 @@ detect_prio(struct path * pp) - { - int ret; - struct prio *p = &pp->prio; -+ int tpgs = 0; - -- if (get_target_port_group_support(pp->fd) <= 0) -+ if ((tpgs = get_target_port_group_support(pp->fd)) <= 0) - return; -+ pp->tpgs = tpgs; - ret = get_target_port_group(pp->fd, NULL); - if (ret < 0) - return; -@@ -432,7 +434,7 @@ select_prio (struct path * pp) - pp->dev, prio_name(p)); - condlog(3, "%s: prio args = %s (LUN setting)", - pp->dev, prio_args(p)); -- return 0; -+ goto out; - } - - if (pp->hwe && pp->hwe->prio_name) { -@@ -441,7 +443,7 @@ select_prio (struct path * pp) - pp->dev, pp->hwe->prio_name); - condlog(3, "%s: prio args = %s (controller setting)", - pp->dev, pp->hwe->prio_args); -- return 0; -+ goto out; - } - if (conf->prio_name) { - prio_get(p, conf->prio_name, conf->prio_args); -@@ -449,13 +451,23 @@ select_prio (struct path * pp) - pp->dev, conf->prio_name); - condlog(3, "%s: prio args = %s (config file default)", - pp->dev, conf->prio_args); -- return 0; -+ goto out; - } - prio_get(p, DEFAULT_PRIO, DEFAULT_PRIO_ARGS); - condlog(3, "%s: prio = %s (internal default)", - pp->dev, DEFAULT_PRIO); - condlog(3, "%s: prio args = %s (internal default)", - pp->dev, DEFAULT_PRIO_ARGS); -+out: -+ /* -+ * fetch tpgs mode for alua -+ */ -+ if (!strncmp(prio_name(p), PRIO_ALUA, PRIO_NAME_LEN)) { -+ int tpgs = 0; -+ if (!pp->tpgs && -+ (tpgs = get_target_port_group_support(pp->fd)) >= 0) -+ pp->tpgs = tpgs; -+ } - return 0; - } - -Index: multipath-tools-130222/libmultipath/structs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.h -+++ multipath-tools-130222/libmultipath/structs.h -@@ -193,6 +193,7 @@ struct path { - int detect_prio; - int watch_checks; - int wait_checks; -+ int tpgs; - char * uid_attribute; - struct prio prio; - char * prio_args; -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include "prioritizers/alua_rtpg.h" - - /* - * libcheckers -@@ -1235,6 +1236,7 @@ check_path (struct vectors * vecs, struc - int newstate; - int new_path_up = 0; - int chkr_new_path_up = 0; -+ int disable_reinstate = 0; - int oldchkrstate = pp->chkrstate; - - if (!pp->mpp && (pp->missing_udev_info != INFO_MISSING || -@@ -1299,6 +1301,16 @@ check_path (struct vectors * vecs, struc - pp->wait_checks = 0; - } - -+ /* -+ * don't reinstate failed path, if its in stand-by -+ * and if target supports only implicit tpgs mode. -+ * this will prevent unnecessary i/o by dm on stand-by -+ * paths if there are no other active paths in map. -+ */ -+ disable_reinstate = (newstate == PATH_GHOST && -+ pp->mpp->nr_active == 0 && -+ pp->tpgs == TPGS_IMPLICIT) ? 1 : 0; -+ - pp->chkrstate = newstate; - if (newstate != pp->state) { - int oldstate = pp->state; -@@ -1354,15 +1366,17 @@ check_path (struct vectors * vecs, struc - /* - * reinstate this path - */ -- if (oldstate != PATH_UP && -- oldstate != PATH_GHOST) { -- if (pp->mpp->delay_watch_checks > 0) -- pp->watch_checks = pp->mpp->delay_watch_checks; -- reinstate_path(pp, 1); -- } else { -- if (pp->watch_checks > 0) -- pp->watch_checks--; -- reinstate_path(pp, 0); -+ if (!disable_reinstate) { -+ if (oldstate != PATH_UP && -+ oldstate != PATH_GHOST) { -+ if (pp->mpp->delay_watch_checks > 0) -+ pp->watch_checks = pp->mpp->delay_watch_checks; -+ reinstate_path(pp, 1); -+ } else { -+ if (pp->watch_checks > 0) -+ pp->watch_checks--; -+ reinstate_path(pp, 0); -+ } - } - new_path_up = 1; - -@@ -1377,8 +1391,9 @@ check_path (struct vectors * vecs, struc - enable_group(pp); - } - else if (newstate == PATH_UP || newstate == PATH_GHOST) { -- if (pp->dmstate == PSTATE_FAILED || -- pp->dmstate == PSTATE_UNDEF) { -+ if ((pp->dmstate == PSTATE_FAILED || -+ pp->dmstate == PSTATE_UNDEF) && -+ !disable_reinstate) { - /* Clear IO errors */ - reinstate_path(pp, 0); - } else { diff --git a/0155-UPBZ-1300415-PURE-config.patch b/0155-UPBZ-1300415-PURE-config.patch deleted file mode 100644 index e2bb0e1..0000000 --- a/0155-UPBZ-1300415-PURE-config.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- - libmultipath/hwtable.c | 16 ++++++++++++++++ - multipath.conf.defaults | 11 +++++++++++ - 2 files changed, 27 insertions(+) - -Index: multipath-tools-130222/libmultipath/hwtable.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/hwtable.c -+++ multipath-tools-130222/libmultipath/hwtable.c -@@ -1166,6 +1166,22 @@ static struct hwentry default_hw[] = { - .prio_name = DEFAULT_PRIO, - .prio_args = NULL, - }, -+ { -+ .vendor = "PURE", -+ .product = "FlashArray", -+ .features = DEFAULT_FEATURES, -+ .hwhandler = DEFAULT_HWHANDLER, -+ .selector = "queue-length 0", -+ .pgpolicy = MULTIBUS, -+ .pgfailback = -FAILBACK_IMMEDIATE, -+ .checker_name = TUR, -+ .fast_io_fail = 10, -+ .user_friendly_names = USER_FRIENDLY_NAMES_OFF, -+ .prio_name = DEFAULT_PRIO, -+ .no_path_retry = 0, -+ .dev_loss = 60, -+ .prio_args = NULL, -+ }, - /* - * EOL - */ -Index: multipath-tools-130222/multipath.conf.defaults -=================================================================== ---- multipath-tools-130222.orig/multipath.conf.defaults -+++ multipath-tools-130222/multipath.conf.defaults -@@ -962,6 +962,17 @@ - # failback immediate - # fast_io_fail_tmo 15 - # } -+# device { -+# vendor "PURE" -+# path_selector "queue-length 0" -+# path_grouping_policy "multibus" -+# path_checker "tur" -+# fast_io_fail_tmo 10 -+# user_friendly_names "no" -+# no_path_retry 0 -+# features 0 -+# dev_loss_tmo 60 -+# } - #} - #multipaths { - #} diff --git a/0156-UPBZ-1313324-dont-fail-discovery.patch b/0156-UPBZ-1313324-dont-fail-discovery.patch deleted file mode 100644 index 36262f7..0000000 --- a/0156-UPBZ-1313324-dont-fail-discovery.patch +++ /dev/null @@ -1,236 +0,0 @@ ---- - libmpathpersist/mpath_persist.c | 14 ++++++------ - libmultipath/discovery.c | 46 ++++++++++++++++++++-------------------- - libmultipath/discovery.h | 4 +++ - multipath/main.c | 2 - - multipathd/main.c | 6 +++-- - 5 files changed, 39 insertions(+), 33 deletions(-) - -Index: multipath-tools-130222/libmpathpersist/mpath_persist.c -=================================================================== ---- multipath-tools-130222.orig/libmpathpersist/mpath_persist.c -+++ multipath-tools-130222/libmpathpersist/mpath_persist.c -@@ -178,7 +178,7 @@ int mpath_persistent_reserve_in (int fd, - goto out; - } - -- if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER)) { -+ if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER) < 0) { - ret = MPATH_PR_DMMP_ERROR; - goto out1; - } -@@ -262,13 +262,13 @@ int mpath_persistent_reserve_out ( int f - curmp = vector_alloc (); - pathvec = vector_alloc (); - -- if (!curmp || !pathvec){ -- condlog (0, "%s: vector allocation failed.", alias); -- ret = MPATH_PR_DMMP_ERROR; -- goto out; -- } -+ if (!curmp || !pathvec){ -+ condlog (0, "%s: vector allocation failed.", alias); -+ ret = MPATH_PR_DMMP_ERROR; -+ goto out; -+ } - -- if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER)) { -+ if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER) < 0) { - ret = MPATH_PR_DMMP_ERROR; - goto out1; - } -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -32,7 +32,7 @@ int - store_pathinfo (vector pathvec, vector hwtable, struct udev_device *udevice, - int flag, struct path **pp_ptr) - { -- int err = 1; -+ int err = PATHINFO_FAILED; - struct path * pp; - const char * devname; - -@@ -41,12 +41,12 @@ store_pathinfo (vector pathvec, vector h - - devname = udev_device_get_sysname(udevice); - if (!devname) -- return 1; -+ return PATHINFO_FAILED; - - pp = alloc_path(); - - if (!pp) -- return 1; -+ return PATHINFO_FAILED; - - if(safe_sprintf(pp->dev, "%s", devname)) { - condlog(0, "pp->dev too small"); -@@ -80,19 +80,16 @@ path_discover (vector pathvec, struct co - - devname = udev_device_get_sysname(udevice); - if (!devname) -- return 0; -+ return PATHINFO_FAILED; - - if (filter_devnode(conf->blist_devnode, conf->elist_devnode, - (char *)devname) > 0) -- return 0; -+ return PATHINFO_SKIPPED; - - pp = find_path_by_dev(pathvec, (char *)devname); - if (!pp) { -- if (store_pathinfo(pathvec, conf->hwtable, -- udevice, flag, NULL) != 1) -- return 0; -- else -- return 1; -+ return store_pathinfo(pathvec, conf->hwtable, -+ udevice, flag, NULL); - } - return pathinfo(pp, conf->hwtable, flag); - } -@@ -104,11 +101,11 @@ path_discovery (vector pathvec, struct c - struct udev_list_entry *entry; - struct udev_device *udevice; - const char *devpath; -- int r = 0; -+ int num_paths = 0, total_paths = 0; - - udev_iter = udev_enumerate_new(conf->udev); - if (!udev_iter) -- return 1; -+ return -ENOMEM; - - udev_enumerate_add_match_subsystem(udev_iter, "block"); - udev_enumerate_scan_devices(udev_iter); -@@ -121,17 +118,20 @@ path_discovery (vector pathvec, struct c - udevice = udev_device_new_from_syspath(conf->udev, devpath); - if (!udevice) { - condlog(4, "%s: no udev information", devpath); -- r++; - continue; - } - devtype = udev_device_get_devtype(udevice); -- if(devtype && !strncmp(devtype, "disk", 4)) -- r += path_discover(pathvec, conf, udevice, flag); -+ if(devtype && !strncmp(devtype, "disk", 4)) { -+ total_paths++; -+ if (path_discover(pathvec, conf, -+ udevice, flag) == PATHINFO_OK) -+ num_paths++; -+ } - udev_device_unref(udevice); - } - udev_enumerate_unref(udev_iter); -- condlog(4, "Discovery status %d", r); -- return r; -+ condlog(4, "Discovered %d/%d paths", num_paths, total_paths); -+ return (total_paths - num_paths); - } - - #define declare_sysfs_get_str(fname) \ -@@ -1021,7 +1021,7 @@ get_state (struct path * pp, int daemon) - - if (!checker_selected(c)) { - if (daemon) { -- if (pathinfo(pp, conf->hwtable, DI_SYSFS) != 0) { -+ if (pathinfo(pp, conf->hwtable, DI_SYSFS) != PATHINFO_OK) { - condlog(3, "%s: couldn't get sysfs pathinfo", - pp->dev); - return PATH_UNCHECKED; -@@ -1140,7 +1140,7 @@ pathinfo (struct path *pp, vector hwtabl - int path_state; - - if (!pp) -- return 1; -+ return PATHINFO_FAILED; - - condlog(3, "%s: mask = 0x%x", pp->dev, mask); - -@@ -1148,12 +1148,12 @@ pathinfo (struct path *pp, vector hwtabl - * fetch info available in sysfs - */ - if (mask & DI_SYSFS && sysfs_pathinfo(pp)) -- return 1; -+ return PATHINFO_FAILED; - - if (mask & DI_BLACKLIST && mask & DI_SYSFS) { - if (filter_device(conf->blist_device, conf->elist_device, - pp->vendor_id, pp->product_id) > 0) { -- return 2; -+ return PATHINFO_SKIPPED; - } - } - -@@ -1199,7 +1199,7 @@ pathinfo (struct path *pp, vector hwtabl - if (mask & DI_BLACKLIST && mask & DI_WWID) { - if (filter_wwid(conf->blist_wwid, conf->elist_wwid, - pp->wwid) > 0) { -- return 2; -+ return PATHINFO_SKIPPED; - } - } - -@@ -1213,7 +1213,7 @@ pathinfo (struct path *pp, vector hwtabl - } - } - -- return 0; -+ return PATHINFO_OK; - - blank: - /* -Index: multipath-tools-130222/libmultipath/discovery.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.h -+++ multipath-tools-130222/libmultipath/discovery.h -@@ -24,6 +24,10 @@ - #define SCSI_COMMAND_TERMINATED 0x22 - #define SG_ERR_DRIVER_SENSE 0x08 - -+#define PATHINFO_OK 0 -+#define PATHINFO_FAILED 1 -+#define PATHINFO_SKIPPED 2 -+ - struct config; - - int sysfs_get_dev (struct udev_device *udev, char * buff, size_t len); -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -343,7 +343,7 @@ configure (void) - /* maximum info */ - di_flag = DI_ALL; - -- if (path_discovery(pathvec, conf, di_flag)) -+ if (path_discovery(pathvec, conf, di_flag) < 0) - goto out; - - if (conf->verbosity > 2) -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -1502,7 +1502,7 @@ configure (struct vectors * vecs, int st - struct multipath * mpp; - struct path * pp; - vector mpvec; -- int i; -+ int i, ret; - - if (!vecs->pathvec && !(vecs->pathvec = vector_alloc())) - return 1; -@@ -1516,7 +1516,9 @@ configure (struct vectors * vecs, int st - /* - * probe for current path (from sysfs) and map (from dm) sets - */ -- path_discovery(vecs->pathvec, conf, DI_ALL); -+ ret = path_discovery(vecs->pathvec, conf, DI_ALL); -+ if (ret < 0) -+ return 1; - - vector_foreach_slot (vecs->pathvec, pp, i){ - if (filter_path(conf, pp) > 0){ diff --git a/0157-RHBZ-1319853-multipath-c-error-msg.patch b/0157-RHBZ-1319853-multipath-c-error-msg.patch deleted file mode 100644 index dbf47c7..0000000 --- a/0157-RHBZ-1319853-multipath-c-error-msg.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- - libmultipath/alias.c | 8 ++++++++ - libmultipath/alias.h | 1 + - multipath/main.c | 7 ++++++- - 3 files changed, 15 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/alias.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/alias.c -+++ multipath-tools-130222/libmultipath/alias.c -@@ -36,6 +36,14 @@ - * See the file COPYING included with this distribution for more details. - */ - -+int -+valid_alias(char *alias) -+{ -+ if (strchr(alias, '/') != NULL) -+ return 0; -+ return 1; -+} -+ - - static int - format_devname(char *name, int id, int len, char *prefix) -Index: multipath-tools-130222/libmultipath/alias.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/alias.h -+++ multipath-tools-130222/libmultipath/alias.h -@@ -7,6 +7,7 @@ - "# alias wwid\n" \ - "#\n" - -+int valid_alias(char *alias); - char *get_user_friendly_alias(char *wwid, char *file, char *prefix, - int bindings_readonly); - int get_user_friendly_wwid(char *alias, char *buff, char *file); -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -454,8 +454,9 @@ get_dev_type(char *dev) { - } - else if (sscanf(dev, "%d:%d", &i, &i) == 2) - return DEV_DEVT; -- else -+ else if (valid_alias(dev)) - return DEV_DEVMAP; -+ return DEV_NONE; - } - - int -@@ -607,6 +608,10 @@ main (int argc, char *argv[]) - - strncpy(conf->dev, argv[optind], FILE_NAME_SIZE); - conf->dev_type = get_dev_type(conf->dev); -+ if (conf->dev_type == DEV_NONE) { -+ condlog(0, "'%s' is not a valid argument\n", conf->dev); -+ goto out; -+ } - } - conf->daemon = 0; - diff --git a/0158-RHBZ-1318581-timestamp-doc-fix.patch b/0158-RHBZ-1318581-timestamp-doc-fix.patch deleted file mode 100644 index d9af360..0000000 --- a/0158-RHBZ-1318581-timestamp-doc-fix.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- - multipath/multipath.8 | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -Index: multipath-tools-130222/multipath/multipath.8 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.8 -+++ multipath-tools-130222/multipath/multipath.8 -@@ -83,6 +83,17 @@ remove the wwid for the specified device - .B \-W - reset the wwids file to only include the current multipath devices - .TP -+.B \-T "tm:valid" -+check if -+.I tm -+matches the multipathd configuration timestamp value from -+.I "/run/multipathd/timestamp" -+If so, return success if -+.I valid -+is 1. Otherwise, return failure. If the timestamp doesn't match continue -+with multipath execution. This option is designed to be used with -c by -+the udev rules. -+.TP - .BI \-p " policy" - force new maps to use the specified policy: - .RS 1.2i diff --git a/0159-UPBZ-1255885-udev-waits.patch b/0159-UPBZ-1255885-udev-waits.patch deleted file mode 100644 index 9e0921b..0000000 --- a/0159-UPBZ-1255885-udev-waits.patch +++ /dev/null @@ -1,287 +0,0 @@ ---- - kpartx/devmapper.c | 41 ++++++++++++++++++++++++++++------------- - kpartx/devmapper.h | 4 ++-- - kpartx/kpartx.c | 16 ++++++++-------- - libmultipath/config.h | 1 - - libmultipath/devmapper.c | 19 +++++++++++++------ - multipath/main.c | 2 -- - 6 files changed, 51 insertions(+), 32 deletions(-) - -Index: multipath-tools-130222/kpartx/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/devmapper.c -+++ multipath-tools-130222/kpartx/devmapper.c -@@ -14,13 +14,6 @@ - #define MAX_PREFIX_LEN 8 - #define PARAMS_SIZE 1024 - --#ifndef LIBDM_API_COOKIE --static inline int dm_task_set_cookie(struct dm_task *dmt, uint32_t *c, int a) --{ -- return 1; --} --#endif -- - extern int - dm_prereq (char * str, int x, int y, int z) - { -@@ -60,10 +53,13 @@ dm_prereq (char * str, int x, int y, int - } - - extern int --dm_simplecmd (int task, const char *name, int no_flush, uint32_t *cookie, uint16_t udev_flags) { -+dm_simplecmd (int task, const char *name, int no_flush, uint16_t udev_flags) { - int r = 0; - int udev_wait_flag = (task == DM_DEVICE_RESUME || - task == DM_DEVICE_REMOVE); -+#ifdef LIBDM_API_COOKIE -+ uint32_t cookie = 0; -+#endif - struct dm_task *dmt; - - if (!(dmt = dm_task_create(task))) -@@ -78,10 +74,17 @@ dm_simplecmd (int task, const char *name - if (no_flush) - dm_task_no_flush(dmt); - -- if (udev_wait_flag && !dm_task_set_cookie(dmt, cookie, ((udev_sync)? 0 : DM_UDEV_DISABLE_LIBRARY_FALLBACK) | udev_flags)) -+#ifdef LIBDM_API_COOKIE -+ if (!udev_sync) -+ udev_flags |= DM_UDEV_DISABLE_LIBRARY_FALLBACK; -+ if (udev_wait_flag && !dm_task_set_cookie(dmt, &cookie, udev_flags)) - goto out; -+#endif - r = dm_task_run(dmt); -- -+#ifdef LIBDM_API_COOKIE -+ if (udev_wait_flag) -+ dm_udev_wait(cookie); -+#endif - out: - dm_task_destroy(dmt); - return r; -@@ -90,10 +93,14 @@ dm_simplecmd (int task, const char *name - extern int - dm_addmap (int task, const char *name, const char *target, - const char *params, uint64_t size, int ro, const char *uuid, int part, -- mode_t mode, uid_t uid, gid_t gid, uint32_t *cookie) { -+ mode_t mode, uid_t uid, gid_t gid) { - int r = 0; - struct dm_task *dmt; - char *prefixed_uuid = NULL; -+#ifdef LIBDM_API_COOKIE -+ uint32_t cookie = 0; -+ uint16_t udev_flags = 0; -+#endif - - if (!(dmt = dm_task_create (task))) - return 0; -@@ -128,10 +135,18 @@ dm_addmap (int task, const char *name, c - - dm_task_no_open_count(dmt); - -- if (task == DM_DEVICE_CREATE && !dm_task_set_cookie(dmt, cookie, (udev_sync)? 0 : DM_UDEV_DISABLE_LIBRARY_FALLBACK)) -+#ifdef LIBDM_API_COOKIE -+ if (!udev_sync) -+ udev_flags = DM_UDEV_DISABLE_LIBRARY_FALLBACK; -+ if (task == DM_DEVICE_CREATE && -+ !dm_task_set_cookie(dmt, &cookie, udev_flags)) - goto addout; -+#endif - r = dm_task_run (dmt); -- -+#ifdef LIBDM_API_COOKIE -+ if (task == DM_DEVICE_CREATE) -+ dm_udev_wait(cookie); -+#endif - addout: - dm_task_destroy (dmt); - free(prefixed_uuid); -Index: multipath-tools-130222/kpartx/devmapper.h -=================================================================== ---- multipath-tools-130222.orig/kpartx/devmapper.h -+++ multipath-tools-130222/kpartx/devmapper.h -@@ -11,9 +11,9 @@ - extern int udev_sync; - - int dm_prereq (char *, int, int, int); --int dm_simplecmd (int, const char *, int, uint32_t *, uint16_t); -+int dm_simplecmd (int, const char *, int, uint16_t); - int dm_addmap (int, const char *, const char *, const char *, uint64_t, -- int, const char *, int, mode_t, uid_t, gid_t, uint32_t *); -+ int, const char *, int, mode_t, uid_t, gid_t); - int dm_map_present (char *, char **); - char * dm_mapname(int major, int minor); - dev_t dm_get_first_dep(char *devname); -Index: multipath-tools-130222/kpartx/kpartx.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/kpartx.c -+++ multipath-tools-130222/kpartx/kpartx.c -@@ -224,7 +224,6 @@ main(int argc, char **argv){ - int hotplug = 0; - int loopcreated = 0; - struct stat buf; -- uint32_t cookie = 0; - - initpts(); - init_crc32(); -@@ -300,6 +299,8 @@ main(int argc, char **argv){ - #ifdef LIBDM_API_COOKIE - if (!udev_sync) - dm_udev_set_sync_support(0); -+ else -+ dm_udev_set_sync_support(1); - #endif - - if (dm_prereq(DM_TARGET, 0, 0, 0) && (what == ADD || what == DELETE || what == UPDATE)) { -@@ -451,7 +452,7 @@ main(int argc, char **argv){ - } - - if (!dm_simplecmd(DM_DEVICE_REMOVE, partname, -- 0, &cookie, 0)) { -+ 0, 0)) { - r++; - continue; - } -@@ -508,7 +509,7 @@ main(int argc, char **argv){ - if (!dm_addmap(op, partname, DM_TARGET, params, - slices[j].size, ro, uuid, j+1, - buf.st_mode & 0777, buf.st_uid, -- buf.st_gid, &cookie)) { -+ buf.st_gid)) { - fprintf(stderr, "create/reload failed on %s\n", - partname); - r++; -@@ -516,12 +517,13 @@ main(int argc, char **argv){ - } - if (op == DM_DEVICE_RELOAD && - !dm_simplecmd(DM_DEVICE_RESUME, partname, -- 1, &cookie, MPATH_UDEV_RELOAD_FLAG)) { -+ 1, MPATH_UDEV_RELOAD_FLAG)) { - fprintf(stderr, "resume failed on %s\n", - partname); - r++; - continue; - } -+ - dm_devn(partname, &slices[j].major, - &slices[j].minor); - -@@ -560,7 +562,7 @@ main(int argc, char **argv){ - } - - if (!dm_simplecmd(DM_DEVICE_REMOVE, -- partname, 1, &cookie, 0)) { -+ partname, 1, 0)) { - r++; - continue; - } -@@ -586,9 +588,7 @@ main(int argc, char **argv){ - } - printf("loop deleted : %s\n", device); - } --#ifdef LIBDM_API_COOKIE -- dm_udev_wait(cookie); --#endif -+ - dm_lib_release(); - dm_lib_exit(); - -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -129,7 +129,6 @@ struct config { - uid_t uid; - gid_t gid; - mode_t mode; -- uint32_t cookie; - int reassign_maps; - int retain_hwhandler; - int detect_prio; -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -215,6 +215,7 @@ dm_simplecmd (int task, const char *name - int r = 0; - int udev_wait_flag = (need_sync && (task == DM_DEVICE_RESUME || - task == DM_DEVICE_REMOVE)); -+ uint32_t cookie = 0; - struct dm_task *dmt; - - if (!(dmt = dm_task_create (task))) -@@ -233,10 +234,12 @@ dm_simplecmd (int task, const char *name - if (do_deferred(deferred_remove)) - dm_task_deferred_remove(dmt); - #endif -- if (udev_wait_flag && !dm_task_set_cookie(dmt, &conf->cookie, ((conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0) | udev_flags)) -+ if (udev_wait_flag && !dm_task_set_cookie(dmt, &cookie, ((conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0) | udev_flags)) - goto out; - r = dm_task_run (dmt); - -+ if (udev_wait_flag) -+ udev_wait(cookie); - out: - dm_task_destroy (dmt); - return r; -@@ -264,6 +267,7 @@ dm_addmap (int task, const char *target, - int r = 0; - struct dm_task *dmt; - char *prefixed_uuid = NULL; -+ uint32_t cookie = 0; - - if (!(dmt = dm_task_create (task))) - return 0; -@@ -304,10 +308,12 @@ dm_addmap (int task, const char *target, - dm_task_no_open_count(dmt); - - if (task == DM_DEVICE_CREATE && -- !dm_task_set_cookie(dmt, &conf->cookie, (conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0)) -+ !dm_task_set_cookie(dmt, &cookie, (conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0)) - goto freeout; - r = dm_task_run (dmt); - -+ if (task == DM_DEVICE_CREATE) -+ udev_wait(cookie); - freeout: - if (prefixed_uuid) - FREE(prefixed_uuid); -@@ -1366,6 +1372,7 @@ dm_rename (const char * old, char * new) - { - int r = 0; - struct dm_task *dmt; -+ uint32_t cookie; - - if (dm_rename_partmaps(old, new)) - return r; -@@ -1381,12 +1388,12 @@ dm_rename (const char * old, char * new) - - dm_task_no_open_count(dmt); - -- if (!dm_task_set_cookie(dmt, &conf->cookie, (conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0)) -- goto out; -- if (!dm_task_run(dmt)) -+ if (!dm_task_set_cookie(dmt, &cookie, (conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0)) - goto out; -+ r = dm_task_run(dmt); -+ -+ udev_wait(cookie); - -- r = 1; - out: - dm_task_destroy(dmt); - return r; -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -681,8 +681,6 @@ main (int argc, char *argv[]) - condlog(3, "restart multipath configuration process"); - - out: -- udev_wait(conf->cookie); -- - dm_lib_release(); - dm_lib_exit(); - diff --git a/0160-RH-udev-flags.patch b/0160-RH-udev-flags.patch deleted file mode 100644 index 29a2c9c..0000000 --- a/0160-RH-udev-flags.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- - libmultipath/devmapper.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -213,8 +213,9 @@ dm_prereq (void) - static int - dm_simplecmd (int task, const char *name, int no_flush, int need_sync, uint16_t udev_flags, int deferred_remove) { - int r = 0; -- int udev_wait_flag = (need_sync && (task == DM_DEVICE_RESUME || -- task == DM_DEVICE_REMOVE)); -+ int udev_wait_flag = ((need_sync && (task == DM_DEVICE_RESUME || -+ task == DM_DEVICE_REMOVE)) || -+ udev_flags); - uint32_t cookie = 0; - struct dm_task *dmt; - diff --git a/0161-RHBZ-1311659-no-kpartx.patch b/0161-RHBZ-1311659-no-kpartx.patch deleted file mode 100644 index 0bce7f6..0000000 --- a/0161-RHBZ-1311659-no-kpartx.patch +++ /dev/null @@ -1,618 +0,0 @@ ---- - libmultipath/config.c | 3 + - libmultipath/config.h | 3 + - libmultipath/configure.c | 15 +++-- - libmultipath/defaults.h | 1 - libmultipath/devmapper.c | 35 +++++++++---- - libmultipath/devmapper.h | 8 ++- - libmultipath/dict.c | 114 +++++++++++++++++++++++++++++++++++++++++++++ - libmultipath/propsel.c | 26 ++++++++++ - libmultipath/propsel.h | 1 - libmultipath/structs.h | 7 ++ - multipath/multipath.conf.5 | 10 +++ - multipath/multipath.rules | 1 - multipathd/cli_handlers.c | 4 + - 13 files changed, 211 insertions(+), 17 deletions(-) - -Index: multipath-tools-130222/libmultipath/config.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.c -+++ multipath-tools-130222/libmultipath/config.c -@@ -343,6 +343,7 @@ merge_hwe (struct hwentry * dst, struct - merge_num(deferred_remove); - merge_num(delay_watch_checks); - merge_num(delay_wait_checks); -+ merge_num(skip_kpartx); - - /* - * Make sure features is consistent with -@@ -403,6 +404,7 @@ overwrite_hwe (struct hwentry * dst, str - overwrite_num(deferred_remove); - overwrite_num(delay_watch_checks); - overwrite_num(delay_wait_checks); -+ overwrite_num(skip_kpartx); - - /* - * Make sure features is consistent with -@@ -677,6 +679,7 @@ load_config (char * file, struct udev *u - conf->retrigger_delay = DEFAULT_RETRIGGER_DELAY; - conf->new_bindings_in_boot = 0; - conf->uev_msg_delay = DEFAULT_UEV_MSG_DELAY; -+ conf->skip_kpartx = DEFAULT_SKIP_KPARTX; - - /* - * preload default hwtable -Index: multipath-tools-130222/libmultipath/config.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/config.h -+++ multipath-tools-130222/libmultipath/config.h -@@ -64,6 +64,7 @@ struct hwentry { - int deferred_remove; - int delay_watch_checks; - int delay_wait_checks; -+ int skip_kpartx; - char * bl_product; - }; - -@@ -90,6 +91,7 @@ struct mpentry { - int deferred_remove; - int delay_watch_checks; - int delay_wait_checks; -+ int skip_kpartx; - uid_t uid; - gid_t gid; - mode_t mode; -@@ -143,6 +145,7 @@ struct config { - int new_bindings_in_boot; - int delayed_reconfig; - int uev_msg_delay; -+ int skip_kpartx; - unsigned int version[3]; - - char * dev; -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -294,6 +294,7 @@ setup_map (struct multipath * mpp, char - select_deferred_remove(mpp); - select_delay_watch_checks(mpp); - select_delay_wait_checks(mpp); -+ select_skip_kpartx(mpp); - - sysfs_set_scsi_tmo(mpp); - /* -@@ -446,6 +447,7 @@ select_action (struct multipath * mpp, v - } - mpp->force_udev_reload = !pathcount(mpp, PATH_WILD); - if (cmpp->size != mpp->size) { -+ mpp->force_udev_reload = 1; - mpp->action = ACT_RESIZE; - condlog(3, "%s: set ACT_RESIZE (size change)", - mpp->alias); -@@ -609,6 +611,7 @@ extern int - domap (struct multipath * mpp, char * params) - { - int r = 0; -+ uint16_t udev_flags = ((mpp->force_udev_reload)? 0 : MPATH_UDEV_RELOAD_FLAG) | ((mpp->skip_kpartx == SKIP_KPARTX_ON)? MPATH_UDEV_NO_KPARTX_FLAG : 0); - - /* - * last chance to quit before touching the devmaps -@@ -654,25 +657,27 @@ domap (struct multipath * mpp, char * pa - case ACT_RELOAD: - r = dm_addmap_reload(mpp, params); - if (r) -- r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, (mpp->force_udev_reload)? 0 : MPATH_UDEV_RELOAD_FLAG); -+ r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, -+ udev_flags); - break; - - case ACT_RESIZE: - r = dm_addmap_reload(mpp, params); - if (r) -- r = dm_simplecmd_flush(DM_DEVICE_RESUME, mpp->alias, 1, 0); -+ r = dm_simplecmd_flush(DM_DEVICE_RESUME, mpp->alias, 1, -+ udev_flags); - break; - - case ACT_RENAME: -- r = dm_rename(mpp->alias_old, mpp->alias); -+ r = dm_rename(mpp->alias_old, mpp->alias, mpp->skip_kpartx); - break; - - case ACT_RENAME2: -- r = dm_rename(mpp->alias_old, mpp->alias); -+ r = dm_rename(mpp->alias_old, mpp->alias, mpp->skip_kpartx); - if (r) { - r = dm_addmap_reload(mpp, params); - if (r) -- r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, (mpp->force_udev_reload)? 0 : MPATH_UDEV_RELOAD_FLAG); -+ r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, udev_flags); - } - break; - -Index: multipath-tools-130222/libmultipath/defaults.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/defaults.h -+++ multipath-tools-130222/libmultipath/defaults.h -@@ -24,6 +24,7 @@ - #define DEFAULT_RETRIGGER_DELAY 10 - #define DEFAULT_RETRIGGER_TRIES 3 - #define DEFAULT_UEV_MSG_DELAY 30 -+#define DEFAULT_SKIP_KPARTX SKIP_KPARTX_OFF - - #define DEFAULT_CHECKINT 5 - #define MAX_CHECKINT(a) (a << 2) -Index: multipath-tools-130222/libmultipath/devmapper.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.c -+++ multipath-tools-130222/libmultipath/devmapper.c -@@ -262,13 +262,14 @@ dm_device_remove (const char *name, int - deferred_remove); - } - --extern int -+static int - dm_addmap (int task, const char *target, struct multipath *mpp, char * params, -- int use_uuid, int ro) { -+ int use_uuid, int ro, int skip_kpartx) { - int r = 0; - struct dm_task *dmt; - char *prefixed_uuid = NULL; - uint32_t cookie = 0; -+ uint16_t udev_flags = ((conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0) | ((skip_kpartx == SKIP_KPARTX_ON)? MPATH_UDEV_NO_KPARTX_FLAG : 0); - - if (!(dmt = dm_task_create (task))) - return 0; -@@ -309,7 +310,7 @@ dm_addmap (int task, const char *target, - dm_task_no_open_count(dmt); - - if (task == DM_DEVICE_CREATE && -- !dm_task_set_cookie(dmt, &cookie, (conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0)) -+ !dm_task_set_cookie(dmt, &cookie, udev_flags)) - goto freeout; - r = dm_task_run (dmt); - -@@ -332,7 +333,8 @@ dm_addmap_create (struct multipath *mpp, - for (ro = 0; ro <= 1; ro++) { - int err; - -- if (dm_addmap(DM_DEVICE_CREATE, TGT_MPATH, mpp, params, 1, ro)) -+ if (dm_addmap(DM_DEVICE_CREATE, TGT_MPATH, -+ mpp, params, 1, ro, mpp->skip_kpartx)) - return 1; - /* - * DM_DEVICE_CREATE is actually DM_DEV_CREATE + DM_TABLE_LOAD. -@@ -354,11 +356,11 @@ dm_addmap_create (struct multipath *mpp, - - extern int - dm_addmap_reload (struct multipath *mpp, char *params) { -- if (dm_addmap(DM_DEVICE_RELOAD, TGT_MPATH, mpp, params, 0, ADDMAP_RW)) -+ if (dm_addmap(DM_DEVICE_RELOAD, TGT_MPATH, mpp, params, 0, ADDMAP_RW, SKIP_KPARTX_OFF)) - return 1; - if (errno != EROFS) - return 0; -- return dm_addmap(DM_DEVICE_RELOAD, TGT_MPATH, mpp, params, 0, ADDMAP_RO); -+ return dm_addmap(DM_DEVICE_RELOAD, TGT_MPATH, mpp, params, 0, ADDMAP_RO, SKIP_KPARTX_OFF); - } - - extern int -@@ -720,6 +722,12 @@ out: - } - - static int -+has_partmap(const char *name, void *data) -+{ -+ return 1; -+} -+ -+static int - partmap_in_use(const char *name, void *data) - { - int part_count, *ret_count = (int *)data; -@@ -798,10 +806,16 @@ dm_suspend_and_flush_map (const char * m - int s = 0, queue_if_no_path = 0; - unsigned long long mapsize; - char params[PARAMS_SIZE] = {0}; -+ int udev_flags = 0; - - if (!dm_is_mpath(mapname)) - return 0; /* nothing to do */ - -+ /* if the device currently has no partitions, do not -+ run kpartx on it if you fail to delete it */ -+ if (do_foreach_partmaps(mapname, has_partmap, NULL) == 0) -+ udev_flags |= MPATH_UDEV_NO_KPARTX_FLAG; -+ - if (!dm_get_map(mapname, &mapsize, params)) { - if (strstr(params, "queue_if_no_path")) - queue_if_no_path = 1; -@@ -820,7 +834,7 @@ dm_suspend_and_flush_map (const char * m - return 0; - } - condlog(2, "failed to remove multipath map %s", mapname); -- dm_simplecmd_noflush(DM_DEVICE_RESUME, mapname, 0); -+ dm_simplecmd_noflush(DM_DEVICE_RESUME, mapname, udev_flags); - if (queue_if_no_path) - s = dm_queue_if_no_path((char *)mapname, 1); - return 1; -@@ -1349,7 +1363,7 @@ rename_partmap (const char *name, void * - for (offset = strlen(rd->old); name[offset] && !(isdigit(name[offset])); offset++); /* do nothing */ - snprintf(buff, PARAMS_SIZE, "%s%s%s", rd->new, rd->delim, - name + offset); -- dm_rename(name, buff); -+ dm_rename(name, buff, SKIP_KPARTX_OFF); - condlog(4, "partition map %s renamed", name); - return 0; - } -@@ -1369,11 +1383,12 @@ dm_rename_partmaps (const char * old, ch - } - - int --dm_rename (const char * old, char * new) -+dm_rename (const char * old, char * new, int skip_kpartx) - { - int r = 0; - struct dm_task *dmt; - uint32_t cookie; -+ uint16_t udev_flags = ((conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0) | ((skip_kpartx == SKIP_KPARTX_ON)? MPATH_UDEV_NO_KPARTX_FLAG : 0); - - if (dm_rename_partmaps(old, new)) - return r; -@@ -1389,7 +1404,7 @@ dm_rename (const char * old, char * new) - - dm_task_no_open_count(dmt); - -- if (!dm_task_set_cookie(dmt, &cookie, (conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0)) -+ if (!dm_task_set_cookie(dmt, &cookie, udev_flags)) - goto out; - r = dm_task_run(dmt); - -Index: multipath-tools-130222/libmultipath/devmapper.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/devmapper.h -+++ multipath-tools-130222/libmultipath/devmapper.h -@@ -12,6 +12,12 @@ - #define MPATH_UDEV_RELOAD_FLAG 0 - #endif - -+#ifdef DM_SUBSYSTEM_UDEV_FLAG1 -+#define MPATH_UDEV_NO_KPARTX_FLAG DM_SUBSYSTEM_UDEV_FLAG1 -+#else -+#define MPATH_UDEV_NO_KPARTX_FLAG 0 -+#endif -+ - void dm_init(void); - int dm_prereq (void); - int dm_drv_version (unsigned int * version, char * str); -@@ -47,7 +53,7 @@ int dm_remove_partmaps (const char * map - int deferred_remove); - int dm_get_uuid(char *name, char *uuid); - int dm_get_info (char * mapname, struct dm_info ** dmi); --int dm_rename (const char * old, char * new); -+int dm_rename (const char * old, char * new, int skip_kpartx); - int dm_reassign(const char * mapname); - int dm_reassign_table(const char *name, char *old, char *new); - int dm_setgeometry(struct multipath *mpp); -Index: multipath-tools-130222/libmultipath/dict.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dict.c -+++ multipath-tools-130222/libmultipath/dict.c -@@ -779,6 +779,29 @@ def_deferred_remove_handler(vector strve - } - - static int -+def_skip_kpartx_handler(vector strvec) -+{ -+ char * buff; -+ -+ buff = set_value(strvec); -+ -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ conf->skip_kpartx = SKIP_KPARTX_OFF; -+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) || -+ (strlen(buff) == 1 && !strcmp(buff, "1"))) -+ conf->skip_kpartx = SKIP_KPARTX_ON; -+ else -+ conf->skip_kpartx = DEFAULT_SKIP_KPARTX; -+ -+ FREE(buff); -+ return 0; -+} -+ -+static int - def_ignore_new_boot_devs_handler(vector strvec) - { - char * buff; -@@ -1629,6 +1652,33 @@ hw_deferred_remove_handler(vector strvec - } - - static int -+hw_skip_kpartx_handler(vector strvec) -+{ -+ struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable); -+ char * buff; -+ -+ if (!hwe) -+ return 1; -+ -+ buff = set_value(strvec); -+ -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) || -+ (strlen(buff) == 1 && !strcmp(buff, "0"))) -+ hwe->skip_kpartx = SKIP_KPARTX_OFF; -+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) || -+ (strlen(buff) == 1 && !strcmp(buff, "1"))) -+ hwe->skip_kpartx = SKIP_KPARTX_ON; -+ else -+ hwe->skip_kpartx = SKIP_KPARTX_UNDEF; -+ -+ FREE(buff); -+ return 0; -+} -+ -+static int - hw_delay_watch_checks_handler(vector strvec) - { - struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable); -@@ -2154,6 +2204,32 @@ mp_deferred_remove_handler(vector strvec - } - - static int -+mp_skip_kpartx_handler(vector strvec) -+{ -+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable); -+ char * buff; -+ -+ if (!mpe) -+ return 1; -+ -+ buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ -+ if ((strlen(buff) == 2 && strcmp(buff, "no") == 0) || -+ (strlen(buff) == 1 && strcmp(buff, "0") == 0)) -+ mpe->skip_kpartx = SKIP_KPARTX_OFF; -+ else if ((strlen(buff) == 3 && strcmp(buff, "yes") == 0) || -+ (strlen(buff) == 1 && strcmp(buff, "1") == 0)) -+ mpe->skip_kpartx = SKIP_KPARTX_ON; -+ else -+ mpe->skip_kpartx = SKIP_KPARTX_UNDEF; -+ -+ FREE(buff); -+ return 0; -+} -+ -+static int - mp_delay_watch_checks_handler(vector strvec) - { - struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable); -@@ -2461,6 +2537,19 @@ snprint_mp_deferred_remove (char * buff, - } - - static int -+snprint_mp_skip_kpartx (char * buff, int len, void * data) -+{ -+ struct mpentry * mpe = (struct mpentry *)data; -+ -+ if (mpe->skip_kpartx == SKIP_KPARTX_UNDEF) -+ return 0; -+ else if (mpe->skip_kpartx == SKIP_KPARTX_OFF) -+ return snprintf(buff, len, "no"); -+ else -+ return snprintf(buff, len, "yes"); -+} -+ -+static int - snprint_mp_delay_watch_checks(char * buff, int len, void * data) - { - struct mpentry * mpe = (struct mpentry *)data; -@@ -2813,6 +2902,19 @@ snprint_hw_deferred_remove(char * buff, - } - - static int -+snprint_hw_skip_kpartx(char * buff, int len, void * data) -+{ -+ struct hwentry * hwe = (struct hwentry *)data; -+ -+ if (hwe->skip_kpartx == SKIP_KPARTX_ON) -+ return snprintf(buff, len, "yes"); -+ else if (hwe->skip_kpartx == SKIP_KPARTX_OFF) -+ return snprintf(buff, len, "no"); -+ else -+ return 0; -+} -+ -+static int - snprint_hw_delay_watch_checks(char * buff, int len, void * data) - { - struct hwentry * hwe = (struct hwentry *)data; -@@ -3231,6 +3333,15 @@ snprint_def_deferred_remove(char * buff, - } - - static int -+snprint_def_skip_kpartx(char * buff, int len, void * data) -+{ -+ if (conf->skip_kpartx == SKIP_KPARTX_ON) -+ return snprintf(buff, len, "yes"); -+ else -+ return snprintf(buff, len, "no"); -+} -+ -+static int - snprint_def_ignore_new_boot_devs(char * buff, int len, void * data) - { - if (conf->ignore_new_boot_devs == 1) -@@ -3364,6 +3475,7 @@ init_keywords(void) - install_keyword("force_sync", &def_force_sync_handler, &snprint_def_force_sync); - install_keyword("deferred_remove", &def_deferred_remove_handler, &snprint_def_deferred_remove); - install_keyword("ignore_new_boot_devs", &def_ignore_new_boot_devs_handler, &snprint_def_ignore_new_boot_devs); -+ install_keyword("skip_kpartx", &def_skip_kpartx_handler, &snprint_def_skip_kpartx); - install_keyword("config_dir", &def_config_dir_handler, &snprint_def_config_dir); - install_keyword("delay_watch_checks", &def_delay_watch_checks_handler, &snprint_def_delay_watch_checks); - install_keyword("delay_wait_checks", &def_delay_wait_checks_handler, &snprint_def_delay_wait_checks); -@@ -3438,6 +3550,7 @@ init_keywords(void) - install_keyword("deferred_remove", &hw_deferred_remove_handler, &snprint_hw_deferred_remove); - install_keyword("delay_watch_checks", &hw_delay_watch_checks_handler, &snprint_hw_delay_watch_checks); - install_keyword("delay_wait_checks", &hw_delay_wait_checks_handler, &snprint_hw_delay_wait_checks); -+ install_keyword("skip_kpartx", &hw_skip_kpartx_handler, &snprint_hw_skip_kpartx); - install_sublevel_end(); - - install_keyword_root("multipaths", &multipaths_handler); -@@ -3465,5 +3578,6 @@ init_keywords(void) - install_keyword("deferred_remove", &mp_deferred_remove_handler, &snprint_mp_deferred_remove); - install_keyword("delay_watch_checks", &mp_delay_watch_checks_handler, &snprint_mp_delay_watch_checks); - install_keyword("delay_wait_checks", &mp_delay_wait_checks_handler, &snprint_mp_delay_wait_checks); -+ install_keyword("skip_kpartx", &mp_skip_kpartx_handler, &snprint_mp_skip_kpartx); - install_sublevel_end(); - } -Index: multipath-tools-130222/libmultipath/propsel.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.c -+++ multipath-tools-130222/libmultipath/propsel.c -@@ -854,3 +854,29 @@ select_delay_wait_checks (struct multipa - condlog(3, "delay_wait_checks = DISABLED (internal default)"); - return 0; - } -+ -+extern int -+select_skip_kpartx (struct multipath * mp) -+{ -+ if (mp->mpe && mp->mpe->skip_kpartx != SKIP_KPARTX_UNDEF) { -+ mp->skip_kpartx = mp->mpe->skip_kpartx; -+ condlog(3, "skip_kpartx = %i (multipath setting)", -+ mp->skip_kpartx); -+ return 0; -+ } -+ if (mp->hwe && mp->hwe->skip_kpartx != SKIP_KPARTX_UNDEF) { -+ mp->skip_kpartx = mp->hwe->skip_kpartx; -+ condlog(3, "skip_kpartx = %i (controler setting)", -+ mp->skip_kpartx); -+ return 0; -+ } -+ if (conf->skip_kpartx != SKIP_KPARTX_UNDEF) { -+ mp->skip_kpartx = conf->skip_kpartx; -+ condlog(3, "skip_kpartx = %i (config file default)", -+ mp->skip_kpartx); -+ return 0; -+ } -+ mp->skip_kpartx = DEFAULT_SKIP_KPARTX; -+ condlog(3, "skip_kpartx = DISABLED (internal default)"); -+ return 0; -+} -Index: multipath-tools-130222/libmultipath/propsel.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/propsel.h -+++ multipath-tools-130222/libmultipath/propsel.h -@@ -23,3 +23,4 @@ int select_detect_prio(struct path * pp) - int select_deferred_remove(struct multipath *mp); - int select_delay_watch_checks (struct multipath * mp); - int select_delay_wait_checks (struct multipath * mp); -+int select_skip_kpartx (struct multipath * mp); -Index: multipath-tools-130222/libmultipath/structs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.h -+++ multipath-tools-130222/libmultipath/structs.h -@@ -121,6 +121,12 @@ enum deferred_remove_states { - DEFERRED_REMOVE_IN_PROGRESS, - }; - -+enum skip_kpartx_states { -+ SKIP_KPARTX_UNDEF, -+ SKIP_KPARTX_OFF, -+ SKIP_KPARTX_ON, -+}; -+ - enum scsi_protocol { - SCSI_PROTOCOL_FCP = 0, /* Fibre Channel */ - SCSI_PROTOCOL_SPI = 1, /* parallel SCSI */ -@@ -236,6 +242,7 @@ struct multipath { - int delay_watch_checks; - int delay_wait_checks; - int force_udev_reload; -+ int skip_kpartx; - unsigned int dev_loss; - uid_t uid; - gid_t gid; -Index: multipath-tools-130222/multipath/multipath.rules -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.rules -+++ multipath-tools-130222/multipath/multipath.rules -@@ -44,6 +44,7 @@ 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_SUBSYSTEM_UDEV_FLAG1}=="1", 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" -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -825,19 +825,21 @@ cli_resume(void * v, char ** reply, int - char * param = get_keyparam(v, MAP); - int r; - struct multipath * mpp; -+ uint16_t udev_flags; - - param = convert_dev(param, 0); - mpp = find_mp_by_alias(vecs->mpvec, param); - if (!mpp) - return 1; - -+ udev_flags = (mpp->skip_kpartx)? MPATH_UDEV_NO_KPARTX_FLAG : 0; - if (mpp->wait_for_udev) { - condlog(2, "%s: device not fully created, failing resume", - mpp->alias); - return 1; - } - -- r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param, 0); -+ r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param, udev_flags); - - condlog(2, "%s: resume (operator)", param); - -Index: multipath-tools-130222/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-130222.orig/multipath/multipath.conf.5 -+++ multipath-tools-130222/multipath/multipath.conf.5 -@@ -505,6 +505,12 @@ message. This warning message will print - .I missing_uev_msg_delay - seconds until the uevent is received. the default is - .I 30 -+.TP -+.B skip_kpartx -+If set to -+.I yes -+, kpartx will not automatically create partitions on the device. The default is -+.I no - . - .SH "blacklist section" - The -@@ -612,6 +618,8 @@ section: - .B delay_watch_checks - .TP - .B delay_wait_checks -+.TP -+.B skip_kpartx - .RE - .PD - .LP -@@ -708,6 +716,8 @@ section: - .B delay_watch_checks - .TP - .B delay_wait_checks -+.TP -+.B skip_kpartx - .RE - .PD - .LP diff --git a/0162-RHBZ-1333331-huawei-config.patch b/0162-RHBZ-1333331-huawei-config.patch deleted file mode 100644 index 7b97e07..0000000 --- a/0162-RHBZ-1333331-huawei-config.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - libmultipath/hwtable.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -Index: multipath-tools-130222/libmultipath/hwtable.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/hwtable.c -+++ multipath-tools-130222/libmultipath/hwtable.c -@@ -1182,6 +1182,15 @@ static struct hwentry default_hw[] = { - .dev_loss = 60, - .prio_args = NULL, - }, -+ { -+ .vendor = "HUAWEI", -+ .product = "XSG1", -+ .features = DEFAULT_FEATURES, -+ .hwhandler = DEFAULT_HWHANDLER, -+ .pgpolicy = MULTIBUS, -+ .pgfailback = -FAILBACK_IMMEDIATE, -+ .checker_name = TUR, -+ }, - /* - * EOL - */ diff --git a/0163-UPBZ-1333492-resize-map.patch b/0163-UPBZ-1333492-resize-map.patch deleted file mode 100644 index cc24b6f..0000000 --- a/0163-UPBZ-1333492-resize-map.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - multipathd/cli_handlers.c | 2 ++ - 1 file changed, 2 insertions(+) - -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -571,6 +571,7 @@ int resize_map(struct multipath *mpp, un - struct vectors * vecs) - { - char params[PARAMS_SIZE] = {0}; -+ unsigned long long orig_size = mpp->size; - - mpp->size = size; - update_mpp_paths(mpp, vecs->pathvec); -@@ -579,6 +580,7 @@ int resize_map(struct multipath *mpp, un - if (domap(mpp, params) <= 0) { - condlog(0, "%s: failed to resize map : %s", mpp->alias, - strerror(errno)); -+ mpp->size = orig_size; - return 1; - } - return 0; diff --git a/0164-RHBZ-1311463-dos-part-rollover.patch b/0164-RHBZ-1311463-dos-part-rollover.patch deleted file mode 100644 index dc511f2..0000000 --- a/0164-RHBZ-1311463-dos-part-rollover.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - kpartx/dos.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/kpartx/dos.c -=================================================================== ---- multipath-tools-130222.orig/kpartx/dos.c -+++ multipath-tools-130222/kpartx/dos.c -@@ -78,7 +78,7 @@ read_dos_pt(int fd, struct slice all, st - unsigned long offset = all.start; - int i, n=4; - unsigned char *bp; -- int sector_size_mul = get_sector_size(fd)/512; -+ uint64_t sector_size_mul = get_sector_size(fd)/512; - - bp = (unsigned char *)getblock(fd, offset); - if (bp == NULL) diff --git a/0165-UPBZ-1341748-MSA-2040-conf.patch b/0165-UPBZ-1341748-MSA-2040-conf.patch deleted file mode 100644 index 6c6e64a..0000000 --- a/0165-UPBZ-1341748-MSA-2040-conf.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- - libmultipath/hwtable.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -Index: multipath-tools-130222/libmultipath/hwtable.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/hwtable.c -+++ multipath-tools-130222/libmultipath/hwtable.c -@@ -175,6 +175,21 @@ static struct hwentry default_hw[] = { - .prio_name = PRIO_ALUA, - .prio_args = NULL, - }, -+ { -+ /* HP MSA 1040/2040 product family */ -+ .vendor = "HP", -+ .product = "MSA (1|2)040 SA(N|S)", -+ .features = DEFAULT_FEATURES, -+ .hwhandler = DEFAULT_HWHANDLER, -+ .pgpolicy = GROUP_BY_PRIO, -+ .pgfailback = -FAILBACK_IMMEDIATE, -+ .rr_weight = RR_WEIGHT_NONE, -+ .no_path_retry = 18, -+ .minio = 100, -+ .checker_name = TUR, -+ .prio_name = PRIO_ALUA, -+ .prio_args = NULL, -+ }, - - { - /* HP SVSP */ diff --git a/0166-RHBZ-1323429-dont-allow-new-wwid.patch b/0166-RHBZ-1323429-dont-allow-new-wwid.patch deleted file mode 100644 index b0fc664..0000000 --- a/0166-RHBZ-1323429-dont-allow-new-wwid.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - libmultipath/dmparser.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -Index: multipath-tools-130222/libmultipath/dmparser.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/dmparser.c -+++ multipath-tools-130222/libmultipath/dmparser.c -@@ -360,6 +360,15 @@ disassemble_map (vector pathvec, char * - else if (!strlen(pp->wwid)) - strncpy(pp->wwid, mpp->wwid, WWID_SIZE); - -+ /* -+ * Something went wrong. Likely the user changed the -+ * path uid_attribute after creating a device -+ */ -+ else if (strcmp(pp->wwid, mpp->wwid) != 0) { -+ condlog(0, "%s: path wwid appears to have changed. Using old wwid.\n", pp->dev_t); -+ strncpy(pp->wwid, mpp->wwid, WWID_SIZE); -+ } -+ - pgp->id ^= (long)pp; - pp->pgindex = i + 1; - diff --git a/0167-RHBZ-1335176-fix-show-cmds.patch b/0167-RHBZ-1335176-fix-show-cmds.patch deleted file mode 100644 index 55154b6..0000000 --- a/0167-RHBZ-1335176-fix-show-cmds.patch +++ /dev/null @@ -1,138 +0,0 @@ ---- - libmultipath/print.c | 7 +++++++ - libmultipath/structs.h | 1 + - libmultipath/structs_vec.c | 24 ++++++++++++++---------- - multipathd/cli_handlers.c | 11 ++++++++++- - multipathd/main.c | 2 ++ - 5 files changed, 34 insertions(+), 11 deletions(-) - -Index: multipath-tools-130222/libmultipath/print.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.c -+++ multipath-tools-130222/libmultipath/print.c -@@ -248,6 +248,12 @@ snprint_q_timeouts (char * buff, size_t - } - - static int -+snprint_map_failures (char * buff, size_t len, struct multipath * mpp) -+{ -+ return snprint_uint(buff, len, mpp->stat_map_failures); -+} -+ -+static int - snprint_multipath_uuid (char * buff, size_t len, struct multipath * mpp) - { - return snprint_str(buff, len, mpp->wwid); -@@ -546,6 +552,7 @@ struct multipath_data mpd[] = { - {'t', "dm-st", 0, snprint_dm_map_state}, - {'S', "size", 0, snprint_multipath_size}, - {'f', "features", 0, snprint_features}, -+ {'x', "failures", 0, snprint_map_failures}, - {'h', "hwhandler", 0, snprint_hwhandler}, - {'A', "action", 0, snprint_action}, - {'0', "path_faults", 0, snprint_path_faults}, -Index: multipath-tools-130222/libmultipath/structs.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs.h -+++ multipath-tools-130222/libmultipath/structs.h -@@ -270,6 +270,7 @@ struct multipath { - unsigned int stat_map_loads; - unsigned int stat_total_queueing_time; - unsigned int stat_queueing_timeouts; -+ unsigned int stat_map_failures; - - /* checkers shared data */ - void * mpcontext; -Index: multipath-tools-130222/libmultipath/structs_vec.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs_vec.c -+++ multipath-tools-130222/libmultipath/structs_vec.c -@@ -579,16 +579,20 @@ int update_multipath (struct vectors *ve - */ - void update_queue_mode_del_path(struct multipath *mpp) - { -- if (--mpp->nr_active == 0 && mpp->no_path_retry > 0) { -- /* -- * Enter retry mode. -- * meaning of +1: retry_tick may be decremented in -- * checkerloop before starting retry. -- */ -- mpp->stat_queueing_timeouts++; -- mpp->retry_tick = mpp->no_path_retry * conf->checkint + 1; -- condlog(1, "%s: Entering recovery mode: max_retries=%d", -- mpp->alias, mpp->no_path_retry); -+ if (--mpp->nr_active == 0) { -+ if (mpp->no_path_retry > 0) { -+ /* -+ * Enter retry mode. -+ * meaning of +1: retry_tick may be decremented in -+ * checkerloop before starting retry. -+ */ -+ mpp->stat_queueing_timeouts++; -+ mpp->retry_tick = mpp->no_path_retry * -+ conf->checkint + 1; -+ condlog(1, "%s: Entering recovery mode: max_retries=%d", -+ mpp->alias, mpp->no_path_retry); -+ } else if (mpp->no_path_retry != NO_PATH_RETRY_QUEUE) -+ mpp->stat_map_failures++; - } - condlog(2, "%s: remaining active paths: %d", mpp->alias, mpp->nr_active); - } -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -319,9 +319,14 @@ show_maps (char ** r, int *len, struct v - c += snprint_multipath_header(c, reply + maxlen - c, - style); - -- vector_foreach_slot(vecs->mpvec, mpp, i) -+ vector_foreach_slot(vecs->mpvec, mpp, i) { -+ if (update_multipath(vecs, mpp->alias, 0)) { -+ i--; -+ continue; -+ } - c += snprint_multipath(c, reply + maxlen - c, - style, mpp, pretty); -+ } - - again = ((c - reply) == (maxlen - 1)); - -@@ -742,6 +747,8 @@ cli_disable_queueing(void *v, char **rep - return 1; - } - -+ if (mpp->nr_active == 0) -+ mpp->stat_map_failures++; - mpp->retry_tick = 0; - dm_queue_if_no_path(mpp->alias, 0); - return 0; -@@ -756,6 +763,8 @@ cli_disable_all_queueing(void *v, char * - - condlog(2, "disable queueing (operator)"); - vector_foreach_slot(vecs->mpvec, mpp, i) { -+ if (mpp->nr_active == 0) -+ mpp->stat_map_failures++; - mpp->retry_tick = 0; - dm_queue_if_no_path(mpp->alias, 0); - } -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -716,6 +716,7 @@ ev_remove_path (struct path *pp, struct - mpp->retry_tick = 0; - mpp->no_path_retry = NO_PATH_RETRY_FAIL; - mpp->flush_on_last_del = FLUSH_IN_PROGRESS; -+ mpp->stat_map_failures++; - dm_queue_if_no_path(mpp->alias, 0); - } - if (!flush_map(mpp, vecs, 1)) { -@@ -1184,6 +1185,7 @@ retry_count_tick(vector mpvec) - mpp->stat_total_queueing_time++; - condlog(4, "%s: Retrying.. No active path", mpp->alias); - if(--mpp->retry_tick == 0) { -+ mpp->stat_map_failures++; - dm_queue_if_no_path(mpp->alias, 0); - condlog(2, "%s: Disable queueing", mpp->alias); - } diff --git a/0168-RHBZ-1347769-shared-lock.patch b/0168-RHBZ-1347769-shared-lock.patch deleted file mode 100644 index 084d112..0000000 --- a/0168-RHBZ-1347769-shared-lock.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- - libmultipath/configure.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/configure.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/configure.c -+++ multipath-tools-130222/libmultipath/configure.c -@@ -552,7 +552,7 @@ lock_multipath (struct multipath * mpp, - if (!pgp->paths) - continue; - vector_foreach_slot(pgp->paths, pp, j) { -- if (lock && flock(pp->fd, LOCK_EX | LOCK_NB) && -+ if (lock && flock(pp->fd, LOCK_SH | LOCK_NB) && - errno == EWOULDBLOCK) - goto fail; - else if (!lock) diff --git a/0169-UPBZ-1353357-json-output.patch b/0169-UPBZ-1353357-json-output.patch deleted file mode 100644 index 14fa840..0000000 --- a/0169-UPBZ-1353357-json-output.patch +++ /dev/null @@ -1,549 +0,0 @@ ---- - libmultipath/print.c | 222 ++++++++++++++++++++++++++++++++++++++++++++++ - libmultipath/print.h | 61 ++++++++++++ - multipathd/cli.c | 3 - multipathd/cli.h | 2 - multipathd/cli_handlers.c | 93 +++++++++++++++++++ - multipathd/cli_handlers.h | 2 - multipathd/main.c | 2 - multipathd/multipathd.8 | 9 + - 8 files changed, 393 insertions(+), 1 deletion(-) - -Index: multipath-tools-130222/libmultipath/print.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.c -+++ multipath-tools-130222/libmultipath/print.c -@@ -269,6 +269,61 @@ snprint_multipath_vpr (char * buff, size - pp->vendor_id, pp->product_id); - } - -+ -+static int -+snprint_multipath_vend (char * buff, size_t len, struct multipath * mpp) -+{ -+ struct pathgroup * pgp; -+ struct path * pp; -+ int i, j; -+ -+ vector_foreach_slot(mpp->pg, pgp, i) { -+ if (!pgp) -+ continue; -+ vector_foreach_slot(pgp->paths, pp, j) { -+ if (strlen(pp->vendor_id)) -+ return snprintf(buff, len, "%s", pp->vendor_id); -+ } -+ } -+ return snprintf(buff, len, "##"); -+} -+ -+static int -+snprint_multipath_prod (char * buff, size_t len, struct multipath * mpp) -+{ -+ struct pathgroup * pgp; -+ struct path * pp; -+ int i, j; -+ -+ vector_foreach_slot(mpp->pg, pgp, i) { -+ if (!pgp) -+ continue; -+ vector_foreach_slot(pgp->paths, pp, j) { -+ if (strlen(pp->product_id)) -+ return snprintf(buff, len, "%s", pp->product_id); -+ } -+ } -+ return snprintf(buff, len, "##"); -+} -+ -+static int -+snprint_multipath_rev (char * buff, size_t len, struct multipath * mpp) -+{ -+ struct pathgroup * pgp; -+ struct path * pp; -+ int i, j; -+ -+ vector_foreach_slot(mpp->pg, pgp, i) { -+ if (!pgp) -+ continue; -+ vector_foreach_slot(pgp->paths, pp, j) { -+ if (strlen(pp->rev)) -+ return snprintf(buff, len, "%s", pp->rev); -+ } -+ } -+ return snprintf(buff, len, "##"); -+} -+ - static int - snprint_action (char * buff, size_t len, struct multipath * mpp) - { -@@ -561,6 +616,9 @@ struct multipath_data mpd[] = { - {'3', "total_q_time", 0, snprint_total_q_time}, - {'4', "q_timeouts", 0, snprint_q_timeouts}, - {'s', "vend/prod/rev", 0, snprint_multipath_vpr}, -+ {'v', "vend", 0, snprint_multipath_vend}, -+ {'p', "prod", 0, snprint_multipath_prod}, -+ {'e', "rev", 0, snprint_multipath_rev}, - {0, NULL, 0 , NULL} - }; - -@@ -983,6 +1041,170 @@ snprint_multipath_topology (char * buff, - return fwd; - } - -+static int -+snprint_json (char * buff, int len, int indent, char *json_str) -+{ -+ int fwd = 0, i; -+ -+ for (i = 0; i < indent; i++) { -+ fwd += snprintf(buff + fwd, len - fwd, PRINT_JSON_INDENT); -+ if (fwd > len) -+ return fwd; -+ } -+ -+ fwd += snprintf(buff + fwd, len - fwd, "%s", json_str); -+ return fwd; -+} -+ -+static int -+snprint_json_header (char * buff, int len) -+{ -+ int fwd = 0; -+ -+ fwd += snprint_json(buff, len, 0, PRINT_JSON_START_ELEM); -+ if (fwd > len) -+ return fwd; -+ -+ fwd += snprintf(buff + fwd, len - fwd, PRINT_JSON_START_VERSION, -+ PRINT_JSON_MAJOR_VERSION, PRINT_JSON_MINOR_VERSION); -+ return fwd; -+} -+ -+static int -+snprint_json_elem_footer (char * buff, int len, int indent, int last) -+{ -+ int fwd = 0, i; -+ -+ for (i = 0; i < indent; i++) { -+ fwd += snprintf(buff + fwd, len - fwd, PRINT_JSON_INDENT); -+ if (fwd > len) -+ return fwd; -+ } -+ -+ if (last == 1) -+ fwd += snprintf(buff + fwd, len - fwd, "%s", PRINT_JSON_END_LAST_ELEM); -+ else -+ fwd += snprintf(buff + fwd, len - fwd, "%s", PRINT_JSON_END_ELEM); -+ return fwd; -+} -+ -+static int -+snprint_multipath_fields_json (char * buff, int len, -+ struct multipath * mpp, int last) -+{ -+ int i, j, fwd = 0; -+ struct path *pp; -+ struct pathgroup *pgp; -+ -+ fwd += snprint_multipath(buff, len, PRINT_JSON_MAP, mpp, 0); -+ if (fwd > len) -+ return fwd; -+ -+ fwd += snprint_json(buff + fwd, len - fwd, 2, PRINT_JSON_START_GROUPS); -+ if (fwd > len) -+ return fwd; -+ -+ vector_foreach_slot (mpp->pg, pgp, i) { -+ -+ pgp->selector = mpp->selector; -+ fwd += snprint_pathgroup(buff + fwd, len - fwd, PRINT_JSON_GROUP, pgp); -+ if (fwd > len) -+ return fwd; -+ -+ fwd += snprintf(buff + fwd, len - fwd, PRINT_JSON_GROUP_NUM, i + 1); -+ if (fwd > len) -+ return fwd; -+ -+ fwd += snprint_json(buff + fwd, len - fwd, 3, PRINT_JSON_START_PATHS); -+ if (fwd > len) -+ return fwd; -+ -+ vector_foreach_slot (pgp->paths, pp, j) { -+ fwd += snprint_path(buff + fwd, len - fwd, PRINT_JSON_PATH, pp, 0); -+ if (fwd > len) -+ return fwd; -+ -+ fwd += snprint_json_elem_footer(buff + fwd, -+ len - fwd, 3, j + 1 == VECTOR_SIZE(pgp->paths)); -+ if (fwd > len) -+ return fwd; -+ } -+ fwd += snprint_json(buff + fwd, len - fwd, 0, PRINT_JSON_END_ARRAY); -+ if (fwd > len) -+ return fwd; -+ -+ fwd += snprint_json_elem_footer(buff + fwd, -+ len - fwd, 2, i + 1 == VECTOR_SIZE(mpp->pg)); -+ if (fwd > len) -+ return fwd; -+ } -+ -+ fwd += snprint_json(buff + fwd, len - fwd, 0, PRINT_JSON_END_ARRAY); -+ if (fwd > len) -+ return fwd; -+ -+ fwd += snprint_json_elem_footer(buff + fwd, len - fwd, 1, last); -+ return fwd; -+} -+ -+int -+snprint_multipath_map_json (char * buff, int len, -+ struct multipath * mpp, int last){ -+ int fwd = 0; -+ -+ fwd += snprint_json_header(buff, len); -+ if (fwd > len) -+ return len; -+ -+ fwd += snprint_json(buff + fwd, len - fwd, 0, PRINT_JSON_START_MAP); -+ if (fwd > len) -+ return len; -+ -+ fwd += snprint_multipath_fields_json(buff + fwd, len - fwd, mpp, 1); -+ if (fwd > len) -+ return len; -+ -+ fwd += snprint_json(buff + fwd, len - fwd, 0, "\n"); -+ if (fwd > len) -+ return len; -+ -+ fwd += snprint_json(buff + fwd, len - fwd, 0, PRINT_JSON_END_LAST); -+ if (fwd > len) -+ return len; -+ return fwd; -+} -+ -+int -+snprint_multipath_topology_json (char * buff, int len, struct vectors * vecs) -+{ -+ int i, fwd = 0; -+ struct multipath * mpp; -+ -+ fwd += snprint_json_header(buff, len); -+ if (fwd > len) -+ return len; -+ -+ fwd += snprint_json(buff + fwd, len - fwd, 1, PRINT_JSON_START_MAPS); -+ if (fwd > len) -+ return len; -+ -+ vector_foreach_slot(vecs->mpvec, mpp, i) { -+ fwd += snprint_multipath_fields_json(buff + fwd, len - fwd, -+ mpp, i + 1 == VECTOR_SIZE(vecs->mpvec)); -+ if (fwd > len) -+ return len; -+ } -+ -+ fwd += snprint_json(buff + fwd, len - fwd, 0, PRINT_JSON_END_ARRAY); -+ if (fwd > len) -+ return len; -+ -+ fwd += snprint_json(buff + fwd, len - fwd, 0, PRINT_JSON_END_LAST); -+ if (fwd > len) -+ return len; -+ return fwd; -+} -+ - static int - snprint_hwentry (char * buff, int len, struct hwentry * hwe) - { -Index: multipath-tools-130222/libmultipath/print.h -=================================================================== ---- multipath-tools-130222.orig/libmultipath/print.h -+++ multipath-tools-130222/libmultipath/print.h -@@ -7,6 +7,63 @@ - #define PRINT_MAP_PROPS "size=%S features='%f' hwhandler='%h' wp=%r" - #define PRINT_PG_INDENT "policy='%s' prio=%p status=%t" - -+#define PRINT_JSON_MULTIPLIER 5 -+#define PRINT_JSON_MAJOR_VERSION 0 -+#define PRINT_JSON_MINOR_VERSION 1 -+#define PRINT_JSON_START_VERSION " \"major_version\": %d,\n" \ -+ " \"minor_version\": %d,\n" -+#define PRINT_JSON_START_ELEM "{\n" -+#define PRINT_JSON_START_MAP " \"map\":" -+#define PRINT_JSON_START_MAPS "\"maps\": [" -+#define PRINT_JSON_START_PATHS "\"paths\": [" -+#define PRINT_JSON_START_GROUPS "\"path_groups\": [" -+#define PRINT_JSON_END_ELEM "}," -+#define PRINT_JSON_END_LAST_ELEM "}" -+#define PRINT_JSON_END_LAST "}\n" -+#define PRINT_JSON_END_ARRAY "]\n" -+#define PRINT_JSON_INDENT " " -+#define PRINT_JSON_MAP "{\n" \ -+ " \"name\" : \"%n\",\n" \ -+ " \"uuid\" : \"%w\",\n" \ -+ " \"sysfs\" : \"%d\",\n" \ -+ " \"failback\" : \"%F\",\n" \ -+ " \"queueing\" : \"%Q\",\n" \ -+ " \"paths\" : %N,\n" \ -+ " \"write_prot\" : \"%r\",\n" \ -+ " \"dm_st\" : \"%t\",\n" \ -+ " \"features\" : \"%f\",\n" \ -+ " \"hwhandler\" : \"%h\",\n" \ -+ " \"action\" : \"%A\",\n" \ -+ " \"path_faults\" : %0,\n" \ -+ " \"vend\" : \"%v\",\n" \ -+ " \"prod\" : \"%p\",\n" \ -+ " \"rev\" : \"%e\",\n" \ -+ " \"switch_grp\" : %1,\n" \ -+ " \"map_loads\" : %2,\n" \ -+ " \"total_q_time\" : %3,\n" \ -+ " \"q_timeouts\" : %4," -+ -+#define PRINT_JSON_GROUP "{\n" \ -+ " \"selector\" : \"%s\",\n" \ -+ " \"pri\" : %p,\n" \ -+ " \"dm_st\" : \"%t\"," -+ -+#define PRINT_JSON_GROUP_NUM " \"group\" : %d,\n" -+ -+#define PRINT_JSON_PATH "{\n" \ -+ " \"dev\" : \"%d\",\n"\ -+ " \"dev_t\" : \"%D\",\n" \ -+ " \"dm_st\" : \"%t\",\n" \ -+ " \"dev_st\" : \"%o\",\n" \ -+ " \"chk_st\" : \"%T\",\n" \ -+ " \"checker\" : \"%c\",\n" \ -+ " \"pri\" : %p,\n" \ -+ " \"host_wwnn\" : \"%N\",\n" \ -+ " \"target_wwnn\" : \"%n\",\n" \ -+ " \"host_wwpn\" : \"%R\",\n" \ -+ " \"target_wwpn\" : \"%r\",\n" \ -+ " \"host_adapter\" : \"%a\"" -+ - #define MAX_LINE_LEN 80 - #define MAX_LINES 64 - #define MAX_FIELD_LEN 64 -@@ -41,6 +98,10 @@ int snprint_path (char *, int, char *, s - int snprint_multipath (char *, int, char *, struct multipath *, int); - int snprint_multipath_topology (char *, int, struct multipath * mpp, - int verbosity); -+int snprint_multipath_topology_json (char * buff, int len, -+ struct vectors * vecs); -+int snprint_multipath_map_json (char * buff, int len, -+ struct multipath * mpp, int last); - int snprint_defaults (char *, int); - int snprint_blacklist (char *, int); - int snprint_blacklist_except (char *, int); -Index: multipath-tools-130222/multipathd/cli.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli.c -+++ multipath-tools-130222/multipathd/cli.c -@@ -189,6 +189,7 @@ load_keys (void) - r += add_key(keys, "setprstatus", SETPRSTATUS, 0); - r += add_key(keys, "unsetprstatus", UNSETPRSTATUS, 0); - r += add_key(keys, "format", FMT, 1); -+ r += add_key(keys, "json", JSON, 0); - - if (r) { - free_keys(keys); -@@ -473,8 +474,10 @@ cli_init (void) { - add_handler(LIST+MAPS+FMT, NULL); - add_handler(LIST+MAPS+RAW+FMT, NULL); - add_handler(LIST+MAPS+TOPOLOGY, NULL); -+ add_handler(LIST+MAPS+JSON, NULL); - add_handler(LIST+TOPOLOGY, NULL); - add_handler(LIST+MAP+TOPOLOGY, NULL); -+ add_handler(LIST+MAP+JSON, NULL); - add_handler(LIST+CONFIG, NULL); - add_handler(LIST+BLACKLIST, NULL); - add_handler(LIST+DEVICES, NULL); -Index: multipath-tools-130222/multipathd/cli.h -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli.h -+++ multipath-tools-130222/multipathd/cli.h -@@ -36,6 +36,7 @@ enum { - __SETPRSTATUS, - __UNSETPRSTATUS, - __FMT, -+ __JSON, - }; - - #define LIST (1 << __LIST) -@@ -74,6 +75,7 @@ enum { - #define SETPRSTATUS (1ULL << __SETPRSTATUS) - #define UNSETPRSTATUS (1ULL << __UNSETPRSTATUS) - #define FMT (1ULL << __FMT) -+#define JSON (1ULL << __JSON) - - #define INITIAL_REPLY_LEN 1200 - -Index: multipath-tools-130222/multipathd/cli_handlers.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.c -+++ multipath-tools-130222/multipathd/cli_handlers.c -@@ -127,6 +127,70 @@ show_maps_topology (char ** r, int * len - } - - int -+show_maps_json (char ** r, int * len, struct vectors * vecs) -+{ -+ int i; -+ struct multipath * mpp; -+ char * c; -+ char * reply; -+ unsigned int maxlen = INITIAL_REPLY_LEN * -+ PRINT_JSON_MULTIPLIER * VECTOR_SIZE(vecs->mpvec); -+ int again = 1; -+ -+ vector_foreach_slot(vecs->mpvec, mpp, i) { -+ if (update_multipath(vecs, mpp->alias, 0)) { -+ return 1; -+ } -+ } -+ -+ reply = MALLOC(maxlen); -+ -+ while (again) { -+ if (!reply) -+ return 1; -+ -+ c = reply; -+ -+ c += snprint_multipath_topology_json(c, maxlen, vecs); -+ again = ((c - reply) == maxlen); -+ -+ REALLOC_REPLY(reply, again, maxlen); -+ } -+ *r = reply; -+ *len = (int)(c - reply); -+ return 0; -+} -+ -+int -+show_map_json (char ** r, int * len, struct multipath * mpp, -+ struct vectors * vecs) -+{ -+ char * c; -+ char * reply; -+ unsigned int maxlen = INITIAL_REPLY_LEN; -+ int again = 1; -+ -+ if (update_multipath(vecs, mpp->alias, 0)) -+ return 1; -+ reply = MALLOC(maxlen); -+ -+ while (again) { -+ if (!reply) -+ return 1; -+ -+ c = reply; -+ -+ c += snprint_multipath_map_json(c, maxlen, mpp, 1); -+ again = ((c - reply) == maxlen); -+ -+ REALLOC_REPLY(reply, again, maxlen); -+ } -+ *r = reply; -+ *len = (int)(c - reply); -+ return 0; -+} -+ -+int - show_config (char ** r, int * len) - { - char * c; -@@ -239,6 +303,35 @@ cli_list_maps_topology (void * v, char * - } - - int -+cli_list_map_json (void * v, char ** reply, int * len, void * data) -+{ -+ struct multipath * mpp; -+ struct vectors * vecs = (struct vectors *)data; -+ char * param = get_keyparam(v, MAP); -+ -+ param = convert_dev(param, 0); -+ get_path_layout(vecs->pathvec, 0); -+ mpp = find_mp_by_str(vecs->mpvec, param); -+ -+ if (!mpp) -+ return 1; -+ -+ condlog(3, "list multipath json %s (operator)", param); -+ -+ return show_map_json(reply, len, mpp, vecs); -+} -+ -+int -+cli_list_maps_json (void * v, char ** reply, int * len, void * data) -+{ -+ struct vectors * vecs = (struct vectors *)data; -+ -+ condlog(3, "list multipaths json (operator)"); -+ -+ return show_maps_json(reply, len, vecs); -+} -+ -+int - cli_list_wildcards (void * v, char ** reply, int * len, void * data) - { - char * c; -Index: multipath-tools-130222/multipathd/cli_handlers.h -=================================================================== ---- multipath-tools-130222.orig/multipathd/cli_handlers.h -+++ multipath-tools-130222/multipathd/cli_handlers.h -@@ -10,6 +10,8 @@ int cli_list_maps_status (void * v, char - int cli_list_maps_stats (void * v, char ** reply, int * len, void * data); - int cli_list_map_topology (void * v, char ** reply, int * len, void * data); - int cli_list_maps_topology (void * v, char ** reply, int * len, void * data); -+int cli_list_map_json (void * v, char ** reply, int * len, void * data); -+int cli_list_maps_json (void * v, char ** reply, int * len, void * data); - int cli_list_config (void * v, char ** reply, int * len, void * data); - int cli_list_blacklist (void * v, char ** reply, int * len, void * data); - int cli_list_devices (void * v, char ** reply, int * len, void * data); -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -981,7 +981,9 @@ uxlsnrloop (void * ap) - set_handler_callback(LIST+MAPS+RAW+FMT, cli_list_maps_raw); - set_handler_callback(LIST+MAPS+TOPOLOGY, cli_list_maps_topology); - set_handler_callback(LIST+TOPOLOGY, cli_list_maps_topology); -+ set_handler_callback(LIST+MAPS+JSON, cli_list_maps_json); - set_handler_callback(LIST+MAP+TOPOLOGY, cli_list_map_topology); -+ set_handler_callback(LIST+MAP+JSON, cli_list_map_json); - set_handler_callback(LIST+CONFIG, cli_list_config); - set_handler_callback(LIST+BLACKLIST, cli_list_blacklist); - set_handler_callback(LIST+DEVICES, cli_list_devices); -Index: multipath-tools-130222/multipathd/multipathd.8 -=================================================================== ---- multipath-tools-130222.orig/multipathd/multipathd.8 -+++ multipath-tools-130222/multipathd/multipathd.8 -@@ -53,11 +53,15 @@ using a format string with multipath for - Show the status of all multipath devices that the multipathd is monitoring. - .TP - .B list|show maps|multipaths stats --Show some statistics of all multipath devices that the multipathd is monitoring. -+Show some statistics of all multipath devices that multipathd is monitoring. - .TP - .B list|show maps|multipaths topology - Show the current multipath topology. Same as "multipath \-ll". - .TP -+.B list|show maps|multipaths json -+Show the multipath devices that multipathd is monitoring, using JSON -+formatted output. -+.TP - .B list|show topology - Show the current multipath topology. Same as "multipath \-ll". - .TP -@@ -65,6 +69,9 @@ Show the current multipath topology. Sam - Show topology of a single multipath device specified by $map, e.g. 36005076303ffc56200000000000010aa. - This map could be obtained from "list maps". - .TP -+.B list|show map|multipath $map json -+Show a single multipath device specified by $map, using JSON formatted output. -+.TP - .B list|show wildcards - Show the format wildcards used in interactive commands taking $format - .TP diff --git a/0170-UPBZ-1352925-fix-typo.patch b/0170-UPBZ-1352925-fix-typo.patch deleted file mode 100644 index 2521c3d..0000000 --- a/0170-UPBZ-1352925-fix-typo.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- - multipath/main.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -Index: multipath-tools-130222/multipath/main.c -=================================================================== ---- multipath-tools-130222.orig/multipath/main.c -+++ multipath-tools-130222/multipath/main.c -@@ -286,7 +286,7 @@ configure (void) - if (failed == 2 && conf->cmd == CMD_VALID_PATH) - printf("%s is not a valid multipath device path\n", conf->dev); - else -- condlog(3, "scope is nul"); -+ condlog(3, "scope is null"); - goto out; - } - if (conf->cmd == CMD_REMOVE_WWID) { -@@ -358,7 +358,7 @@ configure (void) - - - if (conf->cmd == CMD_VALID_PATH) { -- /* This only happens if find_multipaths is and -+ /* This only happens if find_multipaths and - * ignore_wwids is set. - * If there is currently a multipath device matching - * the refwwid, or there is more than one path matching diff --git a/0171-UPBZ-1356651-allow-zero-size.patch b/0171-UPBZ-1356651-allow-zero-size.patch deleted file mode 100644 index 0fe05b5..0000000 --- a/0171-UPBZ-1356651-allow-zero-size.patch +++ /dev/null @@ -1,79 +0,0 @@ ---- - libmultipath/discovery.c | 5 +++++ - libmultipath/structs_vec.c | 2 +- - multipathd/main.c | 26 +++++--------------------- - 3 files changed, 11 insertions(+), 22 deletions(-) - -Index: multipath-tools-130222/libmultipath/discovery.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/discovery.c -+++ multipath-tools-130222/libmultipath/discovery.c -@@ -1188,6 +1188,11 @@ pathinfo (struct path *pp, vector hwtabl - if (pp->state == PATH_UNCHECKED || - pp->state == PATH_WILD) - goto blank; -+ if (pp->state == PATH_UP && !pp->size) { -+ condlog(3, "%s: device size is 0, " -+ "path unuseable", pp->dev); -+ pp->state = PATH_GHOST; -+ } - } else { - condlog(3, "%s: path inaccessible", pp->dev); - pp->chkrstate = pp->state = path_state; -Index: multipath-tools-130222/libmultipath/structs_vec.c -=================================================================== ---- multipath-tools-130222.orig/libmultipath/structs_vec.c -+++ multipath-tools-130222/libmultipath/structs_vec.c -@@ -551,7 +551,7 @@ int update_multipath (struct vectors *ve - - if (pp->state != PATH_DOWN) { - int oldstate = pp->state; -- condlog(2, "%s: mark as failed", pp->dev_t); -+ condlog(2, "%s: mark as failed", pp->dev); - mpp->stat_path_failures++; - pp->state = PATH_DOWN; - if (oldstate == PATH_UP || -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -538,15 +538,10 @@ ev_add_path (struct path * pp, struct ve - pp->mpp = mpp; - rescan: - if (mpp) { -- if ((!pp->size) || (mpp->size != pp->size)) { -- if (!pp->size) -- condlog(0, "%s: failed to add new path %s, " -- "device size is 0", -- mpp->alias, pp->dev); -- else -- condlog(0, "%s: failed to add new path %s, " -- "device size mismatch", -- mpp->alias, pp->dev); -+ if (pp->size && mpp->size != pp->size) { -+ condlog(0, "%s: failed to add new path %s, " -+ "device size mismatch", -+ mpp->alias, pp->dev); - int i = find_slot(vecs->pathvec, (void *)pp); - if (i != -1) - vector_del_slot(vecs->pathvec, i); -@@ -563,18 +558,7 @@ rescan: - verify_paths(mpp, vecs, NULL); - mpp->flush_on_last_del = FLUSH_UNDEF; - mpp->action = ACT_RELOAD; -- } -- else { -- if (!pp->size) { -- condlog(0, "%s: failed to create new map," -- " device size is 0 ", pp->dev); -- int i = find_slot(vecs->pathvec, (void *)pp); -- if (i != -1) -- vector_del_slot(vecs->pathvec, i); -- free_path(pp); -- return 1; -- } -- -+ } else { - if (!should_multipath(pp, vecs->pathvec)) { - orphan_path(pp); - return 0; diff --git a/0172-RHBZ-1350931-no-active-add.patch b/0172-RHBZ-1350931-no-active-add.patch deleted file mode 100644 index 4e79e32..0000000 --- a/0172-RHBZ-1350931-no-active-add.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- - multipathd/main.c | 15 +++++++++++---- - 1 file changed, 11 insertions(+), 4 deletions(-) - -Index: multipath-tools-130222/multipathd/main.c -=================================================================== ---- multipath-tools-130222.orig/multipathd/main.c -+++ multipath-tools-130222/multipathd/main.c -@@ -530,9 +530,15 @@ ev_add_path (struct path * pp, struct ve - } - mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid); - if (mpp && mpp->wait_for_udev) { -- mpp->wait_for_udev = 2; -- orphan_path(pp); -- return 0; -+ if (pathcount(mpp, PATH_UP) == 0 && -+ (pathcount(mpp, PATH_GHOST) == 0 || -+ pp->tpgs == TPGS_IMPLICIT)) -+ mpp->force_udev_reload = 1; -+ else { -+ mpp->wait_for_udev = 2; -+ orphan_path(pp); -+ return 0; -+ } - } - - pp->mpp = mpp; -@@ -551,7 +557,8 @@ rescan: - - condlog(4,"%s: adopting all paths for path %s", - mpp->alias, pp->dev); -- mpp->force_udev_reload = !pathcount(mpp, PATH_WILD); -+ if (pathcount(mpp, PATH_WILD) == 0) -+ mpp->force_udev_reload = 1; - if (adopt_paths(vecs->pathvec, mpp, 1)) - goto fail; /* leave path added to pathvec */ - diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 6a4b517..5d80d4e 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,202 +1,60 @@ +Name: device-mapper-multipath +Version: 0.13.0 +Release: 2%{?dist} Summary: Tools to manage multipath devices using device-mapper -Name: device-mapper-multipath -Version: 0.4.9 -Release: 83%{?dist} -License: GPL+ -Group: System Environment/Base -URL: http://christophe.varoqui.free.fr/ +# readline uses GPL-3.0-only +License: GPL-2.0-only AND GPL-3.0-only +URL: http://christophe.varoqui.free.fr/ -Source0: multipath-tools-130222.tgz +# The source for this package was pulled from upstream's git repo. Use the +# following command to generate the tarball +# curl -L https://github.com/opensvc/multipath-tools/archive/0.13.0.tar.gz -o multipath-tools-0.13.0.tgz +Source0: multipath-tools-0.13.0.tgz Source1: multipath.conf -Patch0001: 0001-RH-dont_start_with_no_config.patch -Patch0002: 0002-RH-multipath.rules.patch -Patch0003: 0003-RH-Make-build-system-RH-Fedora-friendly.patch -Patch0004: 0004-RH-multipathd-blacklist-all-by-default.patch -Patch0005: 0005-RH-add-mpathconf.patch -Patch0006: 0006-RH-add-find-multipaths.patch -Patch0007: 0007-RH-add-hp_tur-checker.patch -Patch0008: 0008-RH-revert-partition-changes.patch -Patch0009: 0009-RH-RHEL5-style-partitions.patch -Patch0010: 0010-RH-dont-remove-map-on-enomem.patch -Patch0011: 0011-RH-deprecate-uid-gid-mode.patch -Patch0012: 0012-RH-kpartx-msg.patch -Patch0013: 0013-RHBZ-883981-cleanup-rpmdiff-issues.patch -Patch0014: 0014-RH-handle-other-sector-sizes.patch -Patch0015: 0015-RH-fix-output-buffer.patch -Patch0016: 0016-RH-dont-print-ghost-messages.patch -#Patch0017: 0017-RH-fix-sigusr1.patch -Patch0018: 0018-RH-fix-factorize.patch -Patch0019: 0019-RH-fix-sockets.patch -Patch0020: 0020-RHBZ-907360-static-pthread-init.patch -Patch0021: 0021-RHBZ-919119-respect-kernel-cmdline.patch -Patch0022: 0022-RH-multipathd-check-wwids.patch -Patch0023: 0023-RH-multipath-wipe-wwid.patch -Patch0024: 0024-RH-multipath-wipe-wwids.patch -Patch0025: 0025-UPBZ-916668_add_maj_min.patch -Patch0026: 0026-fix-checker-time.patch -Patch0027: 0027-RH-get-wwid.patch -Patch0028: 0028-RHBZ-929078-refresh-udev-dev.patch -Patch0029: 0029-RH-no-prio-put-msg.patch -Patch0030: 0030-RHBZ-916528-override-queue-no-daemon.patch -Patch0031: 0031-RHBZ-957188-kpartx-use-dm-name.patch -Patch0032: 0032-RHBZ-956464-mpathconf-defaults.patch -Patch0033: 0033-RHBZ-829963-e-series-conf.patch -Patch0034: 0034-RHBZ-851416-mpathconf-display.patch -Patch0035: 0035-RHBZ-891921-list-mpp.patch -Patch0036: 0036-RHBZ-949239-load-multipath-module.patch -Patch0037: 0037-RHBZ-768873-fix-rename.patch -Patch0038: 0038-RHBZ-799860-netapp-config.patch -Patch0039: 0039-RH-detect-prio-fix.patch -Patch0040: 0040-RH-bindings-fix.patch -Patch0041: 0041-RH-check-for-erofs.patch -Patch0042: 0042-UP-fix-signal-handling.patch -Patch0043: 0043-RH-signal-waiter.patch -Patch0044: 0044-RHBZ-976688-fix-wipe-wwids.patch -Patch0045: 0045-RHBZ-977297-man-page-fix.patch -Patch0046: 0046-RHBZ-883981-move-udev-rules.patch -Patch0047: 0047-RHBZ-980777-kpartx-read-only-loop-devs.patch -Patch0048: 0048-RH-print-defaults.patch -Patch0049: 0049-RH-remove-ID_FS_TYPE.patch -Patch0050: 0050-RH-listing-speedup.patch -Patch0051: 0051-UP-fix-cli-resize.patch -Patch0052: 0052-RH-fix-bad-derefs.patch -Patch0053: 0053-UP-fix-failback.patch -Patch0054: 0054-UP-keep-udev-ref.patch -Patch0055: 0055-UP-handle-quiesced-paths.patch -Patch0056: 0056-UP-alua-prio-fix.patch -Patch0057: 0057-UP-fix-tmo.patch -Patch0058: 0058-UP-fix-failback.patch -Patch0059: 0059-UP-flush-failure-queueing.patch -Patch0060: 0060-UP-uevent-loop-udev.patch -Patch0061: 0061-RH-display-find-mpaths.patch -Patch0062: 0062-RH-dont-free-vecs.patch -Patch0063: 0063-RH-fix-warning.patch -Patch0064: 0064-fix-ID_FS-attrs.patch -Patch0065: 0065-UPBZ-995538-fail-rdac-on-unavailable.patch -Patch0066: 0066-UP-dos-4k-partition-fix.patch -Patch0067: 0067-RHBZ-1022899-fix-udev-partition-handling.patch -Patch0068: 0068-RHBZ-1034578-label-partition-devices.patch -Patch0069: 0069-UPBZ-1033791-improve-rdac-checker.patch -Patch0070: 0070-RHBZ-1036503-blacklist-td-devs.patch -Patch0071: 0071-RHBZ-1031546-strip-dev.patch -Patch0072: 0072-RHBZ-1039199-check-loop-control.patch -Patch0073: 0073-RH-update-build-flags.patch -Patch0074: 0074-RHBZ-1056976-dm-mpath-rules.patch -Patch0075: 0075-RHBZ-1056976-reload-flag.patch -Patch0076: 0076-RHBZ-1056686-add-hw_str_match.patch -#Patch0077: -Patch0078: 0078-RHBZ-1054044-fix-mpathconf-manpage.patch -Patch0079: 0079-RHBZ-1070581-add-wwid-option.patch -Patch0080: 0080-RHBZ-1075796-cmdline-wwid.patch -Patch0081: 0081-RHBZ-1066264-check-prefix-on-rename.patch -Patch0082: 0082-UPBZ-1109995-no-sync-turs-on-pthread_cancel.patch -Patch0083: 0083-RHBZ-1080055-orphan-paths-on-reload.patch -Patch0084: 0084-RHBZ-1110000-multipath-man.patch -Patch0085: 0085-UPBZ-1110006-datacore-config.patch -Patch0086: 0086-RHBZ-1110007-orphan-path-on-failed-add.patch -Patch0087: 0087-RHBZ-1110013-config-error-checking.patch -Patch0088: 0088-RHBZ-1069811-configurable-prio-timeout.patch -Patch0089: 0089-RHBZ-1110016-add-noasync-option.patch -Patch0090: 0090-UPBZ-1080038-reorder-paths-for-round-robin.patch -Patch0091: 0091-RHBZ-1069584-fix-empty-values-fast-io-fail-and-dev-loss.patch -Patch0092: 0092-UPBZ-1104605-reload-on-rename.patch -Patch0093: 0093-UPBZ-1086825-user-friendly-name-remap.patch -Patch0094: 0094-RHBZ-1086825-cleanup-remap.patch -Patch0095: 0095-RHBZ-1127944-xtremIO-config.patch -Patch0096: 0096-RHBZ-979474-new-wildcards.patch -Patch0097: 0097-RH-fix-coverity-errors.patch -Patch0098: 0098-UPBZ-1067171-mutipath-i.patch -Patch0099: 0099-RH-add-all-devs.patch -Patch0100: 0100-RHBZ-1067171-multipath-i-update.patch -Patch0101: 0101-RH-adapter-name-wildcard.patch -Patch0102: 0102-RHBZ-1160478-mpathconf-template.patch -Patch0103: 0103-RH-cleanup-partmaps-code.patch -Patch0104: 0104-RHBZ-631009-deferred-remove.patch -Patch0105: 0105-RHBZ-1148979-fix-partition-mapping-creation-race-with-kpartx.patch -Patch0106: 0106-RHBZ-1159337-fix-double-free.patch -Patch0107: 0107-RHBZ-1169935-no-new-devs.patch -Patch0108: 0108-RHBZ-1153832-kpartx-remove-devs.patch -Patch0109: 0109-RH-read-only-bindings.patch -Patch0110: 0110-RHBZ-blacklist-vd-devs.patch -Patch0111: 0111-RH-dont-show-pg-timeout.patch -Patch0112: 0112-RHBZ-1194917-add-config_dir-option.patch -Patch0113: 0113-RHBZ-1194917-cleanup.patch -Patch0114: 0114-RHBZ-1196394-delayed-reintegration.patch -Patch0115: 0115-RHBZ-1198418-fix-double-free.patch -Patch0116: 0116-UPBZ-1188179-dell-36xxi.patch -Patch0117: 0117-RHBZ-1198424-autodetect-clariion-alua.patch -Patch0118: 0118-UPBZ-1200738-update-eternus-config.patch -Patch0119: 0119-RHBZ-1081397-save-alua-info.patch -Patch0120: 0120-RHBZ-1043093-realloc-fix.patch -Patch0121: 0121-RHBZ-1197234-rules-fix.patch -Patch0122: 0122-RHBZ-1212590-dont-use-var.patch -Patch0123: 0123-UPBZ-1166072-fix-path-offline.patch -Patch0124: 0124-RHBZ-1209275-retrigger-uevents.patch -Patch0125: 0125-RHBZ-1153832-kpartx-delete.patch -Patch0126: 0126-RHBZ-1211383-alias-collision.patch -Patch0127: 0127-RHBZ-1201030-use-blk-availability.patch -Patch0128: 0128-RHBZ-1222123-mpathconf-allow.patch -Patch0129: 0129-RHBZ-1241774-sun-partition-numbering.patch -Patch0130: 0130-UPBZ-1254292-iscsi-targetname.patch -Patch0131: 0131-RHBZ-1259523-host_name_len.patch -Patch0132: 0132-UPBZ-1259831-lock-retry.patch -Patch0133: 0133-RHBZ-1296979-fix-define.patch -Patch0134: 0134-RHBZ-1241528-check-mpath-prefix.patch -Patch0135: 0135-RHBZ-1299600-path-dev-uevents.patch -Patch0136: 0136-RHBZ-1304687-wait-for-map-add.patch -Patch0137: 0137-RHBZ-1280524-clear-chkr-msg.patch -Patch0138: 0138-RHBZ-1288660-fix-mpathconf-allow.patch -Patch0139: 0139-RHBZ-1273173-queue-no-daemon-doc.patch -Patch0140: 0140-RHBZ-1299647-fix-help.patch -Patch0141: 0141-RHBZ-1303953-mpathpersist-typo.patch -Patch0142: 0142-RHBZ-1283750-kpartx-fix.patch -Patch0143: 0143-RHBZ-1299648-kpartx-sync.patch -Patch0144: 0144-RHBZ-1299652-alua-pref-arg.patch -Patch0145: 0145-UP-resize-help-msg.patch -Patch0146: 0146-UPBZ-1299651-raw-output.patch -Patch0147: 0147-RHBZ-1272620-fail-rm-msg.patch -Patch0148: 0148-RHBZ-1292599-verify-before-remove.patch -Patch0149: 0149-RHBZ-1292599-restore-removed-parts.patch -Patch0150: 0150-RHBZ-1253913-fix-startup-msg.patch -Patch0151: 0151-RHBZ-1297456-weighted-fix.patch -Patch0152: 0152-RHBZ-1269293-fix-blk-unit-file.patch -Patch0153: 0153-RH-fix-i686-size-bug.patch -Patch0154: 0154-UPBZ-1291406-disable-reinstate.patch -Patch0155: 0155-UPBZ-1300415-PURE-config.patch -Patch0156: 0156-UPBZ-1313324-dont-fail-discovery.patch -Patch0157: 0157-RHBZ-1319853-multipath-c-error-msg.patch -Patch0158: 0158-RHBZ-1318581-timestamp-doc-fix.patch -Patch0159: 0159-UPBZ-1255885-udev-waits.patch -Patch0160: 0160-RH-udev-flags.patch -Patch0161: 0161-RHBZ-1311659-no-kpartx.patch -Patch0162: 0162-RHBZ-1333331-huawei-config.patch -Patch0163: 0163-UPBZ-1333492-resize-map.patch -Patch0164: 0164-RHBZ-1311463-dos-part-rollover.patch -Patch0165: 0165-UPBZ-1341748-MSA-2040-conf.patch -Patch0166: 0166-RHBZ-1323429-dont-allow-new-wwid.patch -Patch0167: 0167-RHBZ-1335176-fix-show-cmds.patch -Patch0168: 0168-RHBZ-1347769-shared-lock.patch -Patch0169: 0169-UPBZ-1353357-json-output.patch -Patch0170: 0170-UPBZ-1352925-fix-typo.patch -Patch0171: 0171-UPBZ-1356651-allow-zero-size.patch -Patch0172: 0172-RHBZ-1350931-no-active-add.patch +Patch0001: 0001-RH-fixup-udev-rules-for-redhat.patch +Patch0002: 0002-RH-Remove-the-property-blacklist-exception-builtin.patch +Patch0003: 0003-RH-don-t-start-without-a-config-file.patch +Patch0004: 0004-RH-Fix-nvme-function-missing-argument.patch +Patch0005: 0005-RH-use-rpm-optflags-if-present.patch +Patch0006: 0006-RH-add-mpathconf.patch +Patch0007: 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +Patch0008: 0008-RH-reset-default-find_mutipaths-value-to-off.patch +Patch0009: 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch +Patch0010: 0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch +Patch0011: 0011-RH-add-scsi-device-handlers-to-modules-load.d.patch +Patch0012: 0012-RH-compile-with-libreadline-support.patch +Patch0013: 0013-RH-Add-mpathcleanup.patch # runtime Requires: %{name}-libs = %{version}-%{release} Requires: kpartx = %{version}-%{release} Requires: device-mapper >= 1.02.96 -Requires: initscripts -Requires(post): systemd-units systemd-sysv chkconfig +Requires: userspace-rcu +Requires: readline +Requires: libmount +Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units +# Starting with 0.7.7-1, 62-multipath.rules changed in a way that is +# incompatible with 65-md-incremental.rules in earlier mdadm packages. +# Later mdadm packages are compatible with any version of +# device-mapper-multipath. See bz #1628192 for more details +Conflicts: mdadm < 4.1-rc2.0.2 +# Starting with 0.7.7-1, 62-multipath.rules changed in a way that is +# incompatible with 80-udisks2.rules in earlier udisks2 packages. +# Later udisks2 packages are compatible with any version of +# device-mapper-multipath. See bz #1628192 for more details +Conflicts: udisks2 < 2.8.0-2 # build/setup -BuildRequires: libaio-devel, device-mapper-devel >= 1.02.82-2 +BuildRequires: libaio-devel, device-mapper-devel >= 1.02.89 BuildRequires: libselinux-devel, libsepol-devel BuildRequires: readline-devel, ncurses-devel BuildRequires: systemd-units, systemd-devel - -BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +BuildRequires: json-c-devel, perl-interpreter, pkgconfig, gcc +BuildRequires: userspace-rcu-devel +BuildRequires: libmount-devel +BuildRequires: make %description %{name} provides tools to manage multipath devices by @@ -207,234 +65,78 @@ The tools are : %package libs Summary: The %{name} modules and shared library -License: GPL+ -Group: System Environment/Libraries +# only libmpathcmd is LGPL-2.1-or-later AND LGPL-2.0-or-later +License: GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later %description libs The %{name}-libs provides the path checker -and prioritizer modules. It also contains the multipath shared library, +and prioritizer modules. It also contains the libmpathpersist and +libmpathcmd shared libraries, as well as multipath's internal library, libmultipath. -%if 0%{?fedora} < 23 -%package sysvinit -Summary: SysV init script for device-mapper-multipath -Group: System Environment/Libraries +%package devel +Summary: Development libraries and headers for %{name} +Requires: %{name} = %{version}-%{release} +Requires: %{name}-libs = %{version}-%{release} -%description sysvinit -SysV style init script for device-mapper-multipth. It needs to be -installed only if systemd is not used as the system init process. -%endif +%description devel +This package contains the files need to develop applications that use +device-mapper-multipath's lbmpathpersist and libmpathcmd libraries. %package -n kpartx Summary: Partition device manager for device-mapper devices -Group: System Environment/Base %description -n kpartx kpartx manages partition creation and removal for device-mapper devices. +%package -n libdmmp +Summary: device-mapper-multipath C API library +# Automatically converted from old format: GPLv3+ - review is highly recommended. +License: GPL-3.0-or-later +Requires: json-c +Requires: %{name} = %{version}-%{release} +Requires: %{name}-libs = %{version}-%{release} + +%description -n libdmmp +This package contains the shared library for the device-mapper-multipath +C API library. + +%package -n libdmmp-devel +Summary: device-mapper-multipath C API library headers +Requires: pkgconfig +Requires: libdmmp = %{version}-%{release} + +%description -n libdmmp-devel +This package contains the files needed to develop applications that use +device-mapper-multipath's libdmmp C API library + %prep -%setup -q -n multipath-tools-130222 -%patch0001 -p1 -%patch0002 -p1 -%patch0003 -p1 -%patch0004 -p1 -%patch0005 -p1 -%patch0006 -p1 -%patch0007 -p1 -%patch0008 -p1 -%patch0009 -p1 -%patch0010 -p1 -%patch0011 -p1 -%patch0012 -p1 -%patch0013 -p1 -%patch0014 -p1 -%patch0015 -p1 -%patch0016 -p1 -# %%patch0017 -p1 -%patch0018 -p1 -%patch0019 -p1 -%patch0020 -p1 -%patch0021 -p1 -%patch0022 -p1 -%patch0023 -p1 -%patch0024 -p1 -%patch0025 -p1 -%patch0026 -p1 -%patch0027 -p1 -%patch0028 -p1 -%patch0029 -p1 -%patch0030 -p1 -%patch0031 -p1 -%patch0032 -p1 -%patch0033 -p1 -%patch0034 -p1 -%patch0035 -p1 -%patch0036 -p1 -%patch0037 -p1 -%patch0038 -p1 -%patch0039 -p1 -%patch0040 -p1 -%patch0041 -p1 -%patch0042 -p1 -%patch0043 -p1 -%patch0044 -p1 -%patch0045 -p1 -%patch0046 -p1 -%patch0047 -p1 -%patch0048 -p1 -%patch0049 -p1 -%patch0050 -p1 -%patch0051 -p1 -%patch0052 -p1 -%patch0053 -p1 -%patch0054 -p1 -%patch0055 -p1 -%patch0056 -p1 -%patch0057 -p1 -%patch0058 -p1 -%patch0059 -p1 -%patch0060 -p1 -%patch0061 -p1 -%patch0062 -p1 -%patch0063 -p1 -%patch0064 -p1 -%patch0065 -p1 -%patch0066 -p1 -%patch0067 -p1 -%patch0068 -p1 -%patch0069 -p1 -%patch0070 -p1 -%patch0071 -p1 -%patch0072 -p1 -%patch0073 -p1 -%patch0074 -p1 -%patch0075 -p1 -%patch0076 -p1 -%patch0078 -p1 -%patch0079 -p1 -%patch0080 -p1 -%patch0081 -p1 -%patch0082 -p1 -%patch0083 -p1 -%patch0084 -p1 -%patch0085 -p1 -%patch0086 -p1 -%patch0087 -p1 -%patch0088 -p1 -%patch0089 -p1 -%patch0090 -p1 -%patch0091 -p1 -%patch0092 -p1 -%patch0093 -p1 -%patch0094 -p1 -%patch0095 -p1 -%patch0096 -p1 -%patch0097 -p1 -%patch0098 -p1 -%patch0099 -p1 -%patch0100 -p1 -%patch0101 -p1 -%patch0102 -p1 -%patch0103 -p1 -%patch0104 -p1 -%patch0105 -p1 -%patch0106 -p1 -%patch0107 -p1 -%patch0108 -p1 -%patch0109 -p1 -%patch0110 -p1 -%patch0111 -p1 -%patch0112 -p1 -%patch0113 -p1 -%patch0114 -p1 -%patch0115 -p1 -%patch0116 -p1 -%patch0117 -p1 -%patch0118 -p1 -%patch0119 -p1 -%patch0120 -p1 -%patch0121 -p1 -%patch0122 -p1 -%patch0123 -p1 -%patch0124 -p1 -%patch0125 -p1 -%patch0126 -p1 -%patch0127 -p1 -%patch0128 -p1 -%patch0129 -p1 -%patch0130 -p1 -%patch0131 -p1 -%patch0132 -p1 -%patch0133 -p1 -%patch0134 -p1 -%patch0135 -p1 -%patch0136 -p1 -%patch0137 -p1 -%patch0138 -p1 -%patch0139 -p1 -%patch0140 -p1 -%patch0141 -p1 -%patch0142 -p1 -%patch0143 -p1 -%patch0144 -p1 -%patch0145 -p1 -%patch0146 -p1 -%patch0147 -p1 -%patch0148 -p1 -%patch0149 -p1 -%patch0150 -p1 -%patch0151 -p1 -%patch0152 -p1 -%patch0153 -p1 -%patch0154 -p1 -%patch0155 -p1 -%patch0156 -p1 -%patch0157 -p1 -%patch0158 -p1 -%patch0159 -p1 -%patch0160 -p1 -%patch0161 -p1 -%patch0162 -p1 -%patch0163 -p1 -%patch0164 -p1 -%patch0165 -p1 -%patch0166 -p1 -%patch0167 -p1 -%patch0168 -p1 -%patch0169 -p1 -%patch0170 -p1 -%patch0171 -p1 -%patch0172 -p1 +%autosetup -n multipath-tools-0.13.0 -p1 cp %{SOURCE1} . %build -%define _sbindir /usr/sbin %define _libdir /usr/%{_lib} %define _libmpathdir %{_libdir}/multipath -make %{?_smp_mflags} LIB=%{_lib} +%define _pkgconfdir %{_libdir}/pkgconfig +%make_build LIB=%{_lib} %install -rm -rf %{buildroot} - -make install \ - DESTDIR=%{buildroot} \ +%make_install \ bindir=%{_sbindir} \ syslibdir=%{_libdir} \ - libdir=%{_libmpathdir} \ - rcdir=%{_initrddir} \ - unitdir=%{_unitdir} + usrlibdir=%{_libdir} \ + plugindir=%{_libmpathdir} \ + mandir=%{_mandir} \ + unitdir=%{_unitdir} \ + includedir=%{_includedir} \ + pkgconfdir=%{_pkgconfdir} \ + tmpfilesdir=%{_tmpfilesdir} # tree fix up install -d %{buildroot}/etc/multipath - -%if 0%{?fedora} >= 23 rm -rf %{buildroot}/%{_initrddir} -%endif -%clean -rm -rf %{buildroot} - %post %systemd_post multipathd.service @@ -443,7 +145,7 @@ rm -rf %{buildroot} %postun if [ $1 -ge 1 ] ; then - /sbin/multipathd forcequeueing daemon > /dev/null 2>&1 || : + multipathd forcequeueing daemon > /dev/null 2>&1 || : fi %systemd_postun_with_restart multipathd.service @@ -452,60 +154,986 @@ fi # section in multipathd.service from multi-user.target to sysinit.target /bin/systemctl --quiet is-enabled multipathd.service >/dev/null 2>&1 && /bin/systemctl reenable multipathd.service ||: -%if 0%{?fedora} < 23 -%triggerpostun -n %{name}-sysvinit -- %{name} < 0.4.9-16 -/sbin/chkconfig --add mdmonitor >/dev/null 2>&1 || : -%endif - %files -%defattr(-,root,root,-) +%license LICENSES/GPL-2.0 LICENSES/LGPL-2.0 LICENSES/GPL-3.0 %{_sbindir}/multipath %{_sbindir}/multipathd +%{_sbindir}/multipathc %{_sbindir}/mpathconf +%{_sbindir}/mpathcleanup %{_sbindir}/mpathpersist %{_unitdir}/multipathd.service -%{_mandir}/man3/mpath_persistent_reserve_in.3.gz -%{_mandir}/man3/mpath_persistent_reserve_out.3.gz -%{_mandir}/man5/multipath.conf.5.gz -%{_mandir}/man8/multipath.8.gz -%{_mandir}/man8/multipathd.8.gz -%{_mandir}/man8/mpathconf.8.gz -%{_mandir}/man8/mpathpersist.8.gz +%{_unitdir}/multipathd-queueing.service +%{_unitdir}/multipathd.socket +%{_mandir}/man5/multipath.conf.5* +%{_mandir}/man8/multipath.8* +%{_mandir}/man8/multipathd.8* +%{_mandir}/man8/multipathc.8* +%{_mandir}/man8/mpathconf.8* +%{_mandir}/man8/mpathpersist.8* %config /usr/lib/udev/rules.d/62-multipath.rules %config /usr/lib/udev/rules.d/11-dm-mpath.rules -%{!?_licensedir:%global license %%doc} -%license COPYING -%doc AUTHOR FAQ +%config /usr/lib/udev/rules.d/99-z-dm-mpath-late.rules +%dir %{_modulesloaddir} +%{_modulesloaddir}/scsi_dh.conf +%{_tmpfilesdir}/multipath.conf +%doc README.md %doc multipath.conf %dir /etc/multipath %files libs -%defattr(-,root,root,-) -%doc AUTHOR -%{!?_licensedir:%global license %%doc} -%license COPYING +%license LICENSES/GPL-2.0 LICENSES/LGPL-2.0 LICENSES/LGPL-2.1 +%doc README.md %{_libdir}/libmultipath.so %{_libdir}/libmultipath.so.* -%{_libdir}/libmpathpersist.so +%{_libdir}/libmpathutil.so +%{_libdir}/libmpathutil.so.* %{_libdir}/libmpathpersist.so.* +%{_libdir}/libmpathcmd.so.* +%{_libdir}/libmpathvalid.so.* %dir %{_libmpathdir} %{_libmpathdir}/* -%post libs -p /sbin/ldconfig +%ldconfig_scriptlets libs -%postun libs -p /sbin/ldconfig - -%if 0%{?fedora} < 23 -%files sysvinit -%{_initrddir}/multipathd -%endif +%files devel +%doc README.md +%{_libdir}/libmpathpersist.so +%{_libdir}/libmpathcmd.so +%{_libdir}/libmpathvalid.so +%{_includedir}/mpath_cmd.h +%{_includedir}/mpath_persist.h +%{_includedir}/mpath_valid.h +%{_mandir}/man3/mpath_persistent_reserve_in.3* +%{_mandir}/man3/mpath_persistent_reserve_out.3* %files -n kpartx -%defattr(-,root,root,-) +%license LICENSES/GPL-2.0 +%doc README.md %{_sbindir}/kpartx -%{_mandir}/man8/kpartx.8.gz +/usr/lib/udev/kpartx_id +%{_mandir}/man8/kpartx.8* +%config /usr/lib/udev/rules.d/11-dm-parts.rules +%config /usr/lib/udev/rules.d/66-kpartx.rules +%config /usr/lib/udev/rules.d/68-del-part-nodes.rules + +%files -n libdmmp +%license LICENSES/GPL-3.0 +%doc README.md +%{_libdir}/libdmmp.so.* + +%ldconfig_scriptlets -n libdmmp + +%files -n libdmmp-devel +%doc README.md +%{_libdir}/libdmmp.so +%dir %{_includedir}/libdmmp +%{_includedir}/libdmmp/* +%{_mandir}/man3/dmmp_* +%{_mandir}/man3/libdmmp.h.3* +%{_pkgconfdir}/libdmmp.pc %changelog +* Thu Nov 13 2025 Benjamin Marzinski - 0.13.0-2 +- Move STI tests to TMT + +* Tue Nov 4 2025 Benjamin Marzinski - 0.13.0-1 +- Update source to upstream release 0.13.0 + * Previous patches 0001-0004 are included in the tarball +- Install /lib/systemd/system/multipathd-queueing.service +- Rename redhat patches + * Previous patches 0005-0017 are now patches 0001-0013 + +* Wed Jul 23 2025 Fedora Release Engineering - 0.11.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Thu Feb 27 2025 Benjamin Marzinski - 0.11.1-1 +- Update source to upstream staging branch for 0.11.1 plus additional + stable branch patches. + * Previous patches 0001-0032 are included in the tarball +- Rename redhat patches + * Previous patches 0033-0045 are now patches 0005-0017 + +* Sat Feb 1 2025 Benjamin Marzinski - 0.10.0-5 +- Update source to upstream staging branch for 0.10.y (will be 0.10.2 when + merged). +- Rebase redhat patches + +* Thu Jan 16 2025 Fedora Release Engineering - 0.10.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Sun Jan 12 2025 Zbigniew JÄ™drzejewski-Szmek - 0.10.0-3 +- Rebuilt for the bin-sbin merge (2nd attempt) + +* Thu Aug 29 2024 Benjamin Marzinski - 0.10.0-2 +- update CI tests. + +* Thu Aug 29 2024 Benjamin Marzinski - 0.10.0-1 +- Update source to upstream version 0.9.9 + * Previous patch 0014-multipathd-fix-flush-check-in-flush_map.patch is + included in the source tarball +- Rebase redhat patches + +* Fri Aug 9 2024 Benjamin Marzinski - 0.9.9-6 +- Add 0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch + * multipath features tracking on failed removes + +* Mon Jul 29 2024 Miroslav Suchý - 0.9.9-5 +- convert license to SPDX + +* Thu Jul 25 2024 Miroslav Suchý - 0.9.9-4 +- convert license to SPDX + +* Wed Jul 17 2024 Fedora Release Engineering - 0.9.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Tue Jul 09 2024 Zbigniew JÄ™drzejewski-Szmek - 0.9.9-2 +- Rebuilt for the bin-sbin merge + +* Thu Jun 13 2024 Benjamin Marzinski - 0.9.9-1 +- Update source to upstream version 0.9.9 + * Previous patches 0001-0044 are included in the source tarball +- Rename redhat patches + * Previous patches 0045-0057 are now patches 0001-0013 + +* Mon May 20 2024 Benjamin Marzinski - 0.9.8-1 +- Update source to upstream version 0.9.8 plus latest staging branch + * Previous patches 0014 & 0015 are included in the source tarball + * patches 0001-0044 are from the upstream staging branch +- Rename redhat patches + * Previous patches 0001-0013 are now patches 0045-0057 +- Install /lib/udev/rules.d/99-z-dm-mpath-late.rules + +* Wed Jan 24 2024 Fedora Release Engineering - 0.9.7-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 0.9.7-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Tue Jan 16 2024 Benjamin Marzinski - 0.9.7-5 +- Add 0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch + * Fix auto_resize code to avoid a segfault +- Add 0015-multipathd-fix-auto-resize-configuration.patch + * Fix auto_resize default value + +* Thu Nov 30 2023 Benjamin Marzinski - 0.9.7-4 +- Use modulesloaddir macro for installing scsi_dh.conf + +* Wed Nov 29 2023 Benjamin Marzinski - 0.9.7-3 +- Fix multipath_conf_syntax test +- Fix restate_module test + +* Tue Nov 28 2023 Paul Donohue - 0.9.7-2 +- Modify 0006-RH-add-mpathconf.patch +- Modify 0008-RH-reset-default-find_mutipaths-value-to-off.patch + * Fix find_multipaths values in docs and mpathconf + +* Tue Nov 21 2023 Benjamin Marzinski - 0.9.7-1 +- Update source to upstream version 0.9.7 + * Previous patches 0001-0040 are included in the source tarball +- Rename redhat patches + * Previous patches 0041-0053 are now patches 0001-0013 +- Remove /usr/lib/modules-load.d/multipath.conf + * has been replaced with modprobe@dm_multipath.service unit Wants. + +* Fri Sep 22 2023 Benjamin Marzinski - 0.9.6-1 +- Update to the head of the upstream staging branch +- Rename redhat patches + * Previous patches 0001-0012 are now patches 0041-0052 +- Add 0053-RH-Add-mpathcleanup.patch + * add mpathcleanup program + +* Wed Jul 19 2023 Fedora Release Engineering - 0.9.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue May 16 2023 Benjamin Marzinski - 0.9.5-1 +- Update to the latest upstream release + * Previous patches 0001-0015 are included in the source tarball +- Rename redhat patches + * Previous patches 0016-0027 are now patches 0001-0012 + +* Thu Feb 2 2023 Benjamin Marzinski - 0.9.4-2 +- Update to the head of the upstream staging branch + * Patches 0011-0015 are from the upstream staging branch +- Rename redhat patches + * Previous patches 0011-0022 are now patches 0016-0027 + +* Thu Jan 26 2023 Benjamin Marzinski - 0.9.4-1 +- Update to the head of the upstream staging branch + * Previous patches 0001-0032 are included in the source tarball + * Patches 0001-0010 are from the upstream staging branch +- Rename redhat patches + * Previous patches 0033-0044 are now patches 0011-0022 +- Add dependency on libmount + +* Thu Jan 19 2023 Fedora Release Engineering - 0.9.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Nov 15 2022 Benjamin Marzinski - 0.9.3-1 +- Update to the head of the upstream staging branch + * Previous patches 0001-0042 are included in the source tarball + * Patches 0001-0032 are from the upstream staging branch +- Rename redhat patches + * Previous patches 0043-0053 are now patches 0033-0043 +- Change back to using readline instead of libedit + * The code the uses readline has been isolated from the code that + is licensed gpl v2 only. +- Add libmpathutil libraries to spec file +- Add multipathc program to spec file +- Add multipath.conf systemd tempfile configuration to spec file +- Misc spec file cleanups + +* Fri Aug 19 2022 Benjamin Marzinski - 0.9.0-3 +- Update to the head of the upstream staging branch + * Patches 0005-0042 are from the upstream staging branch + * Previous patches 0005 & 0006 are now patches 0023 & 0005 +- Rename redhat patches + * Previous patches 0007-0017 are now patches 0043-0053 +- Change from using readline to libedit + * readline is licensed GPL v3, and multipathd includes code + licensed gpl v2. +- Remove README.alua + * information moved to README.md + +* Thu Jul 21 2022 Fedora Release Engineering - 0.9.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jul 13 2022 Benjamin Marzinski - 0.9.0-1 +- Update source to upstream version 0.9.0 + * Previous patches 0001-0005 are included in the commit. + * This version deprecates multiple options: mutlipath_dir, config_dir, and + getuid_callout, along with the "default_" prefixed alternate names for the + default section parameters. +- Add patches from upstream staging branch + * Patches 0001-0006 are from the upstream staging branch +- Rename redhat patches + * Previous patches 0006-0016 are now patches 0007-0017 + +* Mon Mar 28 2022 Benjamin Marzinski - 0.8.9-1 +- Update source to upstream version 0.8.9 + * Previous patches 0001-0024 & 0035 are included in the commit. +- Add patches from upstream staging branch + * Patches 0001-0005 are from the upstream staging branch +- Rename redhat patches + * Previous patches 0025-0034 are now patches 0006-0015 +- Combine redhat patches + * Previous patches 0036 & 0037 are now part of patch 0011 +- Add 0016-RH-add-scsi-device-handlers-to-modules-load.d.patch +- Spec file changes + * Install multipath.conf and scsi_dh.conf to /usr/lib/modules-load.d + +* Mon Feb 7 2022 Benjamin Marzinski - 0.8.7-8 +- Add 0036-RH-add-support-to-mpathconf-for-setting-arbitrary-de.patch + * add the ability for mpathconf to set arbitray options with --option +- Add 0037-RH-add-support-to-mpathconf-for-setting-recheck_wwid.patch + * add --recheck_wwid option to mpathconf + +* Wed Jan 26 2022 Benjamin Marzinski - 0.8.7-7 +- Add 0035-libmultipath-use-asprintf-to-allocate-prefixed_uuid.patch +- Resolves: bz #2045309 + +* Thu Jan 20 2022 Fedora Release Engineering - 0.8.7-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jan 6 2022 Benjamin Marzinski - 0.8.7-5 +- Modify 0030-RH-add-mpathconf.patch + * fix setting property_blacklist with no blacklist_exceptions section + +* Mon Dec 13 2021 Benjamin Marzinski - 0.8.7-4 +- Update to the head of the upstream staging branch + * Patches 0013 - 0024 are from the upstream staging branch +- Rename redhat patches + * Previous patches 0013-0022 are now patches 0025-0034 + +* Thu Oct 28 2021 Benjamin Marzinski - 0.8.7-3 +- Update to the head of the upstream staging branch + * Patches 0011 & 0012 are from the upstream staging branch +- Rename redhat patches + * Previous patches 0011-0020 are now patches 0013-0022 + +* Wed Oct 6 2021 Benjamin Marzinski - 0.8.7-2 +- Modify 0013-RH-don-t-start-without-a-config-file.patch + * add condtion to multipathd.socket as well + +* Wed Oct 6 2021 Benjamin Marzinski - 0.8.7-1 +- Update source to upstream version 0.8.7 + * Previous patches 0001-0023 are included in the commit. +- Add patches from upstream staging branch + * Patches 0001-0010 are from the upstream staging branch +- Rename redhat patches + * Previous patches 0024-0033 are now patches 0011-0020 + +* Fri Jul 30 2021 Benjamin Marzinski - 0.8.6-5 +- Update to the head of the upstream staging branch plus redhat patches + * Patches 0016-0018 are from the upstream staging branch + * Patches 0019-0024 have been submitted upstream +- Rename files + * Previous patches 0016-0025 are now patches 0024-0033 + +* Wed Jul 21 2021 Fedora Release Engineering - 0.8.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Sat Jul 10 2021 Björn Esser - 0.8.6-3 +- Rebuild for versioned symbols in json-c + +* Thu Jul 1 2021 Benjamin Marzinski - 0.8.6-2 +- Pull in latest upstream post-tag commits + * Patches 0001-0015 are from + https://github.com/openSUSE/multipath-tools/tree/queue and are + already queued for upstream +- Rename files + * Previous patches 0001-0010 and now patches 0016-0025 + +* Wed Jun 23 2021 Cole Robinson - 0.8.6-1.fc35.1 +- Rebuild for userspace-rcu soname bump + +* Mon Apr 5 2021 Benjamin Marzinski - 0.8.6-1 +- Update Source to upstream version 0.8.6 + * Previous patches 0001-0146 are included in the commit +- Rename files + * Previous patches 0147-0156 are now patches 0001-0010 +- sync tests with RHEL repository + +* Fri Mar 26 2021 Benjamin Marzinski - 0.8.5-6 +- Change patch format to remove Git version + * Patches 0001-0122 only have the patch format modified +- Update to the head of the upstream staging branch plus redhat patches + * Patches 0123-0134 & 1036-0142 are from the upstream staging branch + * Patches 0143-1046 have been submitted upstream + * Patch 0156 is a Red Hat only patch. Red Hat udev rules set ID_SERIAL + from 60-persistent-storage.rules instead of 55-scsi-sg3_id.rules. + Multipath's parse_vpd_pg83() function needs to match the ID_SERIAL + value from udev. +- Rename files + * Previous patches 0123-0132 are now patches 1035 & 0147-0155 + +* Tue Mar 02 2021 Zbigniew JÄ™drzejewski-Szmek - 0.8.5-5 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. + +* Thu Feb 11 2021 Benjamin Marzinski - 0.8.5-4 +- Update Source to upstream version 0.8.5 plus post tag commits + * Patches 0001-0121 are from + https://github.com/openSUSE/multipath-tools/tree/queue and are + already queued for upstream + * Patches 0122&0123 have been posted for upstream inclusion +- Rename files + * Previous patches 0103-0111 are now patches 0124-0132 + +* Tue Jan 26 2021 Fedora Release Engineering - 0.8.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jan 19 2021 Benjamin Marzinski - 0.8.5-2 +- Fix build issues + +* Tue Jan 19 2021 Benjamin Marzinski - 0.8.5-1 +- Update Source to upstream version 0.8.5 plus post tag commits + * Patches 0001-0102 are from + https://github.com/openSUSE/multipath-tools/tree/queue and are + already queued for upstream. +- Rename files + * Previous patches 0059-0068 are now patches 0103-0111 + + +* Sun Sep 27 2020 Benjamin Marzinski - 0.8.4-7 +- Add 0073-libmultipath-util-constify-function-arguments.patch +- Add 0074-libmultipath-constify-file-argument-in-config-parser.patch +- Add 0075-libmultipath-provide-defaults-for-get-put-_multipath.patch +- Add 0076-libmpathpersist-allow-using-libmultipath-get-put-_mu.patch +- Add 0077-multipath-use-get_put-_multipath_config-from-libmult.patch +- Add 0078-mpathpersist-use-get-put-_multipath_config-from-libm.patch +- Add 0079-libmultipath-add-udev-and-logsink-symbols.patch +- Add 0080-multipath-remove-logsink-and-udev.patch +- Add 0081-libmpathpersist-call-libmultipath_-init-exit.patch +- Add 0082-mpathpersist-remove-logsink-and-udev.patch +- Add 0083-multipathd-remove-logsink-and-udev.patch + * Pull in upsteam library changes +- Add 0084-libmpathvalid-use-default-_multipath_config-udev-and.patch +- Add 0085-Revert-libmultipath-add-ignore_udev_uid-option.patch +- Add 0086-libmultipath-change-log-level-for-null-uid_attribute.patch +- Add 0087-libmultipath-orphan_paths-avoid-BUG-message.patch + * update libmpathvalid to use upstream library changes. changes + submitted upstream + +* Mon Jul 27 2020 Fedora Release Engineering - 0.8.4-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jul 21 2020 Benjamin Marzinski - 0.8.4-5 +- Update CI tests to match RHEL + * This commit also pulls in changes from Lin Li + and Bruno Goncalves + +* Tue Jul 21 2020 Benjamin Marzinski - 0.8.4-4 +- Rebased on top of additional commits staged for upstream + * Previous patches 0048-0060 are now patches 0053-0054 & 0059-0069 +- Add 0048-libmultipath-add-device-to-hwtable.c.patch +- Add 0049-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch +- Add 0050-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch +- Add 0051-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch +- Add 0052-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch +- Add 0055-libmultipath-remove-code-duplication-in-path-countin.patch +- Add 0056-libmultipath-count-pending-paths-as-active-on-loads.patch +- Add 0057-libmultipath-deal-with-flushing-no-maps.patch +- Add 0058-multipath-deal-with-delegation-failures-correctly.patch +- Add 0070-multipath-add-libmpathvalid-library.patch + * adds the libmpathvalid.so library to determine if devices are + valid multipath paths. +- Add 0071-libmultipath-add-uid-failback-for-dasd-devices.patch +- Add 0072-libmultipath-add-ignore_udev_uid-option.patch + +* Mon Jul 13 2020 Tom Stellard - 0.8.4-3 +- Use make macros +- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + +* Wed Jul 8 2020 Benjamin Marzinski - 0.8.4-2 +- Rebased on top of Martin Wilck's queue of ACKed upstream commits + * https://github.com/openSUSE/multipath-tools/tree/upstream-queue + * All previous patches have been reordered, with the exception of + 0011-libdmmp-Add-support-for-upcoming-json-c-0.14.0.patch + which has been replaced with + 0029-fix-boolean-value-with-json-c-0.14.patch +- Modify 0054-RH-add-mpathconf.patch + * remove default enable_foreign and property blacklist_exceptions + settings, and deal with the builtin default change from + 0031-libmultipath-set-enable_foreign-to-NONE-by-default.patch. + Fixes bz #1853668 +- Add 0048-Makefile.inc-trim-extra-information-from-systemd-ver.patch +- Add 0049-kpartx-fix-Wsign-compare-error.patch + * The above two patches have been submitted upstream + +* Fri May 29 2020 Benjamin Marzinski - 0.8.4-1 +- Update Source to upstream version 0.8.4 + * Previoud patches 0001-0020 & 0031 are included in this commit +- Rename files + * Previous patches 0021-0032 are now patches 0012-0022 +- Add 0001-libmultipath-assign-variable-to-make-gcc-happy.patch +- Add 0002-libmutipath-don-t-close-fd-on-dm_lib_release.patch +- Add 0003-libmultipath-allow-force-reload-with-no-active-paths.patch +- Add 0004-libmpathpersist-depend-on-libmultipath.patch +- Add 0005-multipath-tools-Makefile-more-dependency-fixes-for-p.patch +- Add 0006-multipath-tools-Makefile.inc-set-Wno-error-clobbered.patch +- Add 0007-libmultipath-discovery.c-use-z-qualifier-for-size_t.patch +- Add 0008-libmultipath-eliminate-more-signed-unsigned-comparis.patch +- Add 0009-libmultipath-set_uint-fix-parsing-for-32bit.patch +- Add 0010-multipath-tools-Makefile-add-install-dependency.patch +- Add 0012-libmultipath-fix-condlog-NULL-argument-in-uevent_get.patch +- Add 0023-RH-work-around-gcc-10-format-truncation-issue.patch + * The above 10 patches have been submitted upstream + +* Tue Apr 21 2020 Björn Esser - 0.8.2-6 +- Rebuild (json-c) + +* Mon Apr 13 2020 Björn Esser - 0.8.2-5 +- Add 0032-add-support-for-upcoming-json-c-0.14.0.patch + +* Mon Apr 13 2020 Björn Esser - 0.8.2-4 +- Fix macro escaping in %%changelog + +* Wed Feb 12 2020 Benjamin Marzinski - 0.8.2-3 +- Add 0031-multipath-fix-issues-found-by-compiling-with-gcc-10.patch + * Patch submitted upstream +- Resolves bz #1799276 + +* Tue Jan 28 2020 Fedora Release Engineering - 0.8.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Sep 11 2019 Benjamin Marzinski - 0.8.2-1 +- Update Source to upstream version 0.8.2 + * Previoud patches 0001-0017 & 0027 are included in this commit +- Rename files + * Previous patches 0018-0026 & 0028 are not patches 0021-0030 +- Add 0001-libmultipath-make-vector_foreach_slot_backwards-work.patch +- Add 0002-libmultipath-add-marginal-paths-and-groups-infrastru.patch +- Add 0003-tests-add-path-grouping-policy-unit-tests.patch +- Add 0004-libmultipath-add-wrapper-function-around-pgpolicyfn.patch +- Add 0005-tests-update-pgpolicy-tests-to-work-with-group_paths.patch +- Add 0006-libmultipath-fix-double-free-in-pgpolicyfn-error-pat.patch +- Add 0007-libmultipath-consolidate-group_by_-functions.patch +- Add 0008-libmultipath-make-pgpolicyfn-take-a-paths-vector.patch +- Add 0009-libmultipath-make-group_paths-handle-marginal-paths.patch +- Add 0010-tests-add-tests-for-grouping-marginal-paths.patch +- Add 0011-libmultipath-add-marginal_pathgroups-config-option.patch +- Add 0012-libmutipath-deprecate-delay_-_checks.patch +- Add 0013-multipathd-use-marginal_pathgroups.patch +- Add 0014-multipath-update-man-pages.patch + * The above 13 patches add the marinal_pathgroups option +- Add 0015-multipath.conf-add-enable_foreign-parameter.patch +- Add 0016-multipath.conf.5-document-foreign-library-support.patch + * The above 2 patches add the enable_foreign option +- Add 0017-mpathpersist-remove-broken-unused-code.patch +- Add 0018-libmultipath-EMC-PowerMax-NVMe-device-config.patch +- Add 0019-mpathpersist-fix-leaks.patch +- Add 0020-libmultipath-fix-mpcontext-initialization.patch + * The above 20 patches have been submitted upstream + +* Wed Jul 24 2019 Fedora Release Engineering - 0.8.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Apr 12 2019 Benjamin Marzinski - 0.8.0-2 +- Add 0028-RH-attempt-to-get-ANA-info-via-sysfs-first.patch + * try to get ANA state from sysfs first, with the ioctl as a fallback + +* Thu Apr 4 2019 Benjamin Marzinski - 0.8.0-1 +- Update Source to upstream version 0.8.0 + * Previous patches 0006 & 0007 are included in this commit +- Rename files + * Previous patches 0008-0016 & 0100 are now patches 0018-0027 +- Add 0006-multipathd-Fix-miscounting-active-paths.patch +- Add 0007-multipathd-ignore-failed-wwid-recheck.patch + * multipathd will no longer disable paths if it is unable to + get their wwid on a change event +- Add 0008-libmutipath-continue-to-use-old-state-on-PATH_PENDIN.patch +- Add 0009-multipathd-use-update_path_groups-instead-of-reload_.patch +- Add 0010-multipath.conf-add-missing-options-to-man-page.patch +- Add 0011-libmultipath-add-get_uid-fallback-code-for-NVMe-devi.patch +- Add 0012-libmulitpath-cleanup-uid_fallback-code.patch +- Add 0013-multipathd-handle-changed-wwids-by-removal-and-addit.patch + * if a path device changes wwid, it will now be removed and re-added + to the correct multipath device. +- Add 0014-multipathd-remove-wwid_changed-path-attribute.patch +- Add 0015-multipathd-ignore-disable_changed_wwids.patch +- Add 0016-multipathd-Don-t-use-fallback-code-after-getting-wwi.patch +- Add 0017-libmultipath-silence-dm_is_mpath-error-messages.patch + * The above 12 patches have been submitted upstream + +* Sun Feb 17 2019 Igor Gnatenko - 0.7.9-6.git2df6110 +- Rebuild for readline 8.0 + +* Thu Jan 31 2019 Benjamin Marzinski - 0.7.9-5.git2df6110 +- Rename files + * Previous patch 0006-0014 are now patches 0008-0016 +- Add 0006-multipathd-avoid-null-pointer-dereference-in-LOG_MSG.patch +- Add 0007-multipath-blacklist-zram-devices.patch + * The above 2 patches have been submitted upstream +- Resolves: bz #1672761 + +* Thu Jan 31 2019 Benjamin Marzinski - 0.7.9-4.git2df6110 +- Update Source to latest upstream commit + * previous patch 0001-libmultipath-dm_is_mpath-cleanup.patch is included + in this commit +- Rename files + * Previous patches 0002-0009 are now patches 0006-0013 +- Add 0001-BZ-1668693-disable-user_friendly_names-for-NetApp.patch +- Add 0002-libmultipath-handle-existing-paths-in-marginal_path-.patch +- Add 0003-multipathd-cleanup-marginal-paths-checking-timers.patch +- Add 0004-libmultipath-fix-marginal-paths-queueing-errors.patch +- Add 0005-libmultipath-fix-marginal_paths-nr_active-check.patch + * The above 5 patches have been submitted upstream +- Add 0014-RH-Fix-nvme-compilation-warning.patch + * This change is only necessary because of Red Hat compilation + differences. + +* Thu Jan 31 2019 Fedora Release Engineering - 0.7.9-3.git17a6101 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Jan 15 2019 Benjamin Marzinski 0.7.9-2.git17a6101 +- Update Source to latest upstream commit + * Previous patches 0001-0003 are included in this version +- Rename files + * Previous patches 0004-0011 are now patches 0002-0009 +- Add 0001-libmultipath-dm_is_mpath-cleanup.patch + * This patch has been submitted upstream + +* Mon Dec 3 2018 Benjamin Marzinski 0.7.9-1 +- Update Source to upstream version 0.7.9 + * Previous patches 0001-0006 are included in this version +- Rename files + * Previous patches 0007-0014 are now patches 0004-0011 +- Add 0001-multipathd-fix-mpp-hwe-handling-when-paths-are-freed.patch +- Add 0002-libmultipath-cleanup-pthread_cleanup_pop-call.patch +- Add 0003-libmultipath-fix-false-removes-in-dmevents-polling-c.patch + * The above 3 patches have been submitted upstream + +* Wed Oct 10 2018 Benjamin Marzinski 0.7.8-1 +- Update Source to upstream version 0.7.8 + * Previous patches 0001-0020 are included in this version +- Rename files + * Previous patches 0021-0025 are now patches 0001-0005 + * Previous patches 0026-0033 are now patches 0007-0014 +- Add 0006-libmultipath-timeout-on-unresponsive-tur-thread.patch + * has been submitted upstream + +* Tue Oct 9 2018 Benjamin Marzinski 0.7.7-7.gitb80318b +- Update Source to latest upstream commit +- Rename files + * Previous patches 0001-0020 are now patches 0002-0021 + * Previous patches 0021-0028 are now patches 0026-0033 +- Add 0001-kpartx-Use-absolute-paths-to-create-mappings.patch +- Add 0022-multipathd-check-for-NULL-udevice-in-cli_add_path.patch +- Add 0023-libmultipath-remove-max_fds-code-duplication.patch +- Add 0024-multipathd-set-return-code-for-multipathd-commands.patch +- Add 0025-mpathpersist-fix-registration-rollback-issue.patch + * The above 5 patches have been submitted upstream + +* Thu Sep 27 2018 Benjamin Marzinski 0.7.7-6.git1a8625a +- Update Source to latest upstream commit + * Previous patches 0001-0011 are included in this commit +- Rename files + * Previous patches 0012-0019 are now patches 0021-0028 +- Add 0001-libmultipath-fix-tur-checker-timeout.patch +- Add 0002-libmultipath-fix-tur-checker-double-locking.patch +- Add 0003-libmultipath-fix-tur-memory-misuse.patch +- Add 0004-libmultipath-cleanup-tur-locking.patch +- Add 0005-libmultipath-fix-tur-checker-timeout-issue.patch + * The above 5 patches cleanup locking issues with the + tur checker threads +- Add 0006-libmultipath-fix-set_int-error-path.patch +- Add 0007-libmultipath-fix-length-issues-in-get_vpd_sgio.patch +- Add 0008-libmultipath-_install_keyword-cleanup.patch +- Add 0009-libmultipath-remove-unused-code.patch +- Add 0010-libmultipath-fix-memory-issue-in-path_latency-prio.patch +- Add 0011-libmultipath-fix-null-dereference-int-alloc_path_gro.patch +- Add 0012-libmutipath-don-t-use-malformed-uevents.patch +- Add 0013-multipath-fix-max-array-size-in-print_cmd_valid.patch +- Add 0014-multipathd-function-return-value-tweaks.patch +- Add 0015-multipathd-minor-fixes.patch +- Add 0016-multipathd-remove-useless-check-and-fix-format.patch +- Add 0017-multipathd-fix-memory-leak-on-error-in-configure.patch + * The above 12 patches fix minor issues found by coverity +- Add 0018-libmultipath-Don-t-blank-intialized-paths.patch +- Add 0019-libmultipath-Fixup-updating-paths.patch + * Fix issues with paths whose wwid was not set or later changes +- Add 0020-multipath-tweak-logging-style.patch + * multipathd interactive commands now send errors to stderr, instead + of syslog + * The above 20 patches have been submitted upstream + +* Fri Sep 14 2018 Benjamin Marzinski 0.7.7-5.gitef6d98b +- Add Conflicts for mdadm < 4.1-rc2.0.2 and udisks2 < 2.8.0-2 + * Multipath udev rule update from 0.7.7-1 is incompatible with older versions + (bz #1628192) + +* Thu Jul 12 2018 Benjamin Marzinski 0.7.7-4.gitef6d98b +- Update Source to latest upstream commit + * Previous patches 0001-0018 are included in this commit +- Rename files + * Previous patches 0019-0028 are now patches 0002-0003 & 0012-0019 +- Add 0001-libmultipath-remove-last-of-rbd-code.patch +- Add 0004-mpathpersist-add-param-alltgpt-option.patch + * mpathpersist now accepts --param-alltgpt +- Add 0005-libmutipath-remove-unused-IDE-bus-type.patch +- Add 0006-multipathd-add-new-protocol-path-wildcard.patch + * multipathd show paths format now accepts %%P for the path + protocol/transport +- Add 0007-libmultipath-add-protocol-blacklist-option.patch + * You can now use the "protocol" blacklist section parameter to blacklist + by protocol/transport +- Add 0008-libmultipath-remove-_filter_-blacklist-functions.patch +- Add 0009-multipath-tests-change-to-work-with-old-make-version.patch +- Add 0010-multipath-tests-add-blacklist-tests.patch +- Add 0011-mpathpersist-add-missing-param-rk-usage-info.patch +- Refresh 0013-RH-Remove-the-property-blacklist-exception-builtin.patch +- Modify 0016-RH-add-mpathconf.patch + * improve usage message and man page + +* Thu Jul 12 2018 Fedora Release Engineering - 0.7.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Sat Jun 30 2018 Peter Robinson 0.7.7-2 +- Spec cleanups, drop remains of initscripts dependencies + +* Tue Jun 12 2018 Benjamin Marzinski 0.7.7-1 +- Update Source to 0.7.7 + * Previous patches 0001-0009 & 0018 are included in this commit +- Add upstream patches since 0.7.7 + * patches 0001-0012 are from upstream commits since 0.7.7 +- Add 0015-mpathpersist-add-all_tg_pt-option.patch + * add new all_tg_pt multpiath.conf option. posted upstream +- Add 0016-libmultipath-remove-rbd-code.patch + * remove unused rbd code. posted upstream +- Add 0017-mpathpersist-fix-aptpl-support.patch + * add ":aptpl" suffix for reservation_key to fix aptpl support. + posted upstream +- Add 0018-multipath-don-t-check-timestamps-without-a-path.patch + * fix multipath null dereference crash. posted upstream +- Add 0019-libmultipath-fix-detect-alua-corner-case.patch + * fix alua detection with retain_hardware_handler set to off. posted + upstream +- Add 0020-multipath-fix-setting-conf-version.patch + * multipath wasn't setting the kernel version correctly. posted upstream +- Add 0028-RH-reset-default-find_mutipaths-value-to-off.patch + * default to RHEL7 and older device detection style. Redhat specific, to + keep customer experience the same. +- Rename files + * Previous patches 0010-0011 are now patches 0013-0014 + * Previous patches 0012-0017 & 0019 are now patches 0021-0027 +- Modify 0021-RH-fixup-udev-rules-for-redhat.patch + * Fix spurious compile warning with redhat compile options + + +* Tue May 15 2018 Benjamin Marzinski 0.7.6-4.git1cb704b +- Add 0010-libmultipath-print-correct-default-for-delay_-_check.patch + * fix minor configuration printing issue +- Add 0011-multipath.conf.5-clarify-property-whitelist-handling.patch + * clarify property blacklist_excecptions handling in man page +- Rename files + * Previous patches 0010-0017 are now patches 0012-0019 +- Modify 0013-RH-Remove-the-property-blacklist-exception-builtin.patch + * clarify changes in man page + +* Tue Apr 24 2018 Benjamin Marzinski 0.7.6-3.git1cb704b +- Add 0008-multipathd-add-failures-path-format-wildcard.patch +- Add 0009-multipathd-fix-reservation_key-check.patch +- Rename files + * Previous patches 0008-0015 are now patches 0010-0017 + +* Fri Apr 13 2018 Benjamin Marzinski 0.7.6-2.git1cb704b +- Add 0007-libmultipath-Fix-logic-in-should_multipath.patch + * fix bug in identifying multipathable devices. posted upstream +- Rename files + * Previous patches 0007-0014 are now patches 0008-0015 + +* Mon Apr 02 2018 Benjamin Marzinski 0.7.6-1.git1cb704b +- Update Source to the latest upstream commit + * Previous patches 0001-0014 are included in this commit + * Previous patches 0015-0022 are now patches 0007-0014 +- 0001-multipathd-remove-incorrect-pthread_testcancel.patch + * Fixed pthread cancellation issue. posted upstream +- 0002-multipath-add-comments.patch + * Posted upstream +- 0003-multipathd-minor-dmevents-polling-code-cleanups.patch + * Fixed minor polling issues. posted upstream +- 0004-multipathd-remove-unneeded-function-parameter.patch + * Posted upstream +- 0005-mpathcmd-fix-libmpathcmd-license.patch + * License clarification. posted upstream +- 0006-libmultipath-don-t-print-undefined-values.patch + * Fixed bug in 'multipath show config'. posted upstream + +* Tue Mar 06 2018 Björn Esser - 0.7.4-2.git07e7bd5 +- Rebuilt for libjson-c.so.4 (json-c v0.13.1) + +* Thu Feb 15 2018 Benjamin Marzinski 0.7.4-1.git07e7bd5 +- Update Source to the latest upstream commit + * Previous patches 0001-0006 are included in this commit + * Previous patches 0007-0014 are now patches 0015-0022 +- Add 0001-libmultipath-fix-tur-checker-locking.patch + * Fixed spinlock bug. posted upstream +- Add 0002-multipath-fix-DEF_TIMEOUT-use.patch + * Add missing sec to ms conversion. posted upstream +- Add 0003-multipathd-remove-coalesce_paths-from-ev_add_map.patch + * Remove unused code. posted upstream +- Add 0004-multipathd-remove-unused-configure-parameter.patch + * Remove unused code. posted upstream +- Add 0005-Fix-set_no_path_retry-regression.patch + * Fix issue with queueing and path addition. posted upstream +- Add 0006-multipathd-change-spurious-uevent-msg-priority.patch + * Change message priority to Notice. posted upstream +- Add 0007-multipath-print-sysfs-state-in-fast-list-mode.patch + * Show sysfs state correctly in fast list mode (-l). posted upstream +- Add 0008-libmultipath-move-remove_map-waiter-code-to-multipat.patch + * Move code around. posted upstream +- Add 0009-move-waiter-code-from-libmultipath-to-multipathd.patch + * Move code around. posted upstream +- Add 0010-call-start_waiter_thread-before-setup_multipath.patch + * Fix race on multipath device creations. posted upstream +- Add 0011-libmultipath-add-helper-functions.patch + * posted upstream +- Add 0012-multipathd-RFC-add-new-polling-dmevents-waiter-threa.patch + * Add alternate method of getting dmevents, that doesn't + require a thread per device. posted upstream +- Add 0013-libmultipath-condlog-log-to-stderr.patch + * change condlog to log to stderr instead of stdout. posted upstream +- Add 0014-multipathd-fix-compiler-warning-for-uev_pathfail_che.patch + * fix indentation issue. posted upstream + +* Wed Feb 07 2018 Fedora Release Engineering - 0.7.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sun Dec 10 2017 Björn Esser - 0.7.3-2 +- Rebuilt for libjson-c.so.3 + +* Tue Nov 7 2017 Benjamin Marzinski 0.7.3-1 +- Update Source to upstream 0.7.3 release + * Previous patch 0001 is included in this commit, and 0002 was solved in a + different manner causing some change to previous patch 0003 + * Previous patches 0003-0010 are now patches 0007-0014 +- Add 0001-mpathpersist-Fix-invalid-condition-check.patch + * Fix incorrect check. posted upstream +- Add 0002-multipath-add-man-page-info-for-my-prkey-changes.patch + * Add missing man page info. posted upstream +- Add 0003-multipath-there-is-no-none-path-state.patch + * remove incorrect path state. posted upstream +- Add 0004-mutipath-updated-Huawei-storage-config.patch + * update builtin device configuration. posted upstream +- Add 0005-multipath-fix-doc-typo.patch + * fix man page typo. posted upstream +- Add 0006-multipath-add-ghost_delay-parameter.patch + * add new multipath.conf parameter "ghost_delay". posted upstream + + +* Tue Nov 7 2017 Benjamin Marzinski 0.7.1-8.git847cc43 +- Refresh 0001-libmultipath-update-3PARdata-builtin-config.patch +- Add 0010-RH-warn-on-invalid-regex-instead-of-failing.patch + * Change old-style multipath.conf regex "*" to a proper ".*" instead of + failing + +* Wed Aug 2 2017 Benjamin Marzinski 0.7.1-7.git847cc43 +- Modify 0005-RH-don-t-start-without-a-config-file.patch + * Fix man page typos + +* Mon Jul 31 2017 Troy Dawson - 0.7.1-6.git847cc43 +- Clean spec file - remove pre-fedora 23 cruft + +* Wed Jul 26 2017 Fedora Release Engineering - 0.7.1-5.git847cc43 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Jul 21 2017 Benjamin Marzinski 0.7.1-4.git847cc43 +- Update Source to the latest upstream commit + * Previous patches 0001 and 0010-0013 are included in this commit. +- Add 0001-libmultipath-update-3PARdata-builtin-config.patch + * Change for building configuration. Posted upstream +- Modify 0006-RH-use-rpm-optflags-if-present.patch + * Add missing lines to actually use RPM_OPT_FLAGS. + +* Fri Jun 23 2017 Tom Callaway - 0.7.1-3.gitf21166a +- rebuild to resolve broken deps + +* Fri Jun 2 2017 Benjamin Marzinski 0.7.1-2.gitf21166a +- Modify 0004-RH-Remove-the-property-blacklist-exception-builtin.patch + * update multipath.conf.5 man page to remove builtin listing +- Modify 0005-RH-don-t-start-without-a-config-file.patch + * update multipathd.8 man page to note that a config file is necessary +- Modify 0007-RH-add-mpathconf.patch + * add property blacklist-exception to default config file +- Add 0010-libmultipath-change-how-RADOS-checker-is-enabled.patch + * Makefile now autodetects librados. Posted upstream +- Remove related RADOS option from spec file +- Add 0011-multipath-set-verbosity-to-default-during-config.patch + * Allow multipath to print warning messages during configuration. + Posted upstream +- Add 0012-mpath-skip-device-configs-without-vendor-product.patch + * device entries without vendor/product were breaking configurations. + Posted upsteam +- Add 0013-multipathd-fix-show-maps-json-crash.patch + * multipathd crashed showing json output with no devices. Posted + upstream + +* Tue May 23 2017 Benjamin Marzinski 0.7.1-1.gitf21166a +- Update Source to the latest upstream commit +- Add 0001-libmultipath-add-comment-about-resuming.patch + * posted upstream +- Add 0002-multipath-attempt-at-common-multipath.rules.patch + * under discussion upstream +- Add 0003-RH-fixup-udev-rules-for-redhat.patch + * Redhat uses different udev rules that some other distros, so multipath + has run at a different time. Not all upstream distros link /sbin and + /usr/sbin either. +- Add 0004-RH-Remove-the-property-blacklist-exception-builtin.patch + * Allow multipath to be used on devices without multiple paths. NAK'ed + upstream, but requested by Red Hat +- Add 0005-RH-don-t-start-without-a-config-file.patch + * Don't start multipath unless a config file exists. NAK'ed upstream, + but requested by Red Hat +- Add 0006-RH-use-rpm-optflags-if-present.patch + * Make the build system fedora friendly +- Add 0007-RH-add-mpathconf.patch + * Add tool to help configure multipath with Red Hat defaults. +- Add 0008-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch + * Make multipath able to claim devices based on the kernel command line + NAK'ed upstream but requested by Red Hat +- Add 0009-RH-trigger-change-uevent-on-new-device-creation.patch + * under discussion upstream + +* Wed Apr 12 2017 Benjamin Marzinski 0.4.9-87 +- Remove Epoch from device-mapper requires + * The RHEL releases of device-mapper set the Epoch, and this was + accidentally retained in the fedora spec file. + +* Fri Apr 7 2017 Benjamin Marzinski 0.4.9-86 +- Modify 0136-RHBZ-1304687-wait-for-map-add.patch + * switch to missing_uev_wait_timeout to stop waiting for uev +- Refresh 0137-RHBZ-1280524-clear-chkr-msg.patch +- Refresh 0150-RHBZ-1253913-fix-startup-msg.patch +- Refresh 0154-UPBZ-1291406-disable-reinstate.patch +- Refresh 0156-UPBZ-1313324-dont-fail-discovery.patch +- Refresh 0161-RHBZ-1311659-no-kpartx.patch +- Refresh 0167-RHBZ-1335176-fix-show-cmds.patch +- Add 0173-RH-update-man-page.patch +- Add 0174-RHBZ-1362396-modprobe.patch + * make starting the multipathd service modprobe dm-multipath in the + sysvinit scripts +- Add 0175-RHBZ-1357382-ordering.patch + * force multipathd.service to start after systemd-udev-trigger.service +- Add 0176-RHBZ-1363830-fix-rename.patch + * initialized a variable to make dm_rename not fail randomly +- Add 0177-libmultipath-correctly-initialize-pp-sg_id.patch + * This and all the following patches add the rbd patch checker +- Add 0178-libmultipath-add-rbd-discovery.patch +- Add 0179-multipath-tools-add-checker-callout-to-repair-path.patch +- Add 0180-multipath-tools-Add-rbd-checker.patch +- Add 0181-multipath-tools-Add-rbd-to-the-hwtable.patch +- Add 0182-multipath-tools-check-for-initialized-checker-before.patch +- Add 0183-multipathd-Don-t-call-repair-on-blacklisted-path.patch +- Add 0184-rbd-fix-sync-repair-support.patch +- Add 0185-rbd-check-for-nonshared-clients.patch +- Add 0186-rbd-check-for-exclusive-lock-enabled.patch +- Add 0187-rbd-fixup-log-messages.patch +- Add 0188-RHBZ-1368501-dont-exit.patch + * make multipathd not exit if it encounters recoverable errors on startup +- Add 0189-RHBZ-1368211-remove-retries.patch + * add "remove_retries" multipath.conf parameter to make multiple attempts + to remove a multipath device if it is busy. +- Add 0190-RHBZ-1380602-rbd-lock-on-read.patch + * pass lock_on_read when remapping image +- Add 0191-RHBZ-1169168-disable-changed-paths.patch + * add "disabled_changed_wwids" multipath.conf parameter to disable + paths whose wwid changes +- Add 0192-RHBZ-1362409-infinibox-config.patch +- Add 0194-RHBZ-1351964-kpartx-recurse.patch + * fix recursion on corrupt dos partitions +- Add 0195-RHBZ-1359510-no-daemon-msg.patch + * print a messages when multipathd isn't running +- Add 0196-RHBZ-1239173-dont-set-flag.patch + * don't set reload flag on reloads when you gain your first + valid path +- Add 0197-RHBZ-1394059-max-sectors-kb.patch + * add "max_sectors_kb" multipath.conf parameter to set max_sectors_kb + on a multipath device and all its path devices +- Add 0198-RHBZ-1372032-detect-path-checker.patch + * add "detect_checker" multipath.conf parameter to detect ALUA arrays + and set the path checker to TUR +- Add 0199-RHBZ-1279355-3pardata-config.patch +- Add 0200-RHBZ-1402092-orphan-status.patch + * clear status on orphan paths +- Add 0201-RHBZ-1403552-silence-warning.patch +- Add 0202-RHBZ-1362120-skip-prio.patch + * don't run prio on failed paths +- Add 0203-RHBZ-1363718-add-msgs.patch +- Add 0204-RHBZ-1406226-nimble-config.patch +- Add 0205-RHBZ-1416569-reset-stats.patch + * add "reset maps stats" and "reset map stats" multipathd + interactive commands to reset the stats tracked by multipathd +- Add 0206-RHBZ-1239173-pt2-no-paths.patch + * make multipath correctly disable scanning and rules running when + it gets a uevent and there are not valid paths. +- Add 0207-UP-add-libmpathcmd.patch + * New shared library, libmpathcmd, that sends and receives messages from + multipathd. device-mapper-multipath now uses this library internally. +- Add 0208-UPBZ-1430097-multipathd-IPC-changes.patch + * validation that modifying commands are coming from root. +- Add 0209-UPBZ-1430097-multipath-C-API.patch + * New shared library. libdmmp, that presents the information from multipathd + in a structured manner to make it easier for callers to use +- Add 0210-RH-fix-uninstall.patch + * Minor compilation fixes +- Add 0211-RH-strlen-fix.patch + * checks that variables are not NULL before passing them to strlen +- Add 0212-RHBZ-1431562-for-read-only.patch +- Make 3 new subpackages + * device-mapper-multipath-devel, libdmmp, and libdmmp-devel. libmpathcmd + and libmpathprio are in device-mapper-multipath-libs and + device-mapper-multipath-devel. libdmmp is in its own subpackages +- Move libmpathprio devel files to device-mapper-multipath-devel +- Added BuildRequires on librados2-devel + + +* Fri Feb 10 2017 Fedora Release Engineering - 0.4.9-85 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Jan 12 2017 Igor Gnatenko - 0.4.9-84 +- Rebuild for readline 7.x + * Fri Jul 22 2016 Benjamin Marzinski 0.4.9-83 - Modify 0135-RHBZ-1299600-path-dev-uevents.patch * trigger uevents when adding wwids for existing devices during startup diff --git a/multipath.conf b/multipath.conf deleted file mode 100644 index c7684fe..0000000 --- a/multipath.conf +++ /dev/null @@ -1,93 +0,0 @@ -# This is a basic configuration file with some examples, for device mapper -# multipath. -# -# For a complete list of the default configuration values, run either -# multipath -t -# or -# multipathd show config -# -# For a list of configuration options with descriptions, see the multipath.conf -# man page - -## By default, devices with vendor = "IBM" and product = "S/390.*" are -## blacklisted. To enable mulitpathing on these devies, uncomment the -## following lines. -#blacklist_exceptions { -# device { -# vendor "IBM" -# product "S/390.*" -# } -#} - -## Use user friendly names, instead of using WWIDs as names. -defaults { - user_friendly_names yes - find_multipaths yes -} -## -## Here is an example of how to configure some standard options. -## -# -#defaults { -# udev_dir /dev -# polling_interval 10 -# selector "round-robin 0" -# path_grouping_policy multibus -# prio alua -# path_checker readsector0 -# rr_min_io 100 -# max_fds 8192 -# rr_weight priorities -# failback immediate -# no_path_retry fail -# user_friendly_names yes -#} -## -## The wwid line in the following blacklist section is shown as an example -## of how to blacklist devices by wwid. The 2 devnode lines are the -## compiled in default blacklist. If you want to blacklist entire types -## of devices, such as all scsi devices, you should use a devnode line. -## However, if you want to blacklist specific devices, you should use -## a wwid line. Since there is no guarantee that a specific device will -## not change names on reboot (from /dev/sda to /dev/sdb for example) -## devnode lines are not recommended for blacklisting specific devices. -## -#blacklist { -# wwid 26353900f02796769 -# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" -# devnode "^hd[a-z]" -#} -#multipaths { -# multipath { -# wwid 3600508b4000156d700012000000b0000 -# alias yellow -# path_grouping_policy multibus -# path_checker readsector0 -# path_selector "round-robin 0" -# failback manual -# rr_weight priorities -# no_path_retry 5 -# } -# multipath { -# wwid 1DEC_____321816758474 -# alias red -# } -#} -#devices { -# device { -# vendor "COMPAQ " -# product "HSV110 (C)COMPAQ" -# path_grouping_policy multibus -# path_checker readsector0 -# path_selector "round-robin 0" -# hardware_handler "0" -# failback 15 -# rr_weight priorities -# no_path_retry queue -# } -# device { -# vendor "COMPAQ " -# product "MSA1000 " -# path_grouping_policy multibus -# } -#} diff --git a/plans/multipath.fmf b/plans/multipath.fmf new file mode 100644 index 0000000..876c77a --- /dev/null +++ b/plans/multipath.fmf @@ -0,0 +1,58 @@ +summary: basic functionality tests + +provision: + hardware: + memory: ">= 2 GB" + +prepare: + how: install + package: + - device-mapper-multipath + - perl + +discover: + how: shell + tests: + - name: medium_error_scsi_debug + path: /tests/medium_error_scsi_debug + test: ./main.sh + duration: 15m + - name: squelch_scsi_id + path: /tests/squelch_scsi_id + test: ./main.sh + duration: 15m + - name: multipathd_oom + path: /tests/multipathd_oom + test: ./main.sh + duration: 15m + - name: user_friendly_names + path: /tests/user_friendly_names + test: ./main.sh + duration: 15m + - name: kpartx_4k_aligned + path: /tests/kpartx_4k_aligned + test: ./main.sh + duration: 15m + - name: bindings + path: /tests/bindings + test: ./main.sh + duration: 15m + - name: restate_module + path: /tests/restate_module + test: ./main.sh + duration: 15m + - name: find_multipaths + path: /tests/find_multipaths + test: ./main.sh + duration: 15m + - name: multipath_conf_syntax + path: /tests/multipath_conf_syntax + test: ./main.sh + duration: 15m + - name: alias_clash + path: /tests/alias_clash + test: ./main.sh + duration: 15m + +execute: + how: tmt diff --git a/sources b/sources index 05ab47e..233c4ea 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -808f827ea6e832cf373ebacf0c70e6f8 multipath-tools-130222.tgz +SHA512 (multipath-tools-0.13.0.tgz) = 75c84524ee27590b8b751ea500898a44e5ac3d58d55be6bcab919d0d423049db3a4466fcb9135705cf63ba074416973bb651255063269e9f682f11d21ba57e59 +SHA512 (multipath.conf) = 71953dce5a68adcf60a942305f5a66023e6f4c4baf53b1bfdb4edf65ed5b8e03db804363c36d1dcfd85591f4766f52b515269904c53b84d7b076da0b80b09942 diff --git a/tests/alias_clash/LICENSE b/tests/alias_clash/LICENSE new file mode 100644 index 0000000..10926e8 --- /dev/null +++ b/tests/alias_clash/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/tests/alias_clash/PURPOSE b/tests/alias_clash/PURPOSE new file mode 100644 index 0000000..ba496c4 --- /dev/null +++ b/tests/alias_clash/PURPOSE @@ -0,0 +1,20 @@ +verify that multipath doesn't try to assign new devices in-use user_friendly +aliases. + +steps: +1. setup config file and remove existing bindings file +2. create scsi_debug devices +3. start multipathd to create devices and bindings file +4. look at path device ordering in multipathd output +5. stop multipathd and remove devices +6. blacklist the devices which were multipathed early in the config file +7. remove the bindings file +8. restart multipathd to create devices, where the later devices grab the + earlier user_friendly_names +9. stop multipathd +10. remove blacklists from the config file and remove bindings file +11. restart multipathd +12. Verify that all devices are there, the previously existing devices + still have the same alias, and all the devices match the bindings file +13. reconfigure multipathd +14. Verify that all devices are still there and still match. diff --git a/tests/alias_clash/main.sh b/tests/alias_clash/main.sh new file mode 100755 index 0000000..6e3b23c --- /dev/null +++ b/tests/alias_clash/main.sh @@ -0,0 +1,122 @@ +#!/bin/bash + +# Copyright (c) 2021 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Benjamin Marzinski + +source ../include/ec.sh || exit 200 +tlog "running $0" + +cleanup () +{ + trun "multipathd disablequeueing maps" + sleep 5 + trun "multipath -DF" + trun "service multipathd stop" + sleep 5 + trun "udevadm settle" + trun "modprobe -r scsi_debug" +} + +assert () +{ + local cmd="$*" + _trun_ "$cmd" 0 + if test $? -eq 0; then + tpass_ "$cmd" ; + else + tfail_ "$cmd" ; + cleanup ; + tend ; + fi +} + +tlog "running $0" + +rpm -q device-mapper-multipath || dnf install -y device-mapper-multipath + +# cleanup existing devices and restart +cleanup +trun "rm -f /etc/multipath.conf" +trun "rm -f /etc/multipath.conf.bak" +trun "rm -r /etc/multipath/bindings" +trun "mpathconf --enable --with_module y --with_multipathd n --find_multipaths n" +sed -i '/^blacklist[[:space:]]*{/ a\ + device {\n vendor ".*"\n product ".*"\n } +' /etc/multipath.conf +if grep -qw blacklist_exceptions /etc/multipath.conf ; then + sed -i '/^blacklist_exceptions[[:space:]]*{/ a\ + device {\n vendor Linux\n product scsi_debug\n } +' /etc/multipath.conf +else + cat << _EOF_ >> /etc/multipath.conf +blacklist_exceptions { + device { + vendor Linux + product scsi_debug + } +} +_EOF_ +fi +trun "modprobe scsi_debug num_tgts=20 vpd_use_hostno=0" +sleep 5 +trun "service multipathd start" +sleep 5 +pathcount=`multipathd show paths raw format %w | wc -l` +assert "[[ $pathcount -eq 20 ]]" +wwids=`multipathd show paths raw format " wwid %w" | sed '11,$d'` +wwids="${wwids//$'\n'/\\n}" +trun "multipath -DF" +trun "service multipathd stop" +sleep 5 +tnot "pidof multipathd" +tok "cp /etc/multipath.conf /etc/mulitpath.conf.bak" +sed -i '/^blacklist[[:space:]]*{/ a\ +'"$wwids"' +' /etc/multipath.conf +tok "rm -f /etc/multipath/bindings" +trun "service multipathd start" +sleep 5 +mapcount=`multipathd show maps raw format %w | wc -l` +assert "[[ $mapcount -eq 10 ]]" +orig_maps=`multipathd show maps raw format "%n %w"` +trun "service multipathd stop" +sleep 5 +tnot "pidof multipathd" +tok "mv -f /etc/mulitpath.conf.bak /etc/multipath.conf" +tok "rm -f /etc/multipath/bindings" +trun "service multipathd start" +sleep 5 +mapcount=`multipathd show maps raw format %w | wc -l` +assert "[[ $mapcount -eq 20 ]]" +new_maps=`multipathd show maps raw format "%n %w" | sort` +tlog "Checking if devices have been renamed" +while IFS= read -r line; do + echo "$new_maps" | grep "$line" + assert "[[ $? -eq 0 ]]" +done <<< "$orig_maps" +bindings=`cat /etc/multipath/bindings | sed '/^#.*$/d' | sort` +tlog "Checking if devices match bindings" +assert "[[ \"$new_maps\" = \"$bindings\" ]]" +trun "service multipathd reload" +sleep 5 +mapcount=`multipathd show maps raw format %w | wc -l` +assert "[[ $mapcount -eq 20 ]]" +reload_maps=`multipathd show maps raw format "%n %w" | sort` +tlog "Checking if devices change on reconfigure" +assert "[[ \"$new_maps\" = \"$reload_maps\" ]]" +cleanup +tend diff --git a/tests/bindings/LICENSE b/tests/bindings/LICENSE new file mode 100644 index 0000000..10926e8 --- /dev/null +++ b/tests/bindings/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/tests/bindings/PURPOSE b/tests/bindings/PURPOSE new file mode 100644 index 0000000..ea0cc9b --- /dev/null +++ b/tests/bindings/PURPOSE @@ -0,0 +1,7 @@ +make sure modify /etc/multipath/bindings changes alias + +steps: +1. edit the /etc/multipath/bindings +2. multipath -r +check if the mpath is changed + diff --git a/tests/bindings/main.sh b/tests/bindings/main.sh new file mode 100755 index 0000000..76292e4 --- /dev/null +++ b/tests/bindings/main.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + +#set -x +source ../include/tc.sh || exit 200 +tlog "running $0" + +cleanup () +{ + local retries + if pidof multipathd; then + tlog "stopping multipathd" + trun "systemctl stop multipathd.service || pkill multipathd" + sleep 1 + fi + retries=10 + while pidof multipathd; do + ((retries--)) + if [[ $retries -le 0 ]]; then + tfail_ "failed to stop multipath" + tend + fi + tlog "waiting for multipathd to stop" + sleep 2 + pidof multipathd && pkill multipathd + done + trun "multipath -l -v1" + retries=10 + while [[ -n `multipath -l -v1` ]]; do + ((retries--)) + if [[ $retries -le 0 ]]; then + tfail_ "failed to remove deviece" + tend + fi + tlog "removing multipath device" + trun "udevadm settle" + trun "multipath -DF" + sleep 2 + done + if lsmod | grep -q "^scsi_debug"; then + tlog "removing scsi_debug module" + tok "rmmod scsi_debug" + fi + trun "rm -f /etc/multipath.conf" +} + +assert () +{ + local cmd="$*" + _trun_ "$cmd" 0 + if test $? -eq 0; then + tpass_ "$cmd" ; + else + tfail_ "$cmd" ; + cleanup ; + tend ; + fi +} + +setup_config () +{ + trun "mpathconf --enable --user_friendly_names y" + sed -i '/^blacklist[[:space:]]*{/ a\ + device {\ + vendor ".*"\ + product ".*"\ + } +' /etc/multipath.conf + cat << _EOF_ >> /etc/multipath.conf + +blacklist_exceptions { + device { + vendor Linux + product scsi_debug + } +} +_EOF_ + trun "cat /etc/multipath.conf" +} + +do_reconfigure () +{ + tok "multipathd reconfigure" + sleep 5 +} + +rpm -q device-mapper-multipath || dnf install -y device-mapper-multipath +cleanup +setup_config +trun "rm -r /etc/multipath/bindings" +trun "modprobe scsi_debug vpd_use_hostno=0 add_host=2" +sleep 5 +trun "systemctl start multipathd.service" +while multipathd show daemon | grep -qv idle; do + tlog "waiting for multipathd to start" + sleep 1 +done + +trun 'multipathd show maps raw format "%n"' +mpath_name=`multipathd show maps raw format "%n" | head -1` +assert "[[ -n $mpath_name ]] && [[ $mpath_name != ok ]]" +new_alias="mpath_test_$$" + +trun "sed -i 's/$mpath_name/$new_alias/' /etc/multipath/bindings" +do_reconfigure +trun 'multipathd show maps raw format "%n"' +mpath_name=`multipathd show maps raw format "%n" | head -1` +assert "[[ $mpath_name = $new_alias ]]" + +cleanup +tend diff --git a/tests/find_multipaths/LICENSE b/tests/find_multipaths/LICENSE new file mode 100644 index 0000000..10926e8 --- /dev/null +++ b/tests/find_multipaths/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/tests/find_multipaths/PURPOSE b/tests/find_multipaths/PURPOSE new file mode 100644 index 0000000..53dbf36 --- /dev/null +++ b/tests/find_multipaths/PURPOSE @@ -0,0 +1,10 @@ +testing environment: +1. enable|disable find_multipaths and do multipath reload +mpathconf --find_multipaths y|n --with_multipathd y + +test cases: +1. find_multipaths = no +multipath will not blacklist the single devices +2. find_multipaths = yes +multipath will blacklist the single devices +multipath will not blacklist the non-single devices diff --git a/tests/find_multipaths/main.sh b/tests/find_multipaths/main.sh new file mode 100755 index 0000000..28c325c --- /dev/null +++ b/tests/find_multipaths/main.sh @@ -0,0 +1,179 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + +#set -x +source ../include/tc.sh || exit 200 +tlog "running $0" + +remove_devices () +{ + local retries + retries=10 + while [[ -n `multipath -l -v1` ]]; do + ((retries--)) + if [[ $retries -le 0 ]]; then + tfail_ "failed to remove devices" + cleanup + tend + fi + tlog "removing multipath devices" + trun "udevadm settle" + trun "multipath -F" + sleep 2 + done +} + +cleanup () +{ + local retries + if pidof multipathd; then + tlog "stopping multipathd" + trun "systemctl stop multipathd.service || pkill multipathd" + sleep 1 + fi + retries=10 + while pidof multipathd; do + ((retries--)) + if [[ $retries -le 0 ]]; then + tfail_ "failed to stop multipath" + tend + fi + tlog "waiting for multipathd to stop" + sleep 2 + pidof multipathd && pkill multipathd + done + trun "multipath -l -v1" + retries=10 + while [[ -n `multipath -l -v1` ]]; do + ((retries--)) + if [[ $retries -le 0 ]]; then + tfail_ "failed to remove devices" + tend + fi + tlog "removing multipath devices" + trun "udevadm settle" + trun "multipath -DF" + sleep 2 + done + if lsmod | grep -q "^scsi_debug"; then + tlog "removing scsi_debug module" + tok "rmmod scsi_debug" + fi + trun "rm -f /etc/multipath.conf" + trun "rm -f /etc/multipath/wwids" + trun "rm -r /etc/multipath/bindings" +} + +assert () +{ + local cmd="$*" + _trun_ "$cmd" 0 + if test $? -eq 0; then + tpass_ "$cmd" ; + else + tfail_ "$cmd" ; + cleanup ; + tend ; + fi +} + +setup_config () +{ + trun "mpathconf --enable --user_friendly_names y --find_multipaths y" + sed -i '/^blacklist[[:space:]]*{/ a\ + device {\ + vendor ".*"\ + product ".*"\ + } +' /etc/multipath.conf + cat << _EOF_ >> /etc/multipath.conf + +blacklist_exceptions { + device { + vendor Linux + product scsi_debug + } +} +_EOF_ + trun "cat /etc/multipath.conf" +} + +do_reconfigure () +{ + trun "cat /etc/multipath.conf" + tok "multipathd reconfigure" + sleep 5 +} + +trun "rpm -q device-mapper-multipath || dnf install -y device-mapper-multipath" +cleanup +setup_config + +# test with find_multipath=y, will not multipath the single device +trun "modprobe scsi_debug" +sleep 5 +trun "systemctl start multipathd.service" +while multipathd show daemon | grep -qv idle; do + tlog "waiting for multipathd to start" + sleep 1 +done +trun 'multipathd show paths raw format "%d %m"' +trun 'cat /etc/multipath/wwids' +mpath_name=`multipathd show paths raw format "%m" | head -1` +tok "[[ $mpath_name = '[orphan]' ]]" +remove_devices + +# test with find_multipath=n, will multipath the single device +trun 'mpathconf --find_multipaths n' +do_reconfigure +trun 'multipathd show paths raw format "%d %m"' +trun 'cat /etc/multipath/wwids' +mpath_name=`multipathd show paths raw format "%m" | head -1` +tok "[[ -n $mpath_name ]] && [[ $mpath_name != '[orphan]' ]]" +remove_devices + +# test with find_multipath=y, with multipath single device with known WWID +trun 'mpathconf --find_multipaths y' +do_reconfigure +trun 'multipathd show paths raw format "%d %m"' +trun 'cat /etc/multipath/wwids' +mpath_name=`multipathd show paths raw format "%m" | head -1` +tok "[[ -n $mpath_name ]] && [[ $mpath_name != '[orphan]' ]]" +remove_devices + +# Clear WWID, test with find_multipath=y, will not multipath single device +trun "multipath -W" +do_reconfigure +trun 'multipathd show paths raw format "%d %m"' +trun 'cat /etc/multipath/wwids' +mpath_name=`multipathd show paths raw format "%m" | head -1` +tok "[[ $mpath_name = '[orphan]' ]]" +remove_devices +assert 'rmmod scsi_debug' + +# test find_multipaths=y create device for paths have same wwid +trun "modprobe scsi_debug vpd_use_hostno=0 add_host=2" +sleep 5 +trun 'multipathd show paths raw format "%d %m"' +trun 'cat /etc/multipath/wwids' +mpath_name=`multipathd show paths raw format "%m" | head -1` +tok "[[ -n $mpath_name ]] && [[ $mpath_name != '[orphan]' ]]" + +cleanup +tend diff --git a/tests/include/ec.sh b/tests/include/ec.sh new file mode 100755 index 0000000..4b0aba9 --- /dev/null +++ b/tests/include/ec.sh @@ -0,0 +1,254 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + +path=$(pwd) +source ../include/utils.sh || exit 1 +source ../include/include.sh || exit 1 +source ../include/tc.sh || exit 1 +source ../include/mpath.sh || exit 1 +source ../include/scsi_debug.sh || exit 1 + +#this script usually is only used by current case +#private global variables, lower case and no under line is okay +mpath= + +function _isconfig (){ + [ -z $mpath ] && return 2 + Cmd "multipath -ll $mpath" +} + +function _init (){ +#will improve this function +#should return the multipathed disk created by scsi_debug, don't consider the other mutipathed disks +#olnly append the black list exception to /etc/multipath.conf not override + Setup_Multipath || Fail "failed to create multipathed device via scsi_debug" + mpath=$RETURN_STR + + _isconfig +} + +function _destroy (){ + Cmd "multipathd disablequeueing maps" + sleep 5 + Cmd "multipath -DF -R2" + Cmd "service multipathd stop" + sleep 5 + Cmd "udevadm settle" + Cmd "modprobe -r scsi_debug" +} + + +# ---------------------------------------------------------# +# Mutipath_installation() +# Usage: +# check if multipath starts, if not install it with yum +# Parameter: +# NULL +# Returns: +# Return code: +# 0 on success +# 1 if something went wrong. +# ---------------------------------------------------------# +function Multipath_installation (){ + Cmd "rpm -qi device-mapper-multipath" && return 0 + Cmd "yum install -y device-mapper-multipath" +} + + +# ---------------------------------------------------------# +# Print_kernel_info() +# Usage: +# print the detail running kernel information. +# Parameter: # NULL +# Returns: +# Return code: +# 0 on success +# 1 if something went wrong. +# ---------------------------------------------------------# +function Print_kernel_info (){ + Cmd "lsb_release -a" + Cmd "uname -a" +} + + +# ---------------------------------------------------------# +# Print_multipath_pkginfo()() +# Usage: +# print the multipath pacakge information +# Parameter: +# NULL +# Returns: +# Return code: +# 0 on success +# 1 if something went wrong. +# ---------------------------------------------------------# +function Print_multipath_pkginfo (){ + Cmd "rpm -qi device-mapper-multipath" + Cmd "rpm -qi kpartx" +} + + +# ---------------------------------------------------------# +# Setup_Multipath () +# Usage: +# return mpath_name if we have multipath devices, if not, +# we use scsi_debug to create a multipath device. +# Parameter: +# NULL +# Returns: +# Return code: +# 0 on success +# 1 if something went wrong. +# Return string: +# RETURN_STR # $mpath_name_list, like "mpath0 mpath1" +# ---------------------------------------------------------# + +function Setup_Multipath (){ + RETURN_STR='' + local mpath_name_list=$(dmsetup table \ + | perl -ne 'print "$1 " if /(mpath[a-z0-9]+):[0-9 ]+multipath.*/') + if [ "CHK${mpath_name_list}" != "CHK" ];then + mpath_name_list="$(echo ${mpath_name_list} | sed -e 's/ $//')" + echo "INFO: Found multipath devices: ${mpath_name_list}" +#RHEL 5 will disable some wwn mpath if we install OS with ondisk=mapper/mpath0 +# option, so we need to enable them all + if [ "CHK$(uname -r | egrep "2\.6\.18.*el5")" != "CHK" ];then + cat << AA > /etc/multipath.conf +defaults { + user_friendly_names yes +} +blacklist { + device { + vendor .* + product .* + } +} +blacklist_exceptions { + device { + vendor Linux + product scsi_debug + } + device { + vendor IQSTOR + product .* + } + device { + vendor NETAPP + product .* + } + device { + vendor HITACHI + product .* + } +} +AA + service multipathd start + sleep 5s #multipathd return premature + multipath -r + multipathd -k'reconfigure' + sleep 5s + mpath_name_list=$(dmsetup table \ + | perl -ne 'print "$1 " if /(mpath[a-z0-9]+):[0-9 ]+multipath.*/') + fi + if [ "CHK${mpath_name_list}" == "CHK" ];then + echo -n "FATAL: still no mulipath devices setup," + echo " check code in Setup_Multipath()" + RETURN_STR='' + return 1 + fi + RETURN_STR="${mpath_name_list}" + return 0 + fi +#setup scsi_debug + echo "INFO: Loading scsi_debug module for simulation of mpath" + modprobe scsi_debug vpd_use_hostno=0 add_host=2 + + echo "INFO: Waiting for udev to create /dev/sdX" + sleep 15s #wait for udev to create /dev/sdX + rpm -q device-mapper-multipath 2>/dev/null 1>/dev/null + if [ $? -ne 0 ];then + echo "INFO: Installing device-mapper-multipath via yum" + yum -y install device-mapper-multipath + fi +#enable multipath for scsi_debug. + cat << AA > /etc/multipath.conf +defaults { + user_friendly_names yes +} +blacklist { + device { + vendor .* + product .* + } +} +blacklist_exceptions { + device { + vendor Linux + product scsi_debug + } +} +AA + echo "INFO: /etc/multipath.conf updated" + cat /etc/multipath.conf + echo "INFO: Restarting multiapth and reload configuration" + service multipathd restart + sleep 5s #multipathd return premature + multipathd -k'reconfig' + sleep 5s + + mpath_name_list=$(dmsetup table | perl -ne 'print "$1 " if /(mpath[a-z0-9]+):[0-9 ]+multipath.*/') + if [ "CHK${mpath_name_list}" != "CHK" ];then + mpath_name_list="$(echo ${mpath_name_list} | sed -e 's/ $//')" + echo "INFO: found mpath: ${mpath_name_list}" + RETURN_STR="${mpath_name_list}" + return 0 + fi + return 1 +} #end of functoin Setup_Multipath + + +get_wwid_of_disk() +{ +# we should not use scsi_id or /dev/disk/by-id to get the wwid +# since multipath could replace the white spaces of wwid if +# having white spaces. we should use +# multipathd show paths format %w %d +# to get the wwid + + for dev in `ls /dev/disk/by-id/*` + do + if readlink $dev | grep -qw "$disk$" + then + wwid=$(basename $dev | sed 's/^[^-]*-//g') + break + fi + done + if test X$wwid = X + then + wwid=$(/lib/udev/scsi_id --page=0x83 --whitelisted --device=/dev/$disk) + fi + echo $wwid + +# multipathd_running || texit "multipathd is not running" +# local disk=$1 +# local wwid=$(multipathd show paths format %d,%w | grep "^$disk\s*," | \ +# awk -F, '{ print $2 }' | sed 's/\s//g') +# echo $wwid +} + diff --git a/tests/include/include.sh b/tests/include/include.sh new file mode 100755 index 0000000..5144b39 --- /dev/null +++ b/tests/include/include.sh @@ -0,0 +1,124 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + + + +#----------------------------------------------------------------------------# +# Mp_Conf_Up_Def () +# Usage: +# Update default section of /etc/multipath.conf, will also reload conf. +# Parameter: +# $config_change #config string want to change, like 'polling_interval 5' +# Returns: +# Return code: +# 0 on success +# 1 if something went wrong. +# Return string: +# NULL +#----------------------------------------------------------------------------# + +function Mp_Conf_Up_Def (){ + EX_USAGE=64 # Bad arg format + if [ $# -lt 1 ]; then + echo 'Usage: Mp_Conf_Up_Def $config_change' + exit "${EX_USAGE}" + fi + RETURN_STR='' + local multipath_conf_filename="/etc/multipath.conf" + local config_change="$1" + echo ${config_change} + if [ "CHK${config_change}" == "CHK" ];then + echo 'Usage: Mp_Conf_Up_Def $config_change' + exit "${EX_USAGE}" + fi + python2 -c " +import sys +sys.path.append('"${MP_INCLUDE_PATH}"') +from mpconf import * +update_df_section('""${config_change}""') +" +#TODO: we need to check configuration before we return 0 + RETURN_STR="" + return 0 +} #end of functoin Mp_Conf_Up_Def + + +# ---------------------------------------------------------# +# Print_multipath_pkginfo()() +# Usage: +# print the multipath pacakge information +# Parameter: +# NULL +# Returns: +# Return code: +# 0 on success +# 1 if something went wrong. +# ---------------------------------------------------------# +function Print_multipath_pkginfo (){ + Cmd "rpm -qi device-mapper-multipath" + Cmd "rpm -qi kpartx" +} + +# ---------------------------------------------------------# +# Mutipathd_stop() +# Usage: +# check if multipathd stops, if not stop it +# Parameter: +# NULL +# Returns: +# Return code: +# 0 on success +# 1 if something went wrong. +# ---------------------------------------------------------# +function Multipathd_stop (){ +# { ! Cmd pidof multipathd ; } || Cmd "service multipathd stop" + { ! Cmd pidof multipathd ; } || Cmd "kill -9 `pidof multipathd`" +} + +# ---------------------------------------------------------# +# Mutipathd_start() +# Usage: +# check if multipathd is installed, if not start it +# Parameter: +# NULL +# Returns: +# Return code: +# 0 on success +# 1 if something went wrong. +# ---------------------------------------------------------# +function Multipathd_start (){ +# { Cmd pidof multipathd ; } || Cmd "service multipathd start" + { Cmd pidof multipathd ; } || Cmd "multipathd" +} + +# ---------------------------------------------------------# +# Mutipath_installation() +# Usage: +# check if multipath starts, if not install it with yum +# Parameter: +# NULL +# Returns: +# Return code: +# 0 on success +# 1 if something went wrong. +# ---------------------------------------------------------# +function Multipath_installation (){ + Cmd "rpm -qi device-mapper-multipath" && return 0 + Cmd "yum install -y device-mapper-multipath" +} diff --git a/tests/include/mpath.sh b/tests/include/mpath.sh new file mode 100644 index 0000000..b894c27 --- /dev/null +++ b/tests/include/mpath.sh @@ -0,0 +1,155 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + + +# filename: loop.sh + +# USAGE + +test x$LXT_MPATH = x || return +LXT_MPATH=1 + +#source /mnt/tests/kernel/storage/include/bash_modules/lxt/tc.sh + +# make sure multipathd is running +get_mpath_disks() +{ + multipathd_running || texit "multipathd is not running" + multipathd -k'show maps' 2>/dev/null | grep '^mpath' | awk '{print +"/dev/mapper/" $1}' + return 0 +} + +# make sure multipathd is running +get_wwid_of_disk() +{ +# we should not use scsi_id or /dev/disk/by-id to get the wwid +# since multipath could replace the white spaces of wwid if +# having white spaces. we should use +# multipathd show paths format %w %d +# to get the wwid + + for dev in `ls /dev/disk/by-id/*` + do + if readlink $dev | grep -qw "$disk$" + then + wwid=$(basename $dev | sed 's/^[^-]*-//g') + break + fi + done + if test X$wwid = X + then + wwid=$(/lib/udev/scsi_id --page=0x83 --whitelisted --device=/dev/$disk) + fi + echo $wwid + +# multipathd_running || texit "multipathd is not running" +# local disk=$1 +# local wwid=$(multipathd show paths format %d,%w | grep "^$disk\s*," | \ +# awk -F, '{ print $2 }' | sed 's/\s//g') +# echo $wwid +} + +get_scsi_id() +{ + dev=$1 + wwid=$(/lib/udev/scsi_id --page=0x83 --whitelisted --device=$dev --replace-whitespace) + echo $wwid +} + +# make sure multipathd is running +get_mpath_disk_by_scsi_device() +{ +# multipathd_running || texit "multipathd is not running" + local disk=$1 + local mpath=$(multipathd show paths raw format "%d,%m" | grep "^$disk\s*," \ + | awk -F, '{ print $2 }' | sed 's/\s//g') + echo $mpath +} + +# make sure multipathd is running +get_major_minor_by_scsi_device() +{ + multipathd_running || texit "multipathd is not running" + local disk=$1 + local mm=$(multipathd show paths format %d,%D | grep "^$disk\s*," | \ + awk -F, '{ print $2 }' | sed 's/\s//g') + echo $mm +} + +# make sure multipathd is running +get_hcil_by_scsi_device() +{ + multipathd_running || texit "multipathd is not running" + local disk=$1 + local hcil=$(multipathd show paths format %d,%i | grep "^$disk\s*," | \ + awk -F, '{ print $2 }' | sed 's/\s//g') + echo $hcil +} + +# make sure multipathd is running +is_mpath() +{ + multipathd_running || texit "multipathd is not running" + local mpath=$1 + multipathd show maps format %n | grep -w "^$mpath" &> /dev/null +} + +multipathd_running() +{ + pidof multipathd &> /dev/null && return 0 + return 1 +} + +# will set find_multipaths no and start multipathd +setup_multipath() +{ + trun "rpm -q device-mapper-multipath || yum install -y device-mapper-multipath" || texit "fail to install multipath" + test -f /etc/multipath.conf && cp /etc/multipath.conf /etc/multipath.conf.storage_qe + trun "mpathconf --enable --find_multipaths n --with_multipathd y" + trun "multipath -r" +} + +clear_multipath() +{ + tlog "disable multipath and remove the mpath devices" + tlog "revert back the multipath.conf if has backup file" + test -f /etc/multipath.conf.storage_qe && cp /etc/multipath.conf.storage_qe /etc/multipath.conf &>/dev/null + ( multipath -q && multipath -F ) &>/dev/null + stop_multipathd +} + +get_unused_mpath() +{ + multipathd_running &>/dev/null || texit "multipathd is not running" + rootdisk=$(get_root_disk) + rootmpath=$(get_mpath_disk_by_scsi_device $rootdisk) + if is_null $rootmpath; then + $maps=$(multipathd show maps format "%n" | grep -v name) + else + $maps=$(multipathd show maps format "%n" | grep -v name | grep -v $rootmpath) + fi + + echo $maps +} + +stop_multipathd() { + tlog "stop multipathd" + ( pidof multipathd && service multipathd stop || pkill multipathd ) &>/dev/null +} diff --git a/tests/include/scsi_debug.sh b/tests/include/scsi_debug.sh new file mode 100644 index 0000000..8ec184f --- /dev/null +++ b/tests/include/scsi_debug.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + +# filename: function + +# USAGE + +test x$LXT_SCSI_DEBUG = x || return +LXT_SCSI_DEBUG=1 + + +get_scsi_debug_devices () +{ + ls /sys/block/sd* -d 2>/dev/null | while read dev; do + dev=$(basename $dev); + grep -qw scsi_debug /sys/block/$dev/device/model && echo "/dev/$dev" && break; + done + + return 0 +} diff --git a/tests/include/tc.sh b/tests/include/tc.sh new file mode 100755 index 0000000..9ad385d --- /dev/null +++ b/tests/include/tc.sh @@ -0,0 +1,272 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + +# filename: function + +# USAGE + +test x$LXT_TC = x || return +LXT_TC=1 + +# +# print the current date +# usage: d=$(tdate) +# +tdate () +{ + date '+%T' 2>/dev/null +} + +# +# print the log information +# usage: tlog "hello world" "WARNING" +# +tlog () +{ + local msg=$1 + local log_level=${2:-INFO} + local cur_date=$(tdate) + + echo "[$log_level][$cur_date]$msg" + + return 0 +} + +# +# run the cmd and format the log. return the exitint status of cmd +# use the global variables: tSTDOUT and tSTDERR to return the stdout and stderr +# usage: trun "ls" +# trun "ls"; echo $? +# stdout=$tSTDOUT +# stderr=$tSTDERR +# +trun () +{ + local cmd="$*" + + _trun_ "$cmd" +} + +# +# verify the execution of command +# if the cmd return 0, mark this checkpoint failed and return 1 +# if not, mark it passed and return 0 +# usage: tnot "ls /not_existing" +# +tnot () { + local cmd="$*" + _trun_ "$cmd" 1 + if test $? -eq 0; then + tfail_ "$cmd" ; + else + tpass_ "$cmd" ; + fi +} + +# +# verify the execution of command +# if the cmd return 0, mark this checkpoint passed and return 0 +# if not, mark it failed and return 1 +# usage: tok "ls /" +# +tok () +{ + local cmd="$*" + _trun_ "$cmd" 0 + if test $? -eq 0; then + tpass_ "$cmd" ; + else + tfail_ "$cmd" ; + fi +} + +# +# verify the execution of command +# if the cmd return 0, mark this checkpoint passed and return 0 +# if not, mark it failes and exit +# usage: terr "ls" +# +#terr () +#{ +# tok "$*" || tend +#} + +# +# verify the execution of command +# if the cmd return 0, will continue to run the script +# if not, mark it failes and exit +# usage: terr "ls" +# +terr () +{ + local cmd="$*" + _trun_ "$cmd" 0 + if test $? -ne 0; then + tfail_ "$cmd" ; + tend ; + fi +} + +# +# exit the program and print the log message +# usage: texit "error message" 100 +# similar to the exception +# +texit () +{ + msg=$1 + err=$2 + is_null $err && err=1 + test $err -lt 1 || err=1 + + tlog "$msg" "ERROR" + exit $2 +} + +# +# print the test report, cleanup the testing bed and close the testing. +# usage: tend +# +tend () +{ + local pcount=$(wc -l $tPASS_FILE | awk '{print $1}') + local fcount=$(wc -l $tFAIL_FILE | awk '{print $1}') + local total=$(( $pcount + $fcount )) + + echo "#################################Test Report###############################" + echo "TOTAL : $total" + echo "PASSED : $pcount" + echo "FAILED : $fcount" + cat $tPASS_FILE $tFAIL_FILE + echo "###########################End of running $0########################" + +#cleanup + rm -f $tPASS_FILE $tFAIL_FILE $tRETURN_FILE $tSTDERR_FILE +# rm -rf $LXT_TMP_DIR + if [[ $pcount -eq 0 ]] && [[ $total -eq 0 ]];then + exit 0 + fi + test $pcount -eq 0 && exit 1 + test $pcount -eq $total && exit 0 + exit 1 +} + +# +# private function +# + +# +# print the error message and call stack. return 1 +# +tfail_ () +{ + local msg=$* + tlog "$msg" "ERROR" >>$tFAIL_FILE + + return 1 +} + +# +# print the sucessful message. return 0 +# +tpass_ () +{ + local msg=$* + tlog "$msg" "PASS" >> $tPASS_FILE + + return 0 +} + +_trun_ () +{ + local cmd="$1" + local chk="$2" + local cur_date=$(tdate) + + local stdout=$(eval "$cmd" 2>$tSTDERR_FILE; echo $? >$tRETURN_FILE 2>/dev/null) +#timeout -- how to set timeout? + local exit_status=$(< $tRETURN_FILE) + local stderr=$(< $tSTDERR_FILE) + local msg=CMD +#tnot + if test x$chk = x1; then + test $exit_status -eq 0 || msg=PASS + test $exit_status -eq 0 && msg=FAIL +#should let the tester know this is the negative testing +#if cmd return 0 we will return 1 and vice versa + cmd="[NOT] $cmd" + fi +#tok + if test x$chk = x0; then + test $exit_status -eq 0 && msg=PASS + test $exit_status -eq 0 || msg=FAIL + fi + + tSTDOUT=$stdout + tSTDERR=$stderr + + test $tIGNORE_STDOUT -eq 1 && stdout='redirect the stdout to /dev/null' + test $tIGNORE_STDERR -eq 1 && stderr='redirect the stderr to /dev/null' + + echo "[$msg][$cur_date][$HOSTNAME]$cmd" + echo "STDOUT:" + test "x$stdout" = x || echo "$stdout" + echo "STDERR:$stderr" + echo "RETURN:$exit_status" + echo + + return $exit_status +} + +# +# setup the testing environment +# +_tsetup_ () +{ + + LXT_TMP_DIR="/mnt/testarea/lxt"; + + test -z "$HOSTNAME" && HOSTNAME=$(hostname) + test -d "$LXT_TMP_DIR" || mkdir -p "$LXT_TMP_DIR" >& /dev/null || exit 1 + + tSTDERR_FILE="$LXT_TMP_DIR/stderr.$$" + test -e "$tSTDERR_FILE" || > "$tSTDERR_FILE" || exit 1 + tRETURN_FILE="$LXT_TMP_DIR/return.$$" + test -e "$tRETURN_FILE" || > "$tRETURN_FILE" || exit 1 + tPASS_FILE="$LXT_TMP_DIR/tc.pass.$$" + test -e "$tPASS_FILE" || > "$tPASS_FILE" || exit 1 + tFAIL_FILE="$LXT_TMP_DIR/tc.fail.$$" + test -e "$tFAIL_FILE" || > "$tFAIL_FILE" || exit 1 +} + +# +# main +# + +# global variables +tIGNORE_STDOUT=0 +tIGNORE_STDERR=0 +tSTDOUT= +tSTDERR= +#LXT_TMP_DIR +# only used in this file +tPASS_FILE= +tFAIL_FILE= + +_tsetup_ diff --git a/tests/include/utils.sh b/tests/include/utils.sh new file mode 100755 index 0000000..404c3e8 --- /dev/null +++ b/tests/include/utils.sh @@ -0,0 +1,195 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + + +#summary of this script: +# this script is used to provide the generai utils for the automation script based on shell +# all the global variables should be upper case and began with under line since this script will be used by many scripts +# and we don't want the their value is be override by mistake + + +###############################global variables###################################### + +#the global variables should begin with under line plus some special keyword?? +#global variables, can be used by other scripts +#the stdout and stderr of the cmd execution in Cmd function +#can get the exit status of the Cmd function by $? +_STDOUT= +_STDERR= +#if set to 1 will not print the stdout and stderr in the function Cmd +#should set them to 0 after using it +_IGNORE_STDOUT=0 +_IGNORE_STDERR=0 + +#current hostname, same as the global variable HOSTNAME +#don't use readonly since we maybe source this file many times in the same shell environment +[ -z "$HOSTNAME" ] && HOSTNAME=$(hostname) + +#private global variables, only used in current script +#temp dir and files used by Cmd to capture the stderr and exit status of cmd execution +_TEMP_DIR="/tmp/lstf" +[ -d $_TEMP_DIR ] || mkdir -p $_TEMP_DIR >& /dev/null || Fail "failed to mkdir $_TEMP_DIR" + +_TEMP_STDERR_FILE="$_TEMP_DIR/stderr.$$" +[ -e $_TEMP_STDERR_FILE ] || touch $_TEMP_STDERR_FILE || Fail "failed to create $_TEMP_STDERR_FILE" +_TEMP_RETURN_FILE="$_TEMP_DIR/return.$$" +[ -e $_TEMP_RETURN_FILE ] || touch $_TEMP_RETURN_FILE || Fail "failed to create $_TEMP_RETURN_FILE" + +############################################################################################### + +#private function +#print the formated date string + +function _date_str (){ + date 2>/dev/null +} + +############################################################################################### +#summary: +# eval the paramters and format the output +# don't support stderr redirection in the passed command +#usage: +# Cmd ls -a +# if you don't want to print the stdout or stderr you can set the global variables _IGNORE_STDOUT and _IGNORE_STDERR, for example +# _IGNORE_STDOUT=1 +# Cmd ls -a +# _IGNORE_STDOUT=0 +#return: +# return the exit status of paramter value execution +# store the stdout and stderr to the global variables _STDOUT and _STDERR +############################################################################################### + +function Cmd (){ +#use the double qutoa to store all the arguments as a single string + local cmd="$*" + local date_str=$(_date_str) + local stdout=$(eval $cmd 2>$_TEMP_STDERR_FILE; echo $? >$_TEMP_RETURN_FILE 2>/dev/null) + +#why cannot get the exit status of the value of eval by this ? +# local exit_status=$? +#remove the \n hence don't use this method +# local exit_status=$(cat $_TEMP_RETURN_FILE) + + local exit_status=$(< $_TEMP_RETURN_FILE) + local stderr=$(< $_TEMP_STDERR_FILE) + + _STDOUT=$stdout + _STDERR=$stderr + +#will not print the stdout and stderr if the 2 global variables set to 1 + [ $_IGNORE_STDOUT -eq 1 ] && stdout='redirect the stdout to /dev/null' + [ $_IGNORE_STDERR -eq 1 ] && stderr='redirect the stderr to /dev/null' + + echo "[CMD][$date_str][$HOSTNAME]#$cmd" + echo "STDOUT:$stdout" + echo "STDERR:$stderr" + echo "RETURN:$exit_status" + echo + + return $exit_status +} + +############################################################################################### +#summary: +# print the formated log +# consider filter the output through the level +# level should be INFO, ERROR, WARNING, PASSED +#usage: +# Log "msg" "level" +# Log "msg" +# don't use it like this : Log msg level +#return: +# 0 +############################################################################################### + +#should redirect io to stderr if log_level is error? + +function Log (){ + local msg=$1 + local log_level=${2:-INFO} + local date_str=$(_date_str) + + echo "[$log_level][$date_str]:$msg" + echo + + return 0 +} + +############################################################################################### +#summary: +# print the formated error message, call stack information and exit the program with 1 +#usage: +# Fail error_msg +#exit: +# 1 +############################################################################################### + +function Fail (){ + local msg=$* + local stack=`caller 0` + + Log "$stack" + Log "$msg" "ERROR" + + exit 1 +} + +############################################################################################### +#summary: +# print the formated passed message and exit the program with 0 +#usage: +# Pass +#exit: +# 0 +############################################################################################### + +function Pass (){ + Log "Test case passed" "PASSED" + + exit 0 +} + +############################################################################################### +#summary: +# assert the expression, +# if the exiting status of the expression is not 0 fail the case and print the failed message +# if 0 do nothing just return 0 +#usage: +# Assert "$exit_status -eq 0" "failed string" +# Assert "ls /dev/sdb" "failed string" +#return/exit: +# the exiting value of expression +############################################################################################### + +function Assert (){ +#should consider the expr is integra or expression, script? + local expr=$1 + local failed_msg=$2 + [ $expr ] || Fail "$failed_msg" + + return 0 +} + +is_null() +{ + local string=$1 + string=$(echo $string | sed 's/\s//g') + test -z $string +} + diff --git a/tests/kpartx_4k_aligned/LICENSE b/tests/kpartx_4k_aligned/LICENSE new file mode 100644 index 0000000..10926e8 --- /dev/null +++ b/tests/kpartx_4k_aligned/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/tests/kpartx_4k_aligned/PURPOSE b/tests/kpartx_4k_aligned/PURPOSE new file mode 100644 index 0000000..077ff82 --- /dev/null +++ b/tests/kpartx_4k_aligned/PURPOSE @@ -0,0 +1,7 @@ +steps: +1. create a scsi_debug device with 4k physical sector +2. make sure multipathd didn't create device mapper device for it +3. partition it with gpt format +4. use gdisk -l and kpart -l to check this disk +5. make sure the begin sectors and end sectors are identity in both report + diff --git a/tests/kpartx_4k_aligned/main.sh b/tests/kpartx_4k_aligned/main.sh new file mode 100755 index 0000000..530637a --- /dev/null +++ b/tests/kpartx_4k_aligned/main.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + +source ../include/ec.sh || exit 200 + +function gpt_partitioned_dev() { + local dev=$1 + { for i in {1..4}; do + echo -e "n\n\n\n+1M\n\n" + done; echo w; echo y; } | gdisk $dev &> /dev/null +} + +function extract_section_info_from_gdisk() { + local dev=$1 + local node=$(basename $dev) + gdisk -l $dev | awk -v dev=$node 'start==1{print dev $1,$2,$3};/Number/{start=1}' +} + +function extract_section_info_from_kpartx() { + local dev=$1 + kpartx -l $dev | awk '{ print $1, $NF, $NF+$4-1 }' +} + +tlog "running $0" + +rpm -q device-mapper-multipath || yum install -y device-mapper-multipath +rpm -q gdisk || yum install -y gdisk + +# eliminate the possibility multipathd create device for new path +trun "service multipathd stop" + +# create a device with 4k physical sector +trun "modprobe -r scsi_debug" +trun "modprobe scsi_debug sector_size=512 physblk_exp=3 &> /dev/null" + +scsi_debug_dev=$(get_scsi_debug_devices) + +trun "gpt_partitioned_dev $scsi_debug_dev" +sleep 3 + +trun "extract_section_info_from_gdisk $scsi_debug_dev" +result_of_gdisk=$tSTDOUT +trun "extract_section_info_from_kpartx $scsi_debug_dev" +result_of_kpartx=$tSTDOUT + +tlog "result_of_kpartx=$result_of_kpartx" +tlog "result_of_gdisk=$result_of_gdisk" +tok '[[ "$result_of_kpartx" == "$result_of_gdisk" ]]' + +sleep 3 +trun "modprobe -r scsi_debug" + +tend diff --git a/tests/medium_error_scsi_debug/LICENSE b/tests/medium_error_scsi_debug/LICENSE new file mode 100644 index 0000000..10926e8 --- /dev/null +++ b/tests/medium_error_scsi_debug/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/tests/medium_error_scsi_debug/PURPOSE b/tests/medium_error_scsi_debug/PURPOSE new file mode 100644 index 0000000..88fa796 --- /dev/null +++ b/tests/medium_error_scsi_debug/PURPOSE @@ -0,0 +1,8 @@ +multipath: Test that some fatal errors which should not be retried, for example a medium error, correctly generate an I/O error and do not get infinitely retried. + +steps: +1.# modprobe scsi_debug num_tgts=1 vpd_use_hostno=0 add_host=2 delay=20 max_luns=2 no_lun_0=1 opts=2 +2.# multipath -ll | grep -C 5 scsi_debug +3.# dd if=/dev/zero of=/dev/mapper/$mpathdev bs=1024 seek=2330 count=10 +4. check if an I/O error generated + diff --git a/tests/medium_error_scsi_debug/main.sh b/tests/medium_error_scsi_debug/main.sh new file mode 100755 index 0000000..35c6e6f --- /dev/null +++ b/tests/medium_error_scsi_debug/main.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: LiLin +source ../include/tc.sh || exit 200 + +cleanup() +{ + sleep 5 + udevadm settle + trun "multipath -DF" + sleep 5 + trun "modprobe -r scsi_debug" +} + +assert () +{ + local cmd="$*" + _trun_ "$cmd" 0 + if test $? -eq 0; then + tpass_ "$cmd" ; + else + tfail_ "$cmd" ; + cleanup ; + tend ; + fi +} + +tlog "running $0" +rpm -q device-mapper-multipath || dnf install -y device-mapper-multipath +trun "multipathd disablequeueing maps" +cleanup +trun "service multipathd stop" +trun "rm -f /etc/multipath.conf" +trun "mpathconf --enable" +trun "modprobe scsi_debug vpd_use_hostno=0 add_host=2 opts=2" +sleep 5 +trun "multipath" +sleep 5 +trun "multipath -l" +mpathdev=`multipath -l | grep scsi_debug | awk '{print $1}' | head -1` +assert "[[ -n \"$mpathdev\" ]]" +before_active=`multipath -l $mpathdev | grep "active undef" | wc -l` +tlog "before active = ${before_active}" + +IO_error=`dd if=/dev/zero of=/dev/mapper/$mpathdev bs=1024 seek=2330 count=10 2>&1 | grep -o "Input/output error" ` +assert "[[ -n \"$IO_error\" ]]" +after_active=`multipath -l $mpathdev | grep "active undef" | wc -l` +tlog "after active = ${after_active}" +assert "[[ \"$before_active\" -eq \"$after_active\" ]]" +cleanup +tend diff --git a/tests/multipath_conf_syntax/LICENSE b/tests/multipath_conf_syntax/LICENSE new file mode 100644 index 0000000..10926e8 --- /dev/null +++ b/tests/multipath_conf_syntax/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/tests/multipath_conf_syntax/Makefile b/tests/multipath_conf_syntax/Makefile new file mode 100644 index 0000000..b3f7007 --- /dev/null +++ b/tests/multipath_conf_syntax/Makefile @@ -0,0 +1,49 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# # +# # This program is free software: you can redistribute it and/or modify +# # it under the terms of the GNU General Public License as published by +# # the Free Software Foundation, either version 3 of the License, or +# # (at your option) any later version. +# # +# # This program is distributed in the hope that it will be useful, +# # but WITHOUT ANY WARRANTY; without even the implied warranty of +# # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# # GNU General Public License for more details. +# # +# # You should have received a copy of the GNU General Public License +# # along with this program. If not, see . +# +# # Author: Lin Li + +.PHONY: all install download clean + +BUILT_FILES= + +FILES=$(METADATA) Makefile PURPOSE main.sh + +run: $(FILES) build + ./main.sh + +build: $(BUILT_FILES) + chmod a+x ./main.sh + +clean: + rm -f *~ *.rpm $(BUILT_FILES) + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @touch $(METADATA) + @echo "Owner: LiLin " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "License: GPLv3" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: multipath_conf_syntax" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: device-mapper-multipath" >> $(METADATA) + @echo "Requires: device-mapper-multipath" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/multipath_conf_syntax/PURPOSE b/tests/multipath_conf_syntax/PURPOSE new file mode 100644 index 0000000..2ee0ecf --- /dev/null +++ b/tests/multipath_conf_syntax/PURPOSE @@ -0,0 +1,175 @@ +============================================================ + +Below is the test design and scenario: +a) +multipaths { + multipath{ + wwid "35333333000002710" + alias "path2 <-missing closing quote on alias + } +} +# multipath -r +May 26 14:20:17 | missing closing quotes on line 56 of config file +May 26 14:20:17 | 35333333000002710: rename path1 to path2 +rename: path2 (35333333000002710) undef Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=undef +`-+- policy='round-robin 0' prio=1 status=undef + `- 4:0:0:0 sdb 8:16 active ready running +# multipath -ll +May 26 14:20:28 | missing closing quotes on line 56 of config file +path2 (35333333000002710) dm-3 Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=rw +`-+- policy='round-robin 0' prio=1 status=active + `- 4:0:0:0 sdb 8:16 active ready running + +b) +multipaths { + multipath{ + wwid "35333333000002710" + alias <- no value for alias + } +} +# multipath -r +May 26 14:28:10 | missing value for option 'alias' on line 56 of config file +May 26 14:28:10 | 35333333000002710: rename path3 to mpathb +rename: mpathb (35333333000002710) undef Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=undef +`-+- policy='round-robin 0' prio=1 status=undef + `- 4:0:0:0 sdb 8:16 active ready running + +c) +multipaths { + multipath{ + wwid "35333333000002710" + alias path5" <-missing starting quote on alias + } +} +# multipath -r +May 26 15:19:46 | ignoring extra data starting with '"' on line 56 of config file +May 26 15:19:46 | 35333333000002710: rename path4' to path5 +rename: path5 (35333333000002710) undef Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=undef +`-+- policy='round-robin 0' prio=1 status=undef + `- 4:0:0:0 sdb 8:16 active ready running + +d) +multipaths { + multipath{ + wwid "35333333000002710" + alias 'path5" <- unmatched quote on alias + } +} +# multipath -r +May 26 15:22:30 | ignoring extra data starting with '"' on line 56 of config file +May 26 15:22:30 | 35333333000002710: rename path5 to 'path5 +rename: 'path5 (35333333000002710) undef Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=undef +`-+- policy='round-robin 0' prio=1 status=undef + +e) +multipaths { + multipath{ + wwid "35333333000002710" + alias 'path5 <-missing and wrong quote on alias + } +} +# multipath -r +reload: 'path5 (35333333000002710) undef Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=undef +`-+- policy='round-robin 0' prio=1 status=undef + `- 4:0:0:0 sdb 8:16 active ready running +# multipath -ll +'path5 (35333333000002710) dm-3 Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=rw +`-+- policy='round-robin 0' prio=1 status=active + `- 4:0:0:0 sdb 8:16 active ready running +note: rename to unexpected 'path5 -> it's correct for current design + +f) +multipaths { + multipath{ + wwid "35333333000002710" + alias <- wrong quote on alias + } +} +# multipath -r +May 26 15:27:42 | 35333333000002710: rename path5' to +rename: (35333333000002710) undef Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=undef +`-+- policy='round-robin 0' prio=1 status=undef + `- 4:0:0:0 sdb 8:16 active ready running +note: rename to unexpected -> it's correct for current design + +g) +multipaths { + multipath{ + wwid "35333333000002710" + alias path test <- have a space + } +} +# multipath -r +May 26 15:29:52 | ignoring extra data starting with 'test' on line 56 of config file +May 26 15:29:52 | 35333333000002710: rename path_test to path +rename: path (35333333000002710) undef Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=undef +`-+- policy='round-robin 0' prio=1 status=undef + `- 4:0:0:0 sdb 8:16 active ready running + +h) +multipaths { + multipath{ + wwid "35333333000002710" + alia "path" <- wrong alias keyword + } +} +# multipath -r +May 26 15:33:54 | multipath.conf line 56, invalid keyword: alia +reload: mpathb (35333333000002710) undef Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=undef +`-+- policy='round-robin 0' prio=1 status=undef + `- 4:0:0:0 sdb 8:16 active ready running + +i) +multipaths{ <- no space between the section name and the open bracket that followed it, the original is "multipaths {" + multipath{ + wwid "35333333000002710" + alias "mypath" + } +} +# multipath -r +May 29 10:13:01 | 35333333000002710: rename mpathb to mypath +rename: mypath (35333333000002710) undef Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=undef +`-+- policy='round-robin 0' prio=1 status=undef + `- 4:0:0:0 sdb 8:16 active ready running +note: fix issue about if a section doesn't have a space between the section name and the open bracket, that section isn't read in. + +j) +ultipaths{ <- wrong section keyword + multipath{ + wwid "35333333000002710" + alias "mypath" + } +} +# multipath -r +May 29 10:49:33 | multipath.conf line 53, invalid keyword: ultipaths +May 29 10:49:33 | multipath.conf line 54, invalid keyword: multipath +May 29 10:49:33 | multipath.conf line 55, invalid keyword: wwid +May 29 10:49:33 | multipath.conf line 56, invalid keyword: alias +May 29 10:49:33 | unmatched '}' at line 57 of config file +May 29 10:49:33 | multipath.conf line 57, invalid keyword: } +May 29 10:49:33 | unmatched '}' at line 58 of config file +May 29 10:49:33 | multipath.conf line 58, invalid keyword: } +May 29 10:49:33 | 35333333000002710: rename mypath to mpathb +rename: mpathb (35333333000002710) undef Linux,scsi_debug +size=8.0M features='0' hwhandler='0' wp=undef +`-+- policy='round-robin 0' prio=1 status=undef + `- 4:0:0:0 sdb 8:16 active ready running + +tested with incorrect keywords in the following sections: + default + blacklist + blacklist_exceptions + devices + multipaths + diff --git a/tests/multipath_conf_syntax/main.sh b/tests/multipath_conf_syntax/main.sh new file mode 100755 index 0000000..fb303c3 --- /dev/null +++ b/tests/multipath_conf_syntax/main.sh @@ -0,0 +1,145 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + +source ../include/ec.sh || exit 200 +tlog "running $0" + +cleanup () +{ + trun "multipathd disablequeueing maps" + sleep 5 + trun "multipath -F" + trun "service multipathd stop" + sleep 5 + trun "udevadm settle" + trun "modprobe -r scsi_debug" +} + +assert () +{ + local cmd="$*" + _trun_ "$cmd" 0 + if test $? -eq 0; then + tpass_ "$cmd" ; + else + tfail_ "$cmd" ; + cleanup ; + tend ; + fi +} + +rpm -q device-mapper-multipath || yum install -y device-mapper-multipath + +# cleanup existing devices and restart +cleanup +trun "rm -f /etc/multipath.conf" +trun "mpathconf --enable --with_module y --with_multipathd n --find_multipaths n" +sed -i '/^blacklist[[:space:]]*{/ a\ + device {\n vendor ".*"\n product ".*"\n } +' /etc/multipath.conf +if grep -qw blacklist_exceptions /etc/multipath.conf ; then + sed -i '/^blacklist_exceptions[[:space:]]*{/ a\ + device {\n vendor Linux\n product scsi_debug\n } +' /etc/multipath.conf +else + cat << _EOF_ >> /etc/multipath.conf +blacklist_exceptions { + device { + vendor Linux + product scsi_debug + } +} +_EOF_ +fi + +trun "cp /etc/multipath.conf /etc/multipath.conf.bak" +trun "service multipathd stop" +trun "service multipathd start" + +trun "modprobe scsi_debug" +sleep 5 +trun "multipath -ll" +pathcount=`multipathd show maps format %w | grep -v uuid | wc -l` +assert "[[ $pathcount -eq 1 ]]" +wwid=`multipathd show maps format %w | grep -v uuid` + +# test missing closing quote on alias +cat << _EOF_ >> /etc/multipath.conf +multipaths { + multipath { + wwid "$wwid" + alias "mypath + } +} +_EOF_ +tok "multipath 2>&1 | grep 'missing closing quotes on line'" +trun "multipath -r" +tok "multipath -ll | grep mypath" + +# test no value for alias +trun "sed -i 's/alias.*$/alias/g' /etc/multipath.conf" +multipath +tok "multipath 2>&1 | grep \"missing value for option 'alias' on line\"" +trun "multipath -r" +tok "multipath -ll | grep mpath" + +# test missing starting quote on alias +trun "sed -i 's/alias.*$/alias mypath\"/g' /etc/multipath.conf" +tok "multipath 2>&1 |grep 'ignoring extra data starting with'" +trun "multipath -r" +tok "multipath -ll | grep mypath" + +# test wrong quote on alias +trun "sed -i 's/alias.*$/alias /g' /etc/multipath.conf" +tnot "multipath 2>&1 | grep config" +trun "multipath -r" +tok "multipath -ll | grep ''" + +# test value has a space +trun "sed -i 's/alias.*$/alias mypath test/g' /etc/multipath.conf" +tok "multipath 2>&1 |grep 'ignoring extra data starting with'" +trun "multipath -r" +tok "multipath -ll | grep mypath" + +# test wrong alias keyword +trun "sed -i 's/alias.*$/alia mypath/g' /etc/multipath.conf" +tok "multipath 2>&1 | grep 'invalid keyword in the multipath section: alia'" +trun "multipath -r" +tok "multipath -ll | grep mpath" +trun "sed -i 's/alia.*$/alias mypath/g' /etc/multipath.conf" + +# test no space between the section name and the open bracket that followed it +# fix issue about if a section doesn't have a space between the section name +# and the open bracket, that section isn't read in. +trun "sed -i 's/multipaths.*/multipaths{/g' /etc/multipath.conf" +tnot "multipath 2>&1 | grep config" +trun "multipath -r" +tok "multipath -ll |grep mypath" + +# test wrong section keywords +trun "sed -i 's/multipaths.*/ultipaths {/g' /etc/multipath.conf" +tok "multipath 2>&1 | grep 'invalid keyword: ultipaths'" +trun "sed -i 's/defaults.*/efaults {/g' /etc/multipath.conf" +tok "multipath 2>&1 | grep 'invalid keyword: efaults'" +trun "sed -i 's/blacklist {/lacklist {/g' /etc/multipath.conf" +tok "multipath 2>&1 | grep 'invalid keyword: lacklist'" +trun "mv /etc/multipath.conf.bak /etc/multipath.conf" + +cleanup +tend diff --git a/tests/multipathd_oom/LICENSE b/tests/multipathd_oom/LICENSE new file mode 100644 index 0000000..10926e8 --- /dev/null +++ b/tests/multipathd_oom/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/tests/multipathd_oom/PURPOSE b/tests/multipathd_oom/PURPOSE new file mode 100644 index 0000000..fbeab48 --- /dev/null +++ b/tests/multipathd_oom/PURPOSE @@ -0,0 +1,14 @@ +the oom_adj is -17 and oom_score_adj is -1000 after installing device-mapper-multipath-0.4.9-53.el6.x86_64 and starting multipathd. +This means multipathd will never be selected to be killed by oom according to the kernel doc. + + +Here are the steps to reproduce this issue. +1. create a multipathed disk /dev/mapper/mpathb via scsi_debug using all the free memory. this will consume most of the free mem. +2. io stress on the multipath disk, this step is option. +#dd if=/dev/zero of=/dev/mapper/mpathb & +3. consuming the free mem +#for i in `seq 10000`; do array[$i]=$( /proc/sysrq-trigger ; done +5. check the console or /var/log/message if multipathd is killed + diff --git a/tests/multipathd_oom/main.sh b/tests/multipathd_oom/main.sh new file mode 100755 index 0000000..9961d2d --- /dev/null +++ b/tests/multipathd_oom/main.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + + +source ../include/ec.sh || exit 200 + +function main (){ + Multipath_installation || Fail "fail to install device-mapper-multipath" + Print_kernel_info + Print_multipath_pkginfo + + local exit_status=0 + local oom_adj oom_score_adj oom_score lock_file + +# Log "do not kill the mingetty and sshd by oom_killer" +# Cmd "pidof mingetty" +# local ttys=$_STDOUT +# Cmd "pidof sshd" +# ttys="$ttys $_STDOUT" +# Cmd "for t in $ttys; do echo -1000 > /proc/\$t/oom_score_adj; done" + + Multipathd_start || Fail "fail to start multipathd" + local pid=$(pidof multipathd) +#this bug is for 6.2 has oom_score_adj + Cmd "[ -r /proc/$pid/oom_score_adj ]" || Fail "oom_score_adj not existing, do NOT support this kernel version" + + Cmd "cat /proc/$pid/oom_adj" + oom_adj=$_STDOUT + Cmd "cat /proc/$pid/oom_score_adj" + oom_score_adj=$_STDOUT + Cmd "cat /proc/$pid/oom_score" + oom_score=$_STDOUT + +#should set the oom_adj to -17 and oom_score_adj to -1000 so that multipathd will never be selected to kill by oom_killer + [ X"$oom_adj" = X"-17" ] || Fail "oom_adj is not -17" + [ X"$oom_score_adj" = X"-1000" ] || Fail "oom_score_adj is not -1000" + +# we don't need to test the real oom action. just check the oom_adj + Multipathd_stop || Fail "fail to stop multipathd" + return $exit_status +} + +main || Fail "multipathd invokes oom_killer" + +Pass diff --git a/tests/restate_module/LICENSE b/tests/restate_module/LICENSE new file mode 100644 index 0000000..10926e8 --- /dev/null +++ b/tests/restate_module/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/tests/restate_module/Makefile b/tests/restate_module/Makefile new file mode 100755 index 0000000..3f0a060 --- /dev/null +++ b/tests/restate_module/Makefile @@ -0,0 +1,49 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# # +# # This program is free software: you can redistribute it and/or modify +# # it under the terms of the GNU General Public License as published by +# # the Free Software Foundation, either version 3 of the License, or +# # (at your option) any later version. +# # +# # This program is distributed in the hope that it will be useful, +# # but WITHOUT ANY WARRANTY; without even the implied warranty of +# # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# # GNU General Public License for more details. +# # +# # You should have received a copy of the GNU General Public License +# # along with this program. If not, see . +# +# # Author: Lin Li + +.PHONY: all install download clean + +BUILT_FILES= + +FILES=$(METADATA) Makefile PURPOSE main.sh + +run: $(FILES) build + ./main.sh + +build: $(BUILT_FILES) + chmod a+x ./main.sh + +clean: + rm -f *~ *.rpm $(BUILT_FILES) + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @touch $(METADATA) + @echo "Owner: LiLin " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "License: GPLv3" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: restate_module" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: device-mapper-multipath" >> $(METADATA) + @echo "Requires: device-mapper-multipath" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/restate_module/PURPOSE b/tests/restate_module/PURPOSE new file mode 100755 index 0000000..d86589c --- /dev/null +++ b/tests/restate_module/PURPOSE @@ -0,0 +1 @@ +Description:segfault in multipathd when 'multipath -r' is run during faulty paths diff --git a/tests/restate_module/main.sh b/tests/restate_module/main.sh new file mode 100755 index 0000000..be60eba --- /dev/null +++ b/tests/restate_module/main.sh @@ -0,0 +1,95 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + +source ../include/ec.sh || exit 200 +tlog "running $0" + +cleanup () +{ + trun "multipathd disablequeueing maps" + trun "service multipathd stop" + sleep 5 + trun "udevadm settle" + trun "multipath -F" + sleep 5 + trun "modprobe -r scsi_debug" +} + +assert () +{ + local cmd="$*" + _trun_ "$cmd" 0 + if test $? -eq 0; then + tpass_ "$cmd" ; + else + tfail_ "$cmd" ; + cleanup ; + tend ; + fi +} + +rpm -q device-mapper-multipath || yum install -y device-mapper-multipath +tlog "device-mapper-multipath is installed" +# cleanup existing devices +trun "rm /etc/multipath.conf" +trun "mpathconf --enable --with_module y --option max_polling_interval:10" +trun "mpathconf --option detect_pgpolicy_use_tpg:yes" +trun "service multipathd stop" +trun "multipath -F" +sleep 5 +trun "modprobe -r scsi_debug" + +#trun "service multipathd restart" +trun "service multipathd start" +trun "modprobe scsi_debug vpd_use_hostno=0 add_host=2" +sleep 5 +mpathdev=`multipath -l | grep scsi_debug | awk '{print $1}' | head -1` +tlog "using multipathd device ${mpathdev}" +trun "multipath -ll ${mpathdev}" +pathcount=`multipathd show paths raw format "%m %t" | grep ${mpathdev} | grep "active" | wc -l` +tlog "Checking if active path count equals 2" +assert "[[ $pathcount -eq 2 ]]" + +tlog "offline one path device" +pathname=`multipathd show paths raw format "%d %m %p" | grep ${mpathdev} | sort -k 3n | head -1 | awk '{print $1}'` +tlog "path to offline: ${pathname}" +trun "echo 'offline' > /sys/block/${pathname}/device/state" +tlog "waiting for multipathd to fail path" +sleep 15 +trun "multipathd show paths" +pathcount=`multipathd show paths raw format "%m %t" | grep ${mpathdev} | grep "active" | wc -l` +tlog "Checking if active path count equals 1" +assert "[[ $pathcount -eq 1 ]]" + +tlog "restore ${pathname}" +trun "echo 'running' > /sys/block/${pathname}/device/state" +sleep 10 +#verified +multipathd_state=`service multipathd status | grep "Active: active (running)" | wc -l` +tlog "Checking if multipathd service is running" +assert "[[ $multipathd_state -eq 1 ]]" +pathcount=`multipathd show paths raw format "%m %t" | grep ${mpathdev} | grep "active" | wc -l` +tlog "Checking if active path count equals 2" +assert "[[ $pathcount -eq 2 ]]" +path_state=`multipathd show paths raw format "%d %t %T %o" | grep ${pathname} | grep "active ready running" | wc -l` +tlog "Checking state of ${pathname}" +assert "[[ $path_state -eq 1 ]]" + +cleanup +tend diff --git a/tests/squelch_scsi_id/LICENSE b/tests/squelch_scsi_id/LICENSE new file mode 100644 index 0000000..10926e8 --- /dev/null +++ b/tests/squelch_scsi_id/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/tests/squelch_scsi_id/PURPOSE b/tests/squelch_scsi_id/PURPOSE new file mode 100644 index 0000000..348fc3d --- /dev/null +++ b/tests/squelch_scsi_id/PURPOSE @@ -0,0 +1,8 @@ +/sbin/multipath -ll executes scsi_id on failed paths, resulting in needlessly verbose error messages + +steps: +1. use scsi_debug to create a multipathed disk +2. execute multipath -v2 and multipath -ll to list the device +3. fail the multipathed disk by executing 'echo 0 > /sys/bus/pseudo/drivers/scsi_debug/max_luns' +4. execute 'multipath -v2' +5. observe if have some similar message to '/lib/udev/scsi_id exitted with 1' diff --git a/tests/squelch_scsi_id/main.sh b/tests/squelch_scsi_id/main.sh new file mode 100755 index 0000000..e75619a --- /dev/null +++ b/tests/squelch_scsi_id/main.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + +source ../include/ec.sh || exit 200 + +function main (){ + local exit_status=1 + + Multipath_installation || Fail "fail to install device-mapper-multipath" + Print_kernel_info + Print_multipath_pkginfo + + local stdout stderr + + Log "create the multipathed disk via scsi_debug" + _init || Fail "fail to create the multipathed disk" + Cmd "multipath -ll" + Log "fail the multipathed disk" + Cmd "echo 0 > /sys/bus/pseudo/drivers/scsi_debug/max_luns" + Log "check the output of multipath & multipath -ll $mpath" +#will print the unexpected output if the issue is still there +#multipath to scan disks + Cmd "multipath ; multipath -ll $mpath" + stdout=${_STDOUT} + stderr=${_STDERR} +#mark as pass if no scsi_id error message observered + echo $stdout $stderr | grep '/lib/udev/scsi_id exitted' 1>/dev/null || exit_status=0 + Cmd "echo 2 > /sys/bus/pseudo/drivers/scsi_debug/max_luns" + Cmd "multipath ; multipath -ll $mpath" + _destroy + + return $exit_status +} + +main || Fail "still print the message: scsi_id exitted while scanning the failed path" + +Pass + diff --git a/tests/user_friendly_names/LICENSE b/tests/user_friendly_names/LICENSE new file mode 100644 index 0000000..10926e8 --- /dev/null +++ b/tests/user_friendly_names/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/tests/user_friendly_names/PURPOSE b/tests/user_friendly_names/PURPOSE new file mode 100644 index 0000000..a768f92 --- /dev/null +++ b/tests/user_friendly_names/PURPOSE @@ -0,0 +1,57 @@ + +flow: + +# use user_friendly_names = no +- login to iscsi target +- run multipath -r +- device appear with their original name + +# use user_friendly_names = yes, configure some aliases +- run multipath -r +- device appear with their alias name + +# edit /etc/multipath.conf again, and change use user_friendly_names = +# no +- run multipath -r +- device appear with their alias name + +the rename should work backwards + + + +# conf when using user_friendly_names = yes +defaults { + polling_interval 5 + getuid_callout "/lib/udev/scsi_id -g -u -d /dev/%n" + no_path_retry fail + user_friendly_names yes + flush_on_last_del yes + fast_io_fail_tmo 5 + dev_loss_tmo 30 + max_fds 4096 +} + +multipaths { + + multipath { + wwid 36090a068a0746b89ddee943b5b253db6 + alias rhev-a24-01_myDev1 + } + multipath { + wwid 36090a068a074fb95ddeee43b5b259da7 + alias rhev-a24-01_myDev2 + } +} + +# conf when using user_friendly_names = no + +defaults { + polling_interval 5 + getuid_callout "/lib/udev/scsi_id -g -u -d /dev/%n" + no_path_retry fail + user_friendly_names no + flush_on_last_del yes + fast_io_fail_tmo 5 + dev_loss_tmo 30 + max_fds 4096 +} diff --git a/tests/user_friendly_names/main.sh b/tests/user_friendly_names/main.sh new file mode 100755 index 0000000..1d48801 --- /dev/null +++ b/tests/user_friendly_names/main.sh @@ -0,0 +1,141 @@ +#!/bin/bash + +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Author: Lin Li + +source ../include/tc.sh || exit 200 +tlog "running $0" + +cleanup () +{ + local retries + if pidof multipathd; then + tlog "stopping multipathd" + trun "systemctl stop multipathd.service || pkill multipathd" + sleep 1 + fi + retries=10 + while pidof multipathd; do + ((retries--)) + if [[ $retries -le 0 ]]; then + tfail_ "failed to stop multipath" + tend + fi + tlog "waiting for multipathd to stop" + sleep 2 + pidof multipathd && pkill multipathd + done + trun "multipath -l -v1" + retries=10 + while [[ -n `multipath -l -v1` ]]; do + ((retries--)) + if [[ $retries -le 0 ]]; then + tfail_ "failed to remove deviece" + tend + fi + tlog "removing multipath device" + trun "udevadm settle" + trun "multipath -DF" + sleep 2 + done + if lsmod | grep -q "^scsi_debug"; then + tlog "removing scsi_debug module" + tok "rmmod scsi_debug" + fi + trun "rm -f /etc/multipath.conf" +} + +assert () +{ + local cmd="$*" + _trun_ "$cmd" 0 + if test $? -eq 0; then + tpass_ "$cmd" ; + else + tfail_ "$cmd" ; + cleanup ; + tend ; + fi +} + +setup_config () +{ + trun "mpathconf --enable --user_friendly_names y" + sed -i '/^blacklist[[:space:]]*{/ a\ + device {\ + vendor ".*"\ + product ".*"\ + } +' /etc/multipath.conf + cat << _EOF_ >> /etc/multipath.conf + +blacklist_exceptions { + device { + vendor Linux + product scsi_debug + } +} + +multipaths { + multipath { + wwid TEST_WWID + alias test + } +} +_EOF_ + trun "cat /etc/multipath.conf" +} + +do_reconfigure () +{ + trun "cat /etc/multipath.conf" + tok "multipathd reconfigure" + sleep 5 +} + +trun "rpm -q device-mapper-multipath || dnf install -y device-mapper-multipath" +cleanup +setup_config +trun "rm -r /etc/multipath/bindings" +trun "modprobe scsi_debug vpd_use_hostno=0 add_host=2" +sleep 5 +trun "systemctl start multipathd.service" +while multipathd show daemon | grep -qv idle; do + tlog "waiting for multipathd to start" + sleep 1 +done +trun 'multipathd show maps raw format "%n %w"' +# verify user_friendly_name +tok 'multipathd show maps raw format "%n" | head -1 | grep -q mpath' +wwid=`multipathd show maps raw format "%w" | head -1` +assert "[[ -n $wwid ]] && [[ $wwid != ok ]]" +sed -i 's/TEST_WWID/'"$wwid"'/' /etc/multipath.conf +do_reconfigure +trun 'multipathd show maps raw format "%n %w"' +# verify configured alias takes precedence over user_friendly_name +tok 'multipathd show maps raw format "%n" | head -1 | grep -q test' +trun "mpathconf --user_friendly_names n" +do_reconfigure +trun 'multipathd show maps raw format "%n %w"' +# verify configured alias takes precedence over wwid name +tok 'multipathd show maps raw format "%n" | head -1 | grep -q test' +sed -i 's/'"$wwid"'/TEST_WWID/' /etc/multipath.conf +do_reconfigure +trun 'multipathd show maps raw format "%n %w"' +tok 'multipathd show maps raw format "%n" | head -1 | grep -q '"$wwid" +cleanup +tend