import device-mapper-multipath-0.8.4-17.el8

This commit is contained in:
CentOS Sources 2021-07-28 04:19:49 +00:00 committed by Andrew Lukoshko
parent eb3589e74b
commit 0e21d66b87
5 changed files with 257 additions and 1 deletions

View File

@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Thu, 15 Jul 2021 14:48:15 -0500
Subject: [PATCH] multipath.conf: fix typo in checker_timeout description
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
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 6da15aad..0c04c7e4 100644
--- a/multipath/multipath.conf.5
+++ b/multipath/multipath.conf.5
@@ -638,7 +638,7 @@ Specify the timeout to use for path checkers and prioritizers, in seconds.
Only prioritizers that issue scsi commands use checker_timeout. Checkers
that support an asynchronous mode (\fItur\fR and \fIdirectio\fR), will
return shortly after being called by multipathd, regardless of whether the
-storage array responds. If the storage array hasn't responded, mulitpathd will
+storage array responds. If the storage array hasn't responded, multipathd will
check for a response every second, until \fIchecker_timeout\fR seconds have
elapsed.
.RS

View File

@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Thu, 22 Jul 2021 17:48:06 -0500
Subject: [PATCH] mpathpersist: fail commands when no usable paths exist
"mpathpersist -oCK <reservation_key> <device>" 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 <bmarzins@redhat.com>
---
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 07a5f17f..d0744773 100644
--- a/libmpathpersist/mpath_persist.c
+++ b/libmpathpersist/mpath_persist.c
@@ -629,7 +629,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,
@@ -688,6 +689,11 @@ int mpath_prout_rel(struct multipath *mpp,int rq_servact, int rq_scope,
active_pathcount = pathcount (mpp, PATH_UP) + pathcount (mpp, PATH_GHOST);
+ 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++){

View File

@ -0,0 +1,107 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
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 <bmarzins@redhat.com>
---
libmultipath/configure.c | 13 +++++++++++--
libmultipath/configure.h | 1 +
multipath/main.c | 5 +++++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index f24d9283..9c8d3e34 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -1043,7 +1043,8 @@ deadmap (struct multipath * mpp)
return 1; /* dead */
}
-int check_daemon(void)
+extern int
+check_daemon(void)
{
int fd;
char *reply;
@@ -1097,6 +1098,8 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid,
struct config *conf;
int allow_queueing;
uint64_t *size_mismatch_seen;
+ bool map_processed = false;
+ bool no_daemon = false;
/* ignore refwwid if it's empty */
if (refwwid && !strlen(refwwid))
@@ -1239,7 +1242,9 @@ int coalesce_paths (struct vectors * vecs, vector newmp, 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 "
@@ -1267,6 +1272,7 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid,
else
remove_map(mpp, vecs, 0);
}
+ map_processed = true;
}
/*
* Flush maps with only dead paths (ie not in sysfs)
@@ -1292,6 +1298,9 @@ int coalesce_paths (struct vectors * vecs, vector newmp, 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 81090dd4..8a266d31 100644
--- a/libmultipath/configure.h
+++ b/libmultipath/configure.h
@@ -59,3 +59,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/multipath/main.c b/multipath/main.c
index 607cada2..14d045c9 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -254,6 +254,7 @@ get_dm_mpvec (enum mpath_cmds cmd, vector curmp, vector pathvec, char * refwwid)
int i;
struct multipath * mpp;
char params[PARAMS_SIZE], status[PARAMS_SIZE];
+ bool maps_present = false;
if (dm_get_maps(curmp))
return 1;
@@ -302,6 +303,8 @@ 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) {
@@ -311,6 +314,8 @@ get_dm_mpvec (enum mpath_cmds cmd, vector curmp, vector pathvec, char * refwwid)
put_multipath_config(conf);
}
+ if (maps_present && !check_daemon())
+ condlog(2, "multipath devices exist, but multipathd service is not running");
return 0;
}

View File

@ -0,0 +1,64 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Fri, 23 Jul 2021 14:10:06 -0500
Subject: [PATCH] multipathd: don't access path if it was deleted
ev_remove_path() could fail and still delete the path. This could cause
problems for handle_path_wwid_change(), which expected that a failure
meant that the path still existed. ev_remove_path now returns a
different error code for failure to reload the multipath device, so that
it can be differentiated from cases where the path was no removed.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipathd/main.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/multipathd/main.c b/multipathd/main.c
index e6c19ab2..823b53a2 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -86,6 +86,9 @@
#define FILE_NAME_SIZE 256
#define CMDSIZE 160
+#define PATH_REMOVE_FAILED 1
+#define MAP_RELOAD_FAILED 2
+
#define LOG_MSG(lvl, verb, pp) \
do { \
if (pp->mpp && checker_selected(&pp->checker) && \
@@ -840,7 +843,7 @@ handle_path_wwid_change(struct path *pp, struct vectors *vecs)
return;
udd = udev_device_ref(pp->udev);
- if (ev_remove_path(pp, vecs, 1) != 0 && pp->mpp) {
+ if (ev_remove_path(pp, vecs, 1) == PATH_REMOVE_FAILED && pp->mpp) {
pp->dmstate = PSTATE_FAILED;
dm_fail_path(pp->mpp->alias, pp->dev_t);
}
@@ -1226,13 +1229,13 @@ ev_remove_path (struct path *pp, struct vectors * vecs, int need_do_map)
condlog(0, "%s: failed in domap for "
"removal of path %s",
mpp->alias, pp->dev);
- retval = 1;
+ retval = MAP_RELOAD_FAILED;
} else {
/*
* update our state from kernel
*/
if (setup_multipath(vecs, mpp))
- return 1;
+ return PATH_REMOVE_FAILED;
sync_map_state(mpp);
condlog(2, "%s [%s]: path removed from map %s",
@@ -1250,7 +1253,7 @@ out:
fail:
remove_map_and_stop_waiter(mpp, vecs);
- return 1;
+ return PATH_REMOVE_FAILED;
}
static int

View File

@ -1,7 +1,7 @@
Summary: Tools to manage multipath devices using device-mapper
Name: device-mapper-multipath
Version: 0.8.4
Release: 14%{?dist}
Release: 17%{?dist}
License: GPLv2
Group: System Environment/Base
URL: http://christophe.varoqui.free.fr/
@ -83,6 +83,10 @@ Patch00069: 0069-RH-make-parse_vpd_pg83-match-scsi_id-output.patch
Patch00070: 0070-multipathd-improve-getting-parent-udevice-in-rescan_.patch
Patch00071: 0071-multipathd-don-t-trigger-uevent-for-partitions-on-ww.patch
Patch00072: 0072-RH-mpathconf-correctly-handle-spaces-after-option-na.patch
Patch00073: 0073-multipath.conf-fix-typo-in-checker_timeout-descripti.patch
Patch00074: 0074-mpathpersist-fail-commands-when-no-usable-paths-exis.patch
Patch00075: 0075-multipath-print-warning-if-multipathd-is-not-running.patch
Patch00076: 0076-multipathd-don-t-access-path-if-it-was-deleted.patch
# runtime
Requires: %{name}-libs = %{version}-%{release}
@ -284,6 +288,23 @@ fi
%{_pkgconfdir}/libdmmp.pc
%changelog
* Fri Jul 23 2021 Benjamin Marzinski <bmarzins@redhat.com> 0.8.4-17
- Add 0074-mpathpersist-fail-commands-when-no-usable-paths-exis.patch
* Fixes bz #1984723
- Add 0075-multipath-print-warning-if-multipathd-is-not-running.patch
* Fixes bz #1973592
- Add 0076-multipathd-don-t-access-path-if-it-was-deleted.patch
* Found by coverity
- Resolves: bz #1973592, #1984723
* Thu Jul 22 2021 Benjamin Marzinski <bmarzins@redhat.com> 0.8.4-16
- Add missing patch
- Related: bz #1982598
* Thu Jul 22 2021 Benjamin Marzinski <bmarzins@redhat.com> 0.8.4-15
- Add 0073-multipath.conf-fix-typo-in-checker_timeout-descripti.patch
- Resolves: bz #1982598
* Mon Jul 12 2021 Benjamin Marzinski <bmarzins@redhat.com> 0.8.4-14
- Add 0072-RH-mpathconf-correctly-handle-spaces-after-option-na.patch
- Resolves: bz #1979470