From e6aef775e4bdae6bc106e426d102c175339cb562 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Fri, 30 Jul 2021 18:26:16 -0500 Subject: [PATCH] device-mapper-multipath-0.8.6-5 Add 0018-multipath.conf-fix-typo-in-ghost_delay-description.patch Add 0019-mpathpersist-fail-commands-when-no-usable-paths-exis.patch * Fixes bz #1982613 Add 0020-multipath-print-warning-if-multipathd-is-not-running.patch * Fixes bz #1982615 Add 0021-libmultipath-deal-with-dynamic-PTHREAD_STACK_MIN.patch * Fixes bz #1984921 Resolves: bz #1982613, #1982615, #1984921 --- ...-fix-typo-in-ghost_delay-description.patch | 23 ++++ ...l-commands-when-no-usable-paths-exis.patch | 41 ++++++ ...warning-if-multipathd-is-not-running.patch | 119 ++++++++++++++++++ ...-deal-with-dynamic-PTHREAD_STACK_MIN.patch | 31 +++++ device-mapper-multipath.spec | 16 ++- 5 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 0018-multipath.conf-fix-typo-in-ghost_delay-description.patch create mode 100644 0019-mpathpersist-fail-commands-when-no-usable-paths-exis.patch create mode 100644 0020-multipath-print-warning-if-multipathd-is-not-running.patch create mode 100644 0021-libmultipath-deal-with-dynamic-PTHREAD_STACK_MIN.patch diff --git a/0018-multipath.conf-fix-typo-in-ghost_delay-description.patch b/0018-multipath.conf-fix-typo-in-ghost_delay-description.patch new file mode 100644 index 0000000..4ee62d9 --- /dev/null +++ b/0018-multipath.conf-fix-typo-in-ghost_delay-description.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 15 Jul 2021 14:46:49 -0500 +Subject: [PATCH] multipath.conf: fix typo in ghost_delay description + +Signed-off-by: Benjamin Marzinski +--- + multipath/multipath.conf.5 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 +index 0d2bce09..689d09aa 100644 +--- a/multipath/multipath.conf.5 ++++ b/multipath/multipath.conf.5 +@@ -1251,7 +1251,7 @@ The default is: in \fB/sys/block//queue/max_sectors_kb\fR + Sets the number of seconds that multipath will wait after creating a device + with only ghost paths before marking it ready for use in systemd. This gives + the active paths time to appear before the multipath runs the hardware handler +-to switch the ghost paths to active ones. Setting this to \fI0\fR or \fIon\fR ++to switch the ghost paths to active ones. Setting this to \fI0\fR or \fIno\fR + makes multipath immediately mark a device with only ghost paths as ready. + .RS + .TP diff --git a/0019-mpathpersist-fail-commands-when-no-usable-paths-exis.patch b/0019-mpathpersist-fail-commands-when-no-usable-paths-exis.patch new file mode 100644 index 0000000..32f4f60 --- /dev/null +++ b/0019-mpathpersist-fail-commands-when-no-usable-paths-exis.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 15 Jul 2021 17:09:05 -0500 +Subject: [PATCH] mpathpersist: fail commands when no usable paths exist + +"mpathpersist -oCK " will return success if it +is run on devices with no usable paths, but nothing is actually done. +The -L command will fail, but it should give up sooner, and with a more +helpful error message. + +Signed-off-by: Benjamin Marzinski +--- + libmpathpersist/mpath_persist.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c +index 190e9707..26710e79 100644 +--- a/libmpathpersist/mpath_persist.c ++++ b/libmpathpersist/mpath_persist.c +@@ -604,7 +604,8 @@ int mpath_prout_common(struct multipath *mpp,int rq_servact, int rq_scope, + return ret ; + } + } +- return MPATH_PR_SUCCESS; ++ condlog (0, "%s: no path available", mpp->wwid); ++ return MPATH_PR_DMMP_ERROR; + } + + int send_prout_activepath(char * dev, int rq_servact, int rq_scope, +@@ -663,6 +664,11 @@ int mpath_prout_rel(struct multipath *mpp,int rq_servact, int rq_scope, + + active_pathcount = count_active_paths(mpp); + ++ if (active_pathcount == 0) { ++ condlog (0, "%s: no path available", mpp->wwid); ++ return MPATH_PR_DMMP_ERROR; ++ } ++ + struct threadinfo thread[active_pathcount]; + memset(thread, 0, sizeof(thread)); + for (i = 0; i < active_pathcount; i++){ diff --git a/0020-multipath-print-warning-if-multipathd-is-not-running.patch b/0020-multipath-print-warning-if-multipathd-is-not-running.patch new file mode 100644 index 0000000..9321b28 --- /dev/null +++ b/0020-multipath-print-warning-if-multipathd-is-not-running.patch @@ -0,0 +1,119 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Fri, 16 Jul 2021 12:39:17 -0500 +Subject: [PATCH] multipath: print warning if multipathd is not running. + +If multipath notices that multipath devices exist or were created, and +multipathd is not running, it now prints a warning message, so users are +notified of the issue. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/configure.c | 13 +++++++++++-- + libmultipath/configure.h | 1 + + libmultipath/libmultipath.version | 5 +++++ + multipath/main.c | 5 +++++ + 4 files changed, 22 insertions(+), 2 deletions(-) + +diff --git a/libmultipath/configure.c b/libmultipath/configure.c +index 6ca1f4bb..9da85ce6 100644 +--- a/libmultipath/configure.c ++++ b/libmultipath/configure.c +@@ -1083,7 +1083,8 @@ deadmap (struct multipath * mpp) + return 1; /* dead */ + } + +-int check_daemon(void) ++extern int ++check_daemon(void) + { + int fd; + char *reply; +@@ -1138,6 +1139,8 @@ int coalesce_paths (struct vectors *vecs, vector mpvec, char *refwwid, + struct config *conf; + int allow_queueing; + struct bitfield *size_mismatch_seen; ++ bool map_processed = false; ++ bool no_daemon = false; + + /* ignore refwwid if it's empty */ + if (refwwid && !strlen(refwwid)) +@@ -1288,7 +1291,9 @@ int coalesce_paths (struct vectors *vecs, vector mpvec, char *refwwid, + conf = get_multipath_config(); + allow_queueing = conf->allow_queueing; + put_multipath_config(conf); +- if (!is_daemon && !allow_queueing && !check_daemon()) { ++ if (!is_daemon && !allow_queueing && ++ (no_daemon || !check_daemon())) { ++ no_daemon = true; + if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF && + mpp->no_path_retry != NO_PATH_RETRY_FAIL) + condlog(3, "%s: multipathd not running, unset " +@@ -1311,6 +1316,7 @@ int coalesce_paths (struct vectors *vecs, vector mpvec, char *refwwid, + else + remove_map(mpp, vecs->pathvec, vecs->mpvec, + KEEP_VEC); ++ map_processed = true; + } + /* + * Flush maps with only dead paths (ie not in sysfs) +@@ -1336,6 +1342,9 @@ int coalesce_paths (struct vectors *vecs, vector mpvec, char *refwwid, + condlog(2, "%s: remove (dead)", alias); + } + } ++ if (map_processed && !is_daemon && (no_daemon || !check_daemon())) ++ condlog(2, "multipath devices exist, but multipathd service is not running"); ++ + ret = CP_OK; + out: + free(size_mismatch_seen); +diff --git a/libmultipath/configure.h b/libmultipath/configure.h +index 70cf77a3..741066b3 100644 +--- a/libmultipath/configure.h ++++ b/libmultipath/configure.h +@@ -60,3 +60,4 @@ struct udev_device *get_udev_device(const char *dev, enum devtypes dev_type); + void trigger_paths_udev_change(struct multipath *mpp, bool is_mpath); + void trigger_partitions_udev_change(struct udev_device *dev, const char *action, + int len); ++int check_daemon(void); +diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version +index 0cff3111..d8be5fd2 100644 +--- a/libmultipath/libmultipath.version ++++ b/libmultipath/libmultipath.version +@@ -274,3 +274,8 @@ global: + local: + *; + }; ++ ++LIBMULTIPATH_5.1.0 { ++global: ++ check_daemon; ++} LIBMULTIPATH_5.0.0; +diff --git a/multipath/main.c b/multipath/main.c +index 9fe53dcd..85e4481d 100644 +--- a/multipath/main.c ++++ b/multipath/main.c +@@ -182,6 +182,7 @@ get_dm_mpvec (enum mpath_cmds cmd, vector curmp, vector pathvec, char * refwwid) + int i; + struct multipath * mpp; + int flags = (cmd == CMD_LIST_SHORT ? DI_NOIO : DI_ALL); ++ bool maps_present = false; + + if (dm_get_maps(curmp)) + return 1; +@@ -214,11 +215,15 @@ get_dm_mpvec (enum mpath_cmds cmd, vector curmp, vector pathvec, char * refwwid) + + if (cmd == CMD_CREATE) + reinstate_paths(mpp); ++ ++ maps_present = true; + } + + if (cmd == CMD_LIST_SHORT || cmd == CMD_LIST_LONG) + print_foreign_topology(libmp_verbosity); + ++ if (maps_present && !check_daemon()) ++ condlog(2, "multipath devices exist, but multipathd service is not running"); + return 0; + } + diff --git a/0021-libmultipath-deal-with-dynamic-PTHREAD_STACK_MIN.patch b/0021-libmultipath-deal-with-dynamic-PTHREAD_STACK_MIN.patch new file mode 100644 index 0000000..11d8b4e --- /dev/null +++ b/0021-libmultipath-deal-with-dynamic-PTHREAD_STACK_MIN.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 29 Jul 2021 13:16:57 -0500 +Subject: [PATCH] libmultipath: deal with dynamic PTHREAD_STACK_MIN + +Starting in glibc-2.34 (commit 5d98a7da), PTHREAD_STACK_MIN is defined +as sysconf(_SC_THREAD_STACK_MIN) if _GNU_SOURCE is defined. sysconf() +returns a long and can, at least in theory, return -1. This change +causes compilation to fail in setup_thread_attr() due to a comparision +with different signedness, since stacksize is a size_t. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/util.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libmultipath/util.c b/libmultipath/util.c +index 0e37f3ff..17f8fcc6 100644 +--- a/libmultipath/util.c ++++ b/libmultipath/util.c +@@ -223,8 +223,8 @@ setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached) + + ret = pthread_attr_init(attr); + assert(ret == 0); +- if (stacksize < PTHREAD_STACK_MIN) +- stacksize = PTHREAD_STACK_MIN; ++ if (PTHREAD_STACK_MIN > 0 && stacksize < (size_t)PTHREAD_STACK_MIN) ++ stacksize = (size_t)PTHREAD_STACK_MIN; + ret = pthread_attr_setstacksize(attr, stacksize); + assert(ret == 0); + if (detached) { diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 7edef6a..1f0bdc5 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.8.6 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Tools to manage multipath devices using device-mapper License: GPLv2 URL: http://christophe.varoqui.free.fr/ @@ -27,6 +27,10 @@ Patch0014: 0014-multipath-free-vectors-in-configure.patch Patch0015: 0015-kpartx-Don-t-leak-memory-when-getblock-returns-NULL.patch Patch0016: 0016-multipathd-don-t-rescan_path-on-wwid-change-in-uev_u.patch Patch0017: 0017-RH-mpathconf-correctly-handle-spaces-after-option-na.patch +Patch0018: 0018-multipath.conf-fix-typo-in-ghost_delay-description.patch +Patch0019: 0019-mpathpersist-fail-commands-when-no-usable-paths-exis.patch +Patch0020: 0020-multipath-print-warning-if-multipathd-is-not-running.patch +Patch0021: 0021-libmultipath-deal-with-dynamic-PTHREAD_STACK_MIN.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -225,6 +229,16 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Fri Jul 23 2021 Benjamin Marzinski - 0.8.6-5 +- Add 0018-multipath.conf-fix-typo-in-ghost_delay-description.patch +- Add 0019-mpathpersist-fail-commands-when-no-usable-paths-exis.patch + * Fixes bz #1982613 +- Add 0020-multipath-print-warning-if-multipathd-is-not-running.patch + * Fixes bz #1982615 +- Add 0021-libmultipath-deal-with-dynamic-PTHREAD_STACK_MIN.patch + * Fixes bz #1984921 +- Resolves: bz #1982613, #1982615, #1984921 + * Mon Jul 12 2021 Benjamin Marzinski - 0.8.6-4 - Add 0017-RH-mpathconf-correctly-handle-spaces-after-option-na.patch - Resolves: bz #1981594