Compare commits
19 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6f2be9e59 | ||
|
|
3c9f48504b | ||
|
|
9f48ebd2e2 | ||
|
|
30306052cc | ||
|
|
f2377371e3 | ||
|
|
3c2eb3f84e | ||
|
|
05ecb26e7c | ||
|
|
61847c90be | ||
|
|
4ec4661dee | ||
|
|
75d5c0c70a | ||
|
|
94144d9276 | ||
|
|
0c6649fa32 | ||
|
|
354f1e7cfb | ||
|
|
519bd15b4d | ||
|
|
3cde646ade | ||
|
|
4e4233829d | ||
|
|
59945a7f7e | ||
|
|
588b3f63e9 | ||
|
|
6496193f3f |
31 changed files with 695 additions and 493 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -30,3 +30,8 @@ multipath-tools-091027.tar.gz
|
|||
/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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 64a07df23affd21842fdc604887276e62e5b41de Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Thu, 13 Apr 2017 07:22:23 -0500
|
||||
Subject: [PATCH] RH: fixup udev rules for redhat
|
||||
|
|
@ -9,13 +9,13 @@ different naming scheme for partitions than SuSE.
|
|||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
---
|
||||
Makefile.inc | 2 +-
|
||||
kpartx/kpartx.rules | 2 +-
|
||||
multipath/Makefile | 4 ++--
|
||||
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 6b454303..0b0e3ad2 100644
|
||||
index 9e3dc466..ead89030 100644
|
||||
--- a/Makefile.inc
|
||||
+++ b/Makefile.inc
|
||||
@@ -34,7 +34,7 @@ endif
|
||||
|
|
@ -26,34 +26,34 @@ index 6b454303..0b0e3ad2 100644
|
|||
+exec_prefix := $(prefix)/usr
|
||||
# Prefix for non-essential libraries (libdmmp)
|
||||
usr_prefix := $(if $(prefix),$(prefix),/usr)
|
||||
# Prefix for configfuration files (multipath.conf)
|
||||
diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules
|
||||
index 1969dee0..d2b28233 100644
|
||||
--- a/kpartx/kpartx.rules
|
||||
+++ b/kpartx/kpartx.rules
|
||||
# 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+="/sbin/kpartx -un -p -part /dev/$name"
|
||||
+RUN+="/sbin/kpartx -un /dev/$name"
|
||||
-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 0efb9b26..504d6892 100644
|
||||
index 67fb5e62..2ea9e528 100644
|
||||
--- a/multipath/Makefile
|
||||
+++ b/multipath/Makefile
|
||||
@@ -26,7 +26,7 @@ install:
|
||||
$(Q)$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/
|
||||
@@ -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
|
||||
@@ -48,7 +48,7 @@ uninstall:
|
||||
$(Q)$(RM) $(DESTDIR)$(udevrulesdir)/11-dm-mpath.rules
|
||||
@@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From f7be16ac9fce97585a4552d49f3d3c54a93c9c17 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Wed, 2 Jul 2014 12:49:53 -0500
|
||||
Subject: [PATCH] RH: Remove the property blacklist exception builtin
|
||||
|
|
@ -19,7 +19,7 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|||
3 files changed, 10 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c
|
||||
index 75100b20..0b212078 100644
|
||||
index 17e1b54a..10d13e98 100644
|
||||
--- a/libmultipath/blacklist.c
|
||||
+++ b/libmultipath/blacklist.c
|
||||
@@ -230,8 +230,6 @@ setup_default_blist (struct config * conf)
|
||||
|
|
@ -42,10 +42,10 @@ index 75100b20..0b212078 100644
|
|||
udev_device_get_properties_list_entry(udev)) {
|
||||
|
||||
diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in
|
||||
index 683bdb72..87b3b2a5 100644
|
||||
index 3c9ae097..ba291e11 100644
|
||||
--- a/multipath/multipath.conf.5.in
|
||||
+++ b/multipath/multipath.conf.5.in
|
||||
@@ -1431,9 +1431,14 @@ keywords. Both are regular expressions. For a full description of these keywords
|
||||
@@ -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,
|
||||
|
|
@ -61,7 +61,7 @@ index 683bdb72..87b3b2a5 100644
|
|||
.
|
||||
.RS
|
||||
.PP
|
||||
@@ -1444,10 +1449,6 @@ Blacklisting by missing properties is only applied to devices which do have the
|
||||
@@ -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.
|
||||
|
|
@ -73,10 +73,10 @@ index 683bdb72..87b3b2a5 100644
|
|||
.TP
|
||||
.B protocol
|
||||
diff --git a/tests/blacklist.c b/tests/blacklist.c
|
||||
index ba8dfd07..693db3fa 100644
|
||||
index ab3da619..52ae03e0 100644
|
||||
--- a/tests/blacklist.c
|
||||
+++ b/tests/blacklist.c
|
||||
@@ -384,9 +384,8 @@ static void test_property_missing(void **state)
|
||||
@@ -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;
|
||||
|
|
@ -87,7 +87,7 @@ index ba8dfd07..693db3fa 100644
|
|||
assert_int_equal(filter_property(&conf, &udev, 3, "ID_BLAH"),
|
||||
MATCH_NOTHING);
|
||||
assert_int_equal(filter_property(&conf, &udev, 3, ""),
|
||||
@@ -478,9 +477,7 @@ static void test_filter_path_missing1(void **state)
|
||||
@@ -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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 5613e07ce9cabf2fdc402f6f102cc54bd1059800 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Wed, 15 Oct 2014 10:39:30 -0500
|
||||
Subject: [PATCH] RH: don't start without a config file
|
||||
|
|
@ -18,14 +18,14 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|||
multipath/multipath.rules.in | 1 +
|
||||
multipathd/multipathd.8.in | 2 ++
|
||||
multipathd/multipathd.service.in | 1 +
|
||||
multipathd/multipathd.socket | 1 +
|
||||
multipathd/multipathd.socket.in | 1 +
|
||||
7 files changed, 25 insertions(+)
|
||||
|
||||
diff --git a/libmultipath/config.c b/libmultipath/config.c
|
||||
index b7dbc6f5..3a374b3d 100644
|
||||
index 8b424d18..b8317f4d 100644
|
||||
--- a/libmultipath/config.c
|
||||
+++ b/libmultipath/config.c
|
||||
@@ -958,6 +958,19 @@ int _init_config (const char *file, struct config *conf)
|
||||
@@ -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);
|
||||
|
|
@ -46,7 +46,7 @@ index b7dbc6f5..3a374b3d 100644
|
|||
|
||||
conf->processed_main_config = 1;
|
||||
diff --git a/libmultipath/config.h b/libmultipath/config.h
|
||||
index 384193ab..158cebf0 100644
|
||||
index 5b4ebf8c..2302eacc 100644
|
||||
--- a/libmultipath/config.h
|
||||
+++ b/libmultipath/config.h
|
||||
@@ -10,6 +10,7 @@
|
||||
|
|
@ -58,12 +58,12 @@ index 384193ab..158cebf0 100644
|
|||
enum devtypes {
|
||||
DEV_NONE,
|
||||
diff --git a/multipath/main.c b/multipath/main.c
|
||||
index 9e1c5052..46944589 100644
|
||||
index f2adcdeb..31012874 100644
|
||||
--- a/multipath/main.c
|
||||
+++ b/multipath/main.c
|
||||
@@ -829,11 +829,14 @@ main (int argc, char *argv[])
|
||||
@@ -834,11 +834,14 @@ main (int argc, char *argv[])
|
||||
char *dev = NULL;
|
||||
struct config *conf;
|
||||
int retries = -1;
|
||||
bool enable_foreign = false;
|
||||
+ bool have_config;
|
||||
+ struct stat buf;
|
||||
|
|
@ -76,7 +76,7 @@ index 9e1c5052..46944589 100644
|
|||
if (init_config(DEFAULT_CONFIGFILE))
|
||||
exit(RTVL_FAIL);
|
||||
if (atexit(uninit_config))
|
||||
@@ -1081,6 +1084,9 @@ main (int argc, char *argv[])
|
||||
@@ -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");
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ index 9e1c5052..46944589 100644
|
|||
put_multipath_config(conf);
|
||||
if (dev)
|
||||
diff --git a/multipath/multipath.rules.in b/multipath/multipath.rules.in
|
||||
index 6f123760..70b69a06 100644
|
||||
index 2ac1972f..cc248231 100644
|
||||
--- a/multipath/multipath.rules.in
|
||||
+++ b/multipath/multipath.rules.in
|
||||
@@ -9,6 +9,7 @@ IMPORT{cmdline}="nompath"
|
||||
|
|
@ -99,7 +99,7 @@ index 6f123760..70b69a06 100644
|
|||
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 e98c27fd..fd2061e5 100644
|
||||
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.
|
||||
|
|
@ -112,10 +112,10 @@ index e98c27fd..fd2061e5 100644
|
|||
.
|
||||
.\" ----------------------------------------------------------------------------
|
||||
diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in
|
||||
index 6d03ff71..0965d6f9 100644
|
||||
index eb58943c..ab166435 100644
|
||||
--- a/multipathd/multipathd.service.in
|
||||
+++ b/multipathd/multipathd.service.in
|
||||
@@ -6,6 +6,7 @@ Wants=systemd-udevd-kernel.socket @MODPROBE_UNIT@
|
||||
@@ -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
|
||||
|
|
@ -123,10 +123,10 @@ index 6d03ff71..0965d6f9 100644
|
|||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
Conflicts=initrd-cleanup.service
|
||||
diff --git a/multipathd/multipathd.socket b/multipathd/multipathd.socket
|
||||
index c777e5e3..3c20a2ff 100644
|
||||
--- a/multipathd/multipathd.socket
|
||||
+++ b/multipathd/multipathd.socket
|
||||
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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 283b5dd645663a2cf16f2813581772d7a84db6ad Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Fri, 25 Jan 2019 14:54:56 -0600
|
||||
Subject: [PATCH] RH: Fix nvme function missing argument
|
||||
|
|
@ -12,10 +12,10 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libmultipath/nvme/argconfig.h b/libmultipath/nvme/argconfig.h
|
||||
index adb192b6..bfd10ef8 100644
|
||||
index b3caa7be..f91504c9 100644
|
||||
--- a/libmultipath/nvme/argconfig.h
|
||||
+++ b/libmultipath/nvme/argconfig.h
|
||||
@@ -76,7 +76,7 @@ struct argconfig_commandline_options {
|
||||
@@ -63,7 +63,7 @@ struct argconfig_commandline_options {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From bf46f8029998498045bb055415ba3ff515c79eaa Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Wed, 19 Apr 2017 06:10:01 -0500
|
||||
Subject: [PATCH] RH: use rpm optflags if present
|
||||
|
|
@ -9,19 +9,18 @@ still being generic.
|
|||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
---
|
||||
Makefile.inc | 22 +++++++++++++++++-----
|
||||
1 file changed, 17 insertions(+), 5 deletions(-)
|
||||
Makefile.inc | 25 ++++++++++++++++++-------
|
||||
1 file changed, 18 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/Makefile.inc b/Makefile.inc
|
||||
index 0b0e3ad2..3d80d224 100644
|
||||
index ead89030..03aee175 100644
|
||||
--- a/Makefile.inc
|
||||
+++ b/Makefile.inc
|
||||
@@ -95,11 +95,23 @@ SYSTEMD_LIBDEPS := $(if $(SYSTEMD),$(if $(shell test $(SYSTEMD) -gt 209 && echo
|
||||
@@ -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
|
||||
-WARNFLAGS := -Werror -Wall -Wextra -Wformat=2 $(WFORMATOVERFLOW) -Werror=implicit-int \
|
||||
+ifndef RPM_OPT_FLAGS
|
||||
+ OPTFLAGS := -O2 -g $(STACKPROT) --param=ssp-buffer-size=4 \
|
||||
+ -Wall $(FORTIFY_OPT) -fexceptions -grecord-gcc-switches \
|
||||
|
|
@ -35,16 +34,29 @@ index 0b0e3ad2..3d80d224 100644
|
|||
+else
|
||||
+ OPTFLAGS := $(RPM_OPT_FLAGS) --param=ssp-buffer-size=4
|
||||
+endif
|
||||
+WARNFLAGS := -Werror -Wextra -Wformat=2 $(WFORMATOVERFLOW) -Werror=implicit-int \
|
||||
-Werror=implicit-function-declaration -Werror=format-security \
|
||||
- $(WNOCLOBBERED) -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) $(W_URCU_TYPE_LIMITS)
|
||||
|
||||
# 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) \
|
||||
+ $(WNOCLOBBERED) -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) $(W_URCU_TYPE_LIMITS) -Wstrict-prototypes
|
||||
+CPPFLAGS := $(CPPFLAGS) $(D_URCU_VERSION) \
|
||||
-DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(plugindir)\" \
|
||||
-DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(configdir)\" \
|
||||
-DDEFAULT_CONFIGFILE=\"$(configfile)\" -DSTATE_DIR=\"$(statedir)\" \
|
||||
@@ -108,7 +120,7 @@ CFLAGS := --std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe
|
||||
-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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 29e5c6d6e2177e73d1be2ed2af66c1007487bf60 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Thu, 16 Oct 2014 15:49:01 -0500
|
||||
Subject: [PATCH] RH: add mpathconf
|
||||
|
|
@ -13,19 +13,44 @@ a single command.
|
|||
Co-authored-by: Paul Donohue <git@PaulSD.com>
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
---
|
||||
libmultipath/config.c | 2 +
|
||||
multipath/Makefile | 4 +
|
||||
multipath/mpathconf | 658 ++++++++++++++++++++++++++++++++++++++++++
|
||||
multipath/mpathconf.8 | 151 ++++++++++
|
||||
4 files changed, 815 insertions(+)
|
||||
.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 3a374b3d..4544f484 100644
|
||||
index b8317f4d..0bbaa981 100644
|
||||
--- a/libmultipath/config.c
|
||||
+++ b/libmultipath/config.c
|
||||
@@ -960,6 +960,8 @@ int _init_config (const char *file, struct config *conf)
|
||||
@@ -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.");
|
||||
|
|
@ -35,7 +60,7 @@ index 3a374b3d..4544f484 100644
|
|||
conf->blist_devnode = vector_alloc();
|
||||
if (!conf->blist_devnode) {
|
||||
diff --git a/multipath/Makefile b/multipath/Makefile
|
||||
index 504d6892..9f14036c 100644
|
||||
index 2ea9e528..3dc241cc 100644
|
||||
--- a/multipath/Makefile
|
||||
+++ b/multipath/Makefile
|
||||
@@ -24,6 +24,7 @@ $(EXEC): $(OBJS) $(multipathdir)/libmultipath.so $(mpathcmddir)/libmpathcmd.so
|
||||
|
|
@ -45,8 +70,8 @@ index 504d6892..9f14036c 100644
|
|||
+ $(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 multipath.rules $(DESTDIR)$(udevrulesdir)/62-multipath.rules
|
||||
@@ -31,6 +32,7 @@ install:
|
||||
$(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
|
||||
|
|
@ -54,12 +79,13 @@ index 504d6892..9f14036c 100644
|
|||
$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)/man5
|
||||
$(Q)$(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5 $(DESTDIR)$(mandir)/man5
|
||||
$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(modulesloaddir)
|
||||
@@ -45,11 +47,13 @@ endif
|
||||
@@ -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
|
||||
|
|
@ -734,7 +760,7 @@ index 00000000..ce430075
|
|||
+fi
|
||||
diff --git a/multipath/mpathconf.8 b/multipath/mpathconf.8
|
||||
new file mode 100644
|
||||
index 00000000..ea025f31
|
||||
index 00000000..ec4e5c56
|
||||
--- /dev/null
|
||||
+++ b/multipath/mpathconf.8
|
||||
@@ -0,0 +1,151 @@
|
||||
|
|
@ -876,7 +902,7 @@ index 00000000..ea025f31
|
|||
+.B service multipathd stop
|
||||
+to stop the multipathd daemon on \fB--disable\fP, and
|
||||
+.B service multipathd reload
|
||||
+to reconfigure multipathd on \fB--user_frindly_names\fP and
|
||||
+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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From d6ad888bad3850bb0a342ebcdc9fd78773eb3b2a Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Fri, 17 Oct 2014 11:20:34 -0500
|
||||
Subject: [PATCH] RH: add wwids from kernel cmdline mpath.wwids with -A
|
||||
|
|
@ -20,10 +20,10 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|||
3 files changed, 59 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/multipath/main.c b/multipath/main.c
|
||||
index 46944589..47f89a0a 100644
|
||||
index 31012874..a667c2ee 100644
|
||||
--- a/multipath/main.c
|
||||
+++ b/multipath/main.c
|
||||
@@ -120,7 +120,7 @@ usage (char * progname)
|
||||
@@ -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);
|
||||
|
|
@ -32,7 +32,7 @@ index 46944589..47f89a0a 100644
|
|||
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);
|
||||
@@ -134,6 +134,8 @@ usage (char * 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"
|
||||
|
|
@ -41,7 +41,7 @@ index 46944589..47f89a0a 100644
|
|||
" -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"
|
||||
@@ -448,6 +450,50 @@ static void cleanup_vecs(void)
|
||||
@@ -440,6 +442,50 @@ static void cleanup_vecs(void)
|
||||
free_pathvec(vecs.pathvec, FREE_PATHS);
|
||||
}
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ index 46944589..47f89a0a 100644
|
|||
static int
|
||||
configure (struct config *conf, enum mpath_cmds cmd,
|
||||
enum devtypes dev_type, char *devpath)
|
||||
@@ -848,7 +894,7 @@ main (int argc, char *argv[])
|
||||
@@ -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");
|
||||
|
|
@ -101,7 +101,7 @@ index 46944589..47f89a0a 100644
|
|||
switch(arg) {
|
||||
case 'v':
|
||||
if (!isdigit(optarg[0])) {
|
||||
@@ -919,6 +965,10 @@ main (int argc, char *argv[])
|
||||
@@ -922,6 +968,10 @@ main (int argc, char *argv[])
|
||||
case 'T':
|
||||
cmd = CMD_DUMP_CONFIG;
|
||||
break;
|
||||
|
|
@ -113,7 +113,7 @@ index 46944589..47f89a0a 100644
|
|||
usage(argv[0]);
|
||||
exit(RTVL_OK);
|
||||
diff --git a/multipath/multipath.8.in b/multipath/multipath.8.in
|
||||
index 348eb220..82a7e68e 100644
|
||||
index b88e9a4c..edd742aa 100644
|
||||
--- a/multipath/multipath.8.in
|
||||
+++ b/multipath/multipath.8.in
|
||||
@@ -64,7 +64,7 @@ multipath \- Device mapper target autoconfig.
|
||||
|
|
@ -138,14 +138,14 @@ index 348eb220..82a7e68e 100644
|
|||
Remove the WWID for the specified device from the WWIDs file.
|
||||
.
|
||||
diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in
|
||||
index 0965d6f9..c964eb1b 100644
|
||||
index ab166435..1ec08c6e 100644
|
||||
--- a/multipathd/multipathd.service.in
|
||||
+++ b/multipathd/multipathd.service.in
|
||||
@@ -17,6 +17,7 @@ ConditionVirtualization=!container
|
||||
@@ -19,6 +19,7 @@ StartLimitBurst=3
|
||||
[Service]
|
||||
Type=notify
|
||||
NotifyAccess=main
|
||||
+ExecStartPre=-/sbin/multipath -A
|
||||
ExecStart=/sbin/multipathd -d -s
|
||||
ExecReload=/sbin/multipathd reconfigure
|
||||
TasksMax=infinity
|
||||
+ExecStartPre=-@BINDIR@/multipath -A
|
||||
ExecStart=@BINDIR@/multipathd -d -s
|
||||
ExecReload=@BINDIR@/multipathd reconfigure
|
||||
Restart=on-failure
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 064d761121e7e2c7b63ab280e341d8010a413119 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Thu, 7 Jun 2018 17:43:52 -0500
|
||||
Subject: [PATCH] RH: reset default find_mutipaths value to off
|
||||
|
|
@ -14,10 +14,10 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
|
||||
index 64b633f2..5bda9f93 100644
|
||||
index 134b690a..e2fe7ac4 100644
|
||||
--- a/libmultipath/defaults.h
|
||||
+++ b/libmultipath/defaults.h
|
||||
@@ -23,7 +23,7 @@
|
||||
@@ -24,7 +24,7 @@
|
||||
#define DEFAULT_NO_PATH_RETRY NO_PATH_RETRY_UNDEF
|
||||
#define DEFAULT_VERBOSITY 2
|
||||
#define DEFAULT_REASSIGN_MAPS 0
|
||||
|
|
@ -27,10 +27,10 @@ index 64b633f2..5bda9f93 100644
|
|||
#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 87b3b2a5..8e246571 100644
|
||||
index ba291e11..b8389db3 100644
|
||||
--- a/multipath/multipath.conf.5.in
|
||||
+++ b/multipath/multipath.conf.5.in
|
||||
@@ -1213,7 +1213,7 @@ as non-multipath and passed on to upper layers.
|
||||
@@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 335b8eb2773b07a602e84e14c1f3e289a9b25b5a Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Thu, 11 Apr 2019 13:25:42 -0500
|
||||
Subject: [PATCH] RH: attempt to get ANA info via sysfs first
|
||||
|
|
@ -13,10 +13,10 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|||
1 file changed, 29 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libmultipath/prioritizers/ana.c b/libmultipath/prioritizers/ana.c
|
||||
index e9827dca..80a32aa3 100644
|
||||
index 34527b22..4eaa3cc3 100644
|
||||
--- a/libmultipath/prioritizers/ana.c
|
||||
+++ b/libmultipath/prioritizers/ana.c
|
||||
@@ -24,6 +24,7 @@
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "prio.h"
|
||||
#include "util.h"
|
||||
#include "structs.h"
|
||||
|
|
@ -24,7 +24,7 @@ index e9827dca..80a32aa3 100644
|
|||
|
||||
enum {
|
||||
ANA_ERR_GETCTRL_FAILED = 1,
|
||||
@@ -36,6 +37,7 @@ enum {
|
||||
@@ -35,6 +36,7 @@ enum {
|
||||
ANA_ERR_GETNS_FAILED,
|
||||
ANA_ERR_NO_MEMORY,
|
||||
ANA_ERR_NO_INFORMATION,
|
||||
|
|
@ -32,7 +32,7 @@ index e9827dca..80a32aa3 100644
|
|||
};
|
||||
|
||||
static const char *ana_errmsg[] = {
|
||||
@@ -49,6 +51,7 @@ 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",
|
||||
|
|
@ -40,7 +40,7 @@ index e9827dca..80a32aa3 100644
|
|||
};
|
||||
|
||||
static const char *anas_string[] = {
|
||||
@@ -107,6 +110,27 @@ static int get_ana_state(__u32 nsid, __u32 anagrpid, void *ana_log,
|
||||
@@ -106,6 +109,27 @@ static int get_ana_state(__u32 nsid, __u32 anagrpid, void *ana_log,
|
||||
return -ANA_ERR_GETANAS_NOTFOUND;
|
||||
}
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ index e9827dca..80a32aa3 100644
|
|||
static int get_ana_info(struct path * pp)
|
||||
{
|
||||
int rc;
|
||||
@@ -209,8 +233,11 @@ int getprio(struct path *pp, __attribute__((unused)) char *args)
|
||||
@@ -208,8 +232,11 @@ int getprio(struct path *pp, __attribute__((unused)) char *args)
|
||||
|
||||
if (pp->fd < 0)
|
||||
rc = -ANA_ERR_NO_INFORMATION;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 137c96d16b6bb03d8a52854e152db4ee36b7d9e4 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Thu, 25 Mar 2021 13:05:10 -0500
|
||||
Subject: [PATCH] RH: make parse_vpd_pg83 match scsi_id output
|
||||
|
|
@ -14,10 +14,10 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|||
2 files changed, 8 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
|
||||
index 6fd4dabb..19692b1e 100644
|
||||
index 31db8758..21cfcc73 100644
|
||||
--- a/libmultipath/discovery.c
|
||||
+++ b/libmultipath/discovery.c
|
||||
@@ -1216,13 +1216,9 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
|
||||
@@ -1225,13 +1225,9 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
|
||||
good_len = 8;
|
||||
break;
|
||||
case 2:
|
||||
|
|
@ -33,7 +33,7 @@ index 6fd4dabb..19692b1e 100644
|
|||
good_len = 8;
|
||||
break;
|
||||
default:
|
||||
@@ -1240,10 +1236,6 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
|
||||
@@ -1249,10 +1245,6 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
|
||||
break;
|
||||
case 0x8:
|
||||
/* SCSI Name: Prio 3 */
|
||||
|
|
@ -45,10 +45,10 @@ index 6fd4dabb..19692b1e 100644
|
|||
case 0x1:
|
||||
/* T-10 Vendor ID: Prio 2 */
|
||||
diff --git a/tests/vpd.c b/tests/vpd.c
|
||||
index 1b2d62d6..7309b5c5 100644
|
||||
index e3212e61..cdb111bb 100644
|
||||
--- a/tests/vpd.c
|
||||
+++ b/tests/vpd.c
|
||||
@@ -231,11 +231,13 @@ static const char * const str_prefix[] = {
|
||||
@@ -232,11 +232,13 @@ static const char * const str_prefix[] = {
|
||||
[STR_IQN] = "iqn.",
|
||||
};
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ index 1b2d62d6..7309b5c5 100644
|
|||
|
||||
/**
|
||||
* create_scsi_string_desc() - create a SCSI name string descriptor.
|
||||
@@ -766,6 +768,7 @@ make_test_vpd_naa(2, 18);
|
||||
@@ -767,6 +769,7 @@ make_test_vpd_naa(2, 18);
|
||||
make_test_vpd_naa(2, 17);
|
||||
make_test_vpd_naa(2, 16);
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ index 1b2d62d6..7309b5c5 100644
|
|||
/* SCSI Name string: EUI64, WWID size: 17 */
|
||||
make_test_vpd_str(0, 20, 18)
|
||||
make_test_vpd_str(0, 20, 17)
|
||||
@@ -801,6 +804,7 @@ make_test_vpd_str(18, 20, 18)
|
||||
@@ -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)
|
||||
|
|
@ -78,7 +78,7 @@ index 1b2d62d6..7309b5c5 100644
|
|||
|
||||
static int test_vpd(void)
|
||||
{
|
||||
@@ -909,6 +913,7 @@ 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),
|
||||
|
|
@ -86,7 +86,7 @@ index 1b2d62d6..7309b5c5 100644
|
|||
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),
|
||||
@@ -933,6 +938,7 @@ static int test_vpd(void)
|
||||
@@ -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),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 374755791536be4870ab2e93ae36549cbaaeb800 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Fri, 25 Mar 2022 18:12:06 -0500
|
||||
Subject: [PATCH] RH: add scsi device handlers to modules-load.d
|
||||
|
|
@ -11,7 +11,7 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile.inc b/Makefile.inc
|
||||
index 3d80d224..15e3bd3a 100644
|
||||
index 03aee175..936a622f 100644
|
||||
--- a/Makefile.inc
|
||||
+++ b/Makefile.inc
|
||||
@@ -16,7 +16,7 @@ READLINE :=
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From cc15379130e8aa068e97c64afd46be212b456d4f Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Tue, 15 Nov 2022 18:03:33 -0600
|
||||
Subject: [PATCH] RH: compile with libreadline support
|
||||
|
|
@ -12,7 +12,7 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile.inc b/Makefile.inc
|
||||
index 15e3bd3a..64384a72 100644
|
||||
index 936a622f..f475f70f 100644
|
||||
--- a/Makefile.inc
|
||||
+++ b/Makefile.inc
|
||||
@@ -12,7 +12,7 @@
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 2ef5bd86052ba0b22f4d3a16e69cdf268d90a53a Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Fri, 7 Jul 2023 15:25:59 -0500
|
||||
Subject: [PATCH] RH: Add mpathcleanup
|
||||
|
|
@ -14,7 +14,7 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|||
create mode 100755 multipath/mpathcleanup
|
||||
|
||||
diff --git a/multipath/Makefile b/multipath/Makefile
|
||||
index 9f14036c..99ad81b0 100644
|
||||
index 3dc241cc..47e82234 100644
|
||||
--- a/multipath/Makefile
|
||||
+++ b/multipath/Makefile
|
||||
@@ -25,6 +25,7 @@ install:
|
||||
|
|
@ -24,15 +24,15 @@ index 9f14036c..99ad81b0 100644
|
|||
+ $(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 multipath.rules $(DESTDIR)$(udevrulesdir)/62-multipath.rules
|
||||
@@ -48,6 +49,7 @@ endif
|
||||
$(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
|
||||
$(Q)$(RM) $(DESTDIR)$(modulesloaddir)/scsi_dh.conf
|
||||
diff --git a/multipath/mpathcleanup b/multipath/mpathcleanup
|
||||
new file mode 100755
|
||||
index 00000000..6fd921e4
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Tue, 16 Jan 2024 00:54:37 -0500
|
||||
Subject: [PATCH] multipathd: fix null pointer dereference in uev_update_path
|
||||
|
||||
The Auto-resize code added a check that deferences pp->mpp without
|
||||
checking that it's non-NULL. Fix it.
|
||||
|
||||
Fixes: 981b83ad1 ("multipathd: Add auto_resize config option")
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
---
|
||||
multipathd/main.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/multipathd/main.c b/multipathd/main.c
|
||||
index 230c9d10..57c04364 100644
|
||||
--- a/multipathd/main.c
|
||||
+++ b/multipathd/main.c
|
||||
@@ -1653,7 +1653,7 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
|
||||
}
|
||||
}
|
||||
}
|
||||
- if (auto_resize != AUTO_RESIZE_NEVER &&
|
||||
+ if (auto_resize != AUTO_RESIZE_NEVER && mpp &&
|
||||
!mpp->wait_for_udev) {
|
||||
struct pathgroup *pgp;
|
||||
struct path *pp2;
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Tue, 16 Jan 2024 01:11:02 -0500
|
||||
Subject: [PATCH] multipathd: fix auto-resize configuration
|
||||
|
||||
The code acted like AUTO_RESIZE_UNDEFINED didn't exist, but since
|
||||
conf->auto_resize was never set to AUTO_RESIZE_NEVER, the default was in
|
||||
fact AUTO_RESIZE_UNDEFINED, which ended up getting treated like
|
||||
AUTO_RESIZE_GROW_SHRINK. Remove AUTO_RESIZE_UNDEFINED and explicitly
|
||||
default auto_resize tp AUTO_RESIZE_NEVER.
|
||||
|
||||
Fixes: 981b83ad1 ("multipathd: Add auto_resize config option")
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
---
|
||||
libmultipath/config.c | 1 +
|
||||
libmultipath/structs.h | 1 -
|
||||
2 files changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libmultipath/config.c b/libmultipath/config.c
|
||||
index 4544f484..3d5943d3 100644
|
||||
--- a/libmultipath/config.c
|
||||
+++ b/libmultipath/config.c
|
||||
@@ -927,6 +927,7 @@ int _init_config (const char *file, struct config *conf)
|
||||
conf->retrigger_tries = DEFAULT_RETRIGGER_TRIES;
|
||||
conf->retrigger_delay = DEFAULT_RETRIGGER_DELAY;
|
||||
conf->uev_wait_timeout = DEFAULT_UEV_WAIT_TIMEOUT;
|
||||
+ conf->auto_resize = DEFAULT_AUTO_RESIZE;
|
||||
conf->remove_retries = 0;
|
||||
conf->ghost_delay = DEFAULT_GHOST_DELAY;
|
||||
conf->all_tg_pt = DEFAULT_ALL_TG_PT;
|
||||
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
|
||||
index a1aac1b4..734905e2 100644
|
||||
--- a/libmultipath/structs.h
|
||||
+++ b/libmultipath/structs.h
|
||||
@@ -180,7 +180,6 @@ enum queue_mode_states {
|
||||
};
|
||||
|
||||
enum auto_resize_state {
|
||||
- AUTO_RESIZE_UNDEF = 0,
|
||||
AUTO_RESIZE_NEVER,
|
||||
AUTO_RESIZE_GROW_ONLY,
|
||||
AUTO_RESIZE_GROW_SHRINK,
|
||||
|
|
@ -1,14 +1,15 @@
|
|||
Name: device-mapper-multipath
|
||||
Version: 0.9.7
|
||||
Release: 7%{?dist}
|
||||
Version: 0.13.0
|
||||
Release: 2%{?dist}
|
||||
Summary: Tools to manage multipath devices using device-mapper
|
||||
License: GPLv2
|
||||
# readline uses GPL-3.0-only
|
||||
License: GPL-2.0-only AND GPL-3.0-only
|
||||
URL: http://christophe.varoqui.free.fr/
|
||||
|
||||
# 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.9.7.tar.gz -o multipath-tools-0.9.7.tgz
|
||||
Source0: multipath-tools-0.9.7.tgz
|
||||
# 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-fixup-udev-rules-for-redhat.patch
|
||||
Patch0002: 0002-RH-Remove-the-property-blacklist-exception-builtin.patch
|
||||
|
|
@ -23,8 +24,6 @@ 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
|
||||
Patch0014: 0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch
|
||||
Patch0015: 0015-multipathd-fix-auto-resize-configuration.patch
|
||||
|
||||
# runtime
|
||||
Requires: %{name}-libs = %{version}-%{release}
|
||||
|
|
@ -66,8 +65,8 @@ The tools are :
|
|||
|
||||
%package libs
|
||||
Summary: The %{name} modules and shared library
|
||||
# only libmpathcmd is LGPLv2+
|
||||
License: GPLv2 and LGPLv2+
|
||||
# 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
|
||||
|
|
@ -92,7 +91,8 @@ kpartx manages partition creation and removal for device-mapper devices.
|
|||
|
||||
%package -n libdmmp
|
||||
Summary: device-mapper-multipath C API library
|
||||
License: GPLv3+
|
||||
# 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}
|
||||
|
|
@ -111,11 +111,10 @@ This package contains the files needed to develop applications that use
|
|||
device-mapper-multipath's libdmmp C API library
|
||||
|
||||
%prep
|
||||
%autosetup -n multipath-tools-0.9.7 -p1
|
||||
%autosetup -n multipath-tools-0.13.0 -p1
|
||||
cp %{SOURCE1} .
|
||||
|
||||
%build
|
||||
%define _sbindir /usr/sbin
|
||||
%define _libdir /usr/%{_lib}
|
||||
%define _libmpathdir %{_libdir}/multipath
|
||||
%define _pkgconfdir %{_libdir}/pkgconfig
|
||||
|
|
@ -146,7 +145,7 @@ rm -rf %{buildroot}/%{_initrddir}
|
|||
|
||||
%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
|
||||
|
||||
|
|
@ -164,6 +163,7 @@ fi
|
|||
%{_sbindir}/mpathcleanup
|
||||
%{_sbindir}/mpathpersist
|
||||
%{_unitdir}/multipathd.service
|
||||
%{_unitdir}/multipathd-queueing.service
|
||||
%{_unitdir}/multipathd.socket
|
||||
%{_mandir}/man5/multipath.conf.5*
|
||||
%{_mandir}/man8/multipath.8*
|
||||
|
|
@ -173,6 +173,7 @@ fi
|
|||
%{_mandir}/man8/mpathpersist.8*
|
||||
%config /usr/lib/udev/rules.d/62-multipath.rules
|
||||
%config /usr/lib/udev/rules.d/11-dm-mpath.rules
|
||||
%config /usr/lib/udev/rules.d/99-z-dm-mpath-late.rules
|
||||
%dir %{_modulesloaddir}
|
||||
%{_modulesloaddir}/scsi_dh.conf
|
||||
%{_tmpfilesdir}/multipath.conf
|
||||
|
|
@ -233,6 +234,76 @@ fi
|
|||
%{_pkgconfdir}/libdmmp.pc
|
||||
|
||||
%changelog
|
||||
* Thu Nov 13 2025 Benjamin Marzinski <bmarzins@redhat.com> - 0.13.0-2
|
||||
- Move STI tests to TMT
|
||||
|
||||
* Tue Nov 4 2025 Benjamin Marzinski <bmarzins@redhat.com> - 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 <releng@fedoraproject.org> - 0.11.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Thu Feb 27 2025 Benjamin Marzinski <bmarzins@redhat.com> - 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 <bmarzins@redhat.com> - 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 <releng@fedoraproject.org> - 0.10.0-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Sun Jan 12 2025 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.10.0-3
|
||||
- Rebuilt for the bin-sbin merge (2nd attempt)
|
||||
|
||||
* Thu Aug 29 2024 Benjamin Marzinski <bmarzins@redhat.com> - 0.10.0-2
|
||||
- update CI tests.
|
||||
|
||||
* Thu Aug 29 2024 Benjamin Marzinski <bmarzins@redhat.com> - 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 <bmarzins@redhat.com> - 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ý <msuchy@redhat.com> - 0.9.9-5
|
||||
- convert license to SPDX
|
||||
|
||||
* Thu Jul 25 2024 Miroslav Suchý <msuchy@redhat.com> - 0.9.9-4
|
||||
- convert license to SPDX
|
||||
|
||||
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.9-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||
|
||||
* Tue Jul 09 2024 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.9.9-2
|
||||
- Rebuilt for the bin-sbin merge
|
||||
|
||||
* Thu Jun 13 2024 Benjamin Marzinski <bmarzins@redhat.com> - 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 <bmarzins@redhat.com> - 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 <releng@fedoraproject.org> - 0.9.7-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
|
|
|
|||
58
plans/multipath.fmf
Normal file
58
plans/multipath.fmf
Normal file
|
|
@ -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
|
||||
2
sources
2
sources
|
|
@ -1,2 +1,2 @@
|
|||
SHA512 (multipath-tools-0.9.7.tgz) = 0f4c97179a3de5a0c77893fec229eb183293fed8e5e01a9945b261845ccf5d13f8ef2c2ff0c17c9345217d236275caed4765422ec95aed80821f11658bf96e26
|
||||
SHA512 (multipath-tools-0.13.0.tgz) = 75c84524ee27590b8b751ea500898a44e5ac3d58d55be6bcab919d0d423049db3a4466fcb9135705cf63ba074416973bb651255063269e9f682f11d21ba57e59
|
||||
SHA512 (multipath.conf) = 71953dce5a68adcf60a942305f5a66023e6f4c4baf53b1bfdb4edf65ed5b8e03db804363c36d1dcfd85591f4766f52b515269904c53b84d7b076da0b80b09942
|
||||
|
|
|
|||
|
|
@ -18,40 +18,110 @@
|
|||
# Author: Lin Li <lilin@redhat.com>
|
||||
|
||||
#set -x
|
||||
source ../include/ec.sh || exit 200
|
||||
|
||||
source ../include/tc.sh || exit 200
|
||||
tlog "running $0"
|
||||
|
||||
trun "service multipathd stop"
|
||||
rpm -q device-mapper-multipath || yum install -y device-mapper-multipath
|
||||
trun "mpathconf --enable --with_multipathd y --user_friendly_names y"
|
||||
trun "service multipathd status"
|
||||
sleep 5
|
||||
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"
|
||||
}
|
||||
|
||||
trun "multipath -F"
|
||||
sleep 5
|
||||
terr "modprobe -r scsi_debug"
|
||||
terr "modprobe scsi_debug num_tgts=1 vpd_use_hostno=0 add_host=2 delay=20 \
|
||||
max_luns=2 no_lun_0=1"
|
||||
sleep 60
|
||||
assert ()
|
||||
{
|
||||
local cmd="$*"
|
||||
_trun_ "$cmd" 0
|
||||
if test $? -eq 0; then
|
||||
tpass_ "$cmd" ;
|
||||
else
|
||||
tfail_ "$cmd" ;
|
||||
cleanup ;
|
||||
tend ;
|
||||
fi
|
||||
}
|
||||
|
||||
disk_path=$(get_scsi_debug_devices)
|
||||
disk=$(basename $disk_path)
|
||||
mpath_name=$(get_mpath_disk_by_scsi_device $disk)
|
||||
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"
|
||||
trun "multipath -r"
|
||||
sleep 5
|
||||
tok "[[ -b /dev/mapper/$new_alias ]]"
|
||||
tok is_mpath $new_alias
|
||||
sleep 5
|
||||
do_reconfigure
|
||||
trun 'multipathd show maps raw format "%n"'
|
||||
mpath_name=`multipathd show maps raw format "%n" | head -1`
|
||||
assert "[[ $mpath_name = $new_alias ]]"
|
||||
|
||||
trun "multipath -F"
|
||||
sleep 5
|
||||
trun "modprobe -r scsi_debug"
|
||||
trun "service multipathd stop"
|
||||
sleep 3
|
||||
trun "multipath -W"
|
||||
trun "rm /etc/multipath/bindings"
|
||||
cleanup
|
||||
tend
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
#!/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 <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# # Author: Lin Li <lilin@redhat.com>
|
||||
|
||||
.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 <lilin@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "License: GPLv3" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Description: find_multipaths" >> $(METADATA)
|
||||
@echo "TestTime: 15m" >> $(METADATA)
|
||||
@echo "RunFor: device-mapper-multipath" >> $(METADATA)
|
||||
@echo "Requires: device-mapper-multipath" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -18,39 +18,92 @@
|
|||
# Author: Lin Li <lilin@redhat.com>
|
||||
|
||||
#set -x
|
||||
source ../include/ec.sh || exit 200
|
||||
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 ()
|
||||
{
|
||||
trun "multipathd disablequeueing maps"
|
||||
trun "service multipathd stop"
|
||||
sleep 5
|
||||
trun "udevadm settle"
|
||||
trun "multipath -F"
|
||||
sleep 5
|
||||
trun "modprobe -r scsi_debug"
|
||||
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"
|
||||
}
|
||||
|
||||
tlog "running $0"
|
||||
assert ()
|
||||
{
|
||||
local cmd="$*"
|
||||
_trun_ "$cmd" 0
|
||||
if test $? -eq 0; then
|
||||
tpass_ "$cmd" ;
|
||||
else
|
||||
tfail_ "$cmd" ;
|
||||
cleanup ;
|
||||
tend ;
|
||||
fi
|
||||
}
|
||||
|
||||
# which not set find_multipaths yes, so multipath always create a multipath device for single device
|
||||
# so stop service and reconfig with --find_multipaths y, and reload/start the service again.
|
||||
rpm -q device-mapper-multipath || yum install -y device-mapper-multipath
|
||||
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
|
||||
|
||||
# test with find_multipath=y, will not multipath for the single device; reload/start the service to enable the config
|
||||
cleanup
|
||||
trun "rm -f /etc/multipath.conf"
|
||||
trun "rm -f /etc/multipath/wwids"
|
||||
trun "mpathconf --enable --user_friendly_names y --find_multipaths y --with_multipathd 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
|
||||
|
|
@ -58,56 +111,69 @@ blacklist_exceptions {
|
|||
}
|
||||
}
|
||||
_EOF_
|
||||
fi
|
||||
trun "service multipathd start"
|
||||
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"
|
||||
cat /etc/multipath/wwids
|
||||
trun "multipath"
|
||||
disk_path=$(get_scsi_debug_devices)
|
||||
disk_node=$(basename $disk_path)
|
||||
mpath_name=$(get_mpath_disk_by_scsi_device $disk_node)
|
||||
tok '[[ $mpath_name = "[orphan]" ]]'
|
||||
|
||||
# test with find_multipath=n, will multipath for the single device
|
||||
trun "mpathconf --user_friendly_names y --find_multipaths n --with_multipathd y"
|
||||
sleep 5
|
||||
mpath_name=$(get_mpath_disk_by_scsi_device $disk_node)
|
||||
tok "is_mpath $mpath_name"
|
||||
|
||||
# flush new created path
|
||||
trun "multipath -F"
|
||||
sleep 1
|
||||
|
||||
# test with find_multipath=y, A path has the same WWID as a multipath device that was previously created
|
||||
trun "mpathconf --user_friendly_names y --find_multipaths y --with_multipathd y"
|
||||
sleep 5
|
||||
mpath_name=$(get_mpath_disk_by_scsi_device $disk_node)
|
||||
tok "is_mpath $mpath_name"
|
||||
trun "multipath -F"
|
||||
sleep 1
|
||||
|
||||
# Clear wwid, test with find_multipath=y, will not multipath for the single device
|
||||
trun "multipath -W"
|
||||
trun "service multipathd reload"
|
||||
sleep 5
|
||||
mpath_name=$(get_mpath_disk_by_scsi_device $disk_node)
|
||||
tok '[[ $mpath_name = "[orphan]" ]]'
|
||||
|
||||
trun "multipath -F"
|
||||
sleep 5
|
||||
trun "modprobe -r scsi_debug"
|
||||
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
|
||||
tok "modprobe scsi_debug num_tgts=1 vpd_use_hostno=0 add_host=2 delay=20 max_luns=2 no_lun_0=1"
|
||||
sleep 10
|
||||
disk_paths=$(get_scsi_debug_devices)
|
||||
disk_node=$(basename $disk_paths)
|
||||
mpath_name=$(get_mpath_disk_by_scsi_device $disk_node)
|
||||
tok "is_mpath $mpath_name"
|
||||
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
|
||||
trun "multipath -W"
|
||||
cat /etc/multipath/wwids
|
||||
tend
|
||||
|
|
|
|||
|
|
@ -44,9 +44,12 @@ function _init (){
|
|||
}
|
||||
|
||||
function _destroy (){
|
||||
sleep 10
|
||||
Cmd "multipath -F"
|
||||
Cmd "multipathd disablequeueing maps"
|
||||
sleep 5
|
||||
Cmd "multipath -DF -R2"
|
||||
Cmd "service multipathd stop"
|
||||
sleep 5
|
||||
Cmd "udevadm settle"
|
||||
Cmd "modprobe -r scsi_debug"
|
||||
}
|
||||
|
||||
|
|
@ -174,10 +177,7 @@ AA
|
|||
fi
|
||||
#setup scsi_debug
|
||||
echo "INFO: Loading scsi_debug module for simulation of mpath"
|
||||
modprobe scsi_debug \
|
||||
num_tgts=1 vpd_use_hostno=0 \
|
||||
add_host=4 delay=20 \
|
||||
max_luns=2 no_lun_0=1 2>&1 1>/dev/null
|
||||
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
|
||||
|
|
@ -189,8 +189,6 @@ AA
|
|||
#enable multipath for scsi_debug.
|
||||
cat << AA > /etc/multipath.conf
|
||||
defaults {
|
||||
#Enable multibus is for mutlbus testing
|
||||
path_grouping_policy multibus
|
||||
user_friendly_names yes
|
||||
}
|
||||
blacklist {
|
||||
|
|
|
|||
|
|
@ -16,47 +16,51 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Author: LiLin <lilin@redhat.com>
|
||||
source ../include/tc.sh || exit 200
|
||||
|
||||
function cleanup()
|
||||
cleanup()
|
||||
{
|
||||
sleep 5
|
||||
udevadm settle
|
||||
multipath -F
|
||||
trun "multipath -DF"
|
||||
sleep 5
|
||||
modprobe -r scsi_debug
|
||||
|
||||
return 0
|
||||
trun "modprobe -r scsi_debug"
|
||||
}
|
||||
|
||||
yum -y install device-mapper device-mapper-multipath
|
||||
mpathconf --enable
|
||||
service multipathd stop
|
||||
modprobe scsi_debug num_tgts=1 vpd_use_hostno=0 add_host=2 delay=20 max_luns=2 no_lun_0=1 opts=2
|
||||
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
|
||||
multipath > /dev/null
|
||||
trun "multipath"
|
||||
sleep 5
|
||||
trun "multipath -l"
|
||||
mpathdev=`multipath -l | grep scsi_debug | awk '{print $1}' | head -1`
|
||||
if [ -z "$mpathdev" ]; then
|
||||
echo "------- FAIL, no multipath device created -----"
|
||||
cleanup
|
||||
exit 1
|
||||
fi
|
||||
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" `
|
||||
if [ -n "$IO_error" ];then
|
||||
after_active=`multipath -l $mpathdev | grep "active undef" | wc -l`
|
||||
if [ "$before_active" -eq "$after_active" ]; then
|
||||
echo "------- PASS, a medium error, correctly generated an I/O error and did not fail paths -----"
|
||||
cleanup
|
||||
exit 0
|
||||
else
|
||||
echo "------- FAIL, paths failed -----"
|
||||
cleanup
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "------- FAIL, did not generate an I/O error -----"
|
||||
cleanup
|
||||
exit 1
|
||||
fi
|
||||
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
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
|
||||
standard-inventory-qcow2:
|
||||
qemu:
|
||||
m: 2G
|
||||
|
|
@ -48,10 +48,8 @@ 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"
|
||||
sed -i '/^defaults[[:space:]]*{/ a\
|
||||
max_polling_interval 10
|
||||
' /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
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
---
|
||||
# No tests suitable for atomic environment
|
||||
# No tests suitable for container environment
|
||||
|
||||
# Tests suitable for classic environment
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-basic
|
||||
tags:
|
||||
- classic
|
||||
tests:
|
||||
- medium_error_scsi_debug:
|
||||
run: ./main.sh
|
||||
timeout: 15m
|
||||
- squelch_scsi_id:
|
||||
run: ./main.sh
|
||||
timeout: 15m
|
||||
- multipathd_oom:
|
||||
run: ./main.sh
|
||||
timeout: 15m
|
||||
- user_friendly_names:
|
||||
run: ./main.sh
|
||||
timeout: 15m
|
||||
- kpartx_4k_aligned:
|
||||
run: ./main.sh
|
||||
timeout: 15m
|
||||
- bindings:
|
||||
run: ./main.sh
|
||||
timeout: 15m
|
||||
- restate_module:
|
||||
run: ./main.sh
|
||||
timeout: 15m
|
||||
- find_multipaths:
|
||||
run: ./main.sh
|
||||
timeout: 15m
|
||||
- multipath_conf_syntax:
|
||||
run: ./main.sh
|
||||
timeout: 15m
|
||||
- alias_clash:
|
||||
run: ./main.sh
|
||||
timeout: 15m
|
||||
required_packages:
|
||||
- device-mapper-multipath
|
||||
- perl
|
||||
|
|
@ -17,50 +17,125 @@
|
|||
|
||||
# Author: Lin Li <lilin@redhat.com>
|
||||
|
||||
source ../include/ec.sh || exit 200
|
||||
|
||||
source ../include/tc.sh || exit 200
|
||||
tlog "running $0"
|
||||
|
||||
trun "rpm -q device-mapper-multipath || yum install -y device-mapper-multipath"
|
||||
trun "mpathconf --enable --with_multipathd y --user_friendly_names y"
|
||||
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"
|
||||
}
|
||||
|
||||
# backup the /etc/multipath.conf
|
||||
trun "cp /etc/multipath.conf /etc/multipath.conf.$$"
|
||||
trun "multipath -F"
|
||||
assert ()
|
||||
{
|
||||
local cmd="$*"
|
||||
_trun_ "$cmd" 0
|
||||
if test $? -eq 0; then
|
||||
tpass_ "$cmd" ;
|
||||
else
|
||||
tfail_ "$cmd" ;
|
||||
cleanup ;
|
||||
tend ;
|
||||
fi
|
||||
}
|
||||
|
||||
trun "modprobe scsi_debug num_tgts=1 vpd_use_hostno=0 add_host=2 delay=20 \
|
||||
max_luns=2 no_lun_0=1"
|
||||
trun "multipath"
|
||||
# wwid shown slowly on s390x by the script framework, but normally when run by multipath command directly
|
||||
# so extend sleep time
|
||||
sleep 20
|
||||
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
|
||||
|
||||
disk=$(get_scsi_debug_devices)
|
||||
disk=$(basename $disk)
|
||||
wwid=$(get_wwid_of_disk $disk)
|
||||
mpath=$(get_mpath_disk_by_scsi_device $disk)
|
||||
blacklist_exceptions {
|
||||
device {
|
||||
vendor Linux
|
||||
product scsi_debug
|
||||
}
|
||||
}
|
||||
|
||||
# user_friendly_names = yes and mpath=test
|
||||
#cur_dir=/mnt/tests/kernel/storage/multipath/user_friendly_names/
|
||||
#cur_dir=/home/test/scratch/device-mapper-multipath/user_friendly_names
|
||||
trun "cat multipath.conf.yes | sed "s/your_wwid/$wwid/g" > /etc/multipath.conf"
|
||||
trun "cat -n /etc/multipath.conf"
|
||||
trun "multipath -r"
|
||||
echo ">>> Verify 'test ($wwid)' is present ..."
|
||||
trun "multipath -ll"
|
||||
tok "multipath -ll | egrep \"^test\""
|
||||
multipaths {
|
||||
multipath {
|
||||
wwid TEST_WWID
|
||||
alias test
|
||||
}
|
||||
}
|
||||
_EOF_
|
||||
trun "cat /etc/multipath.conf"
|
||||
}
|
||||
|
||||
# user_friendly_names = no
|
||||
trun "cat multipath.conf.no > /etc/multipath.conf"
|
||||
trun "multipath -r"
|
||||
echo ">>> Verify 'test' is gone but '$wwid' present ..."
|
||||
trun "multipath -ll"
|
||||
tok "multipath -ll | egrep \"^$wwid\""
|
||||
sleep 10
|
||||
tok "multipath -F $wwid"
|
||||
sleep 10
|
||||
trun "modprobe -r scsi_debug"
|
||||
do_reconfigure ()
|
||||
{
|
||||
trun "cat /etc/multipath.conf"
|
||||
tok "multipathd reconfigure"
|
||||
sleep 5
|
||||
}
|
||||
|
||||
trun "cp /etc/multipath.conf.$$ /etc/multipath.conf"
|
||||
trun "multipath -F; multipath"
|
||||
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
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
defaults {
|
||||
user_friendly_names no
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
defaults {
|
||||
user_friendly_names yes
|
||||
}
|
||||
|
||||
multipaths {
|
||||
multipath {
|
||||
wwid your_wwid
|
||||
alias test
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue