import device-mapper-multipath-0.8.7-7.el9

This commit is contained in:
CentOS Sources 2022-03-01 08:13:18 -05:00 committed by Stepan Oksanichenko
parent c4837d47aa
commit fa1551f9ec
10 changed files with 1775 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Mon, 13 Dec 2021 14:26:30 -0600
Subject: [PATCH] RH: mpathconf: fix setting property_blacklist
If there was no blacklist_exceptions section, setting property_blacklist
didn't work correctly. Fix it.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipath/mpathconf | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/multipath/mpathconf b/multipath/mpathconf
index c00d2555..0de6b121 100644
--- a/multipath/mpathconf
+++ b/multipath/mpathconf
@@ -496,7 +496,15 @@ if [ "$PROPERTY" = "n" ]; then
CHANGED_CONFIG=1
fi
elif [ "$PROPERTY" = "y" ]; then
- if [ -z "$HAVE_PROPERTY" ]; then
+ if [ -z "$HAVE_PROPERTY" -a -z "$HAVE_EXCEPTIONS" ]; then
+ cat >> $TMPFILE << _EOF_
+
+blacklist_exceptions {
+ property "(SCSI_IDENT_|ID_WWN)"
+}
+_EOF_
+ CHANGED_CONFIG=1
+ elif [ -z "$HAVE_PROPERTY" ]; then
sed -i '/^blacklist_exceptions[[:space:]]*{/ a\
property "(SCSI_IDENT_|ID_WWN)"
' $TMPFILE

View File

@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 12 Jan 2022 12:26:12 -0600
Subject: [PATCH] libmultipath: fix disassemble status for
historical-service-time PS
The historical-service-time path selector prints out 2 path group status
arguments. This is the only path selector that uses the group status
arguments. All the others only have path status arguments.
disassemble_status() was expecting the number of group status arguments
to always be zero, causing it to fail at disassembling the status of
devices that use historical-service-time path selector. Now multipath
actually checks the number of group arguments, and skips them.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/dmparser.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c
index 4ba7f339..bc311421 100644
--- a/libmultipath/dmparser.c
+++ b/libmultipath/dmparser.c
@@ -437,9 +437,19 @@ int disassemble_status(const char *params, struct multipath *mpp)
FREE(word);
/*
- * PG Status (discarded, would be '0' anyway)
+ * Path Selector Group Arguments
*/
- p += get_word(p, NULL);
+ p += get_word(p, &word);
+
+ if (!word)
+ return 1;
+
+ num_pg_args = atoi(word);
+ free(word);
+
+ /* Ignore ps group arguments */
+ for (j = 0; j < num_pg_args; j++)
+ p += get_word(p, NULL);
p += get_word(p, &word);

View File

@ -0,0 +1,133 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Mon, 17 Jan 2022 14:45:38 -0600
Subject: [PATCH] libmultipath: make helper function to trigger path uevents
Pull the code that checks if a path needs to trigger a uevent, and
triggers, out of trigger_paths_udev_change() and into a new function,
trigger_path_udev_change(). This function will be used separately by
a future patch. No functional changes.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/configure.c | 79 +++++++++++++++++++++-------------------
libmultipath/configure.h | 1 +
2 files changed, 43 insertions(+), 37 deletions(-)
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 7edb355b..043e4232 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -565,11 +565,8 @@ unref:
}
void
-trigger_paths_udev_change(struct multipath *mpp, bool is_mpath)
+trigger_path_udev_change(struct path *pp, bool is_mpath)
{
- struct pathgroup *pgp;
- struct path *pp;
- int i, j;
/*
* If a path changes from multipath to non-multipath, we must
* synthesize an artificial "add" event, otherwise the LVM2 rules
@@ -577,6 +574,45 @@ trigger_paths_udev_change(struct multipath *mpp, bool is_mpath)
* irritate ourselves with an "add", so use "change".
*/
const char *action = is_mpath ? "change" : "add";
+ const char *env;
+
+ if (!pp->udev)
+ return;
+ /*
+ * Paths that are already classified as multipath
+ * members don't need another uevent.
+ */
+ env = udev_device_get_property_value(
+ pp->udev, "DM_MULTIPATH_DEVICE_PATH");
+
+ if (is_mpath && env != NULL && !strcmp(env, "1")) {
+ /*
+ * If FIND_MULTIPATHS_WAIT_UNTIL is not "0",
+ * path is in "maybe" state and timer is running
+ * Send uevent now (see multipath.rules).
+ */
+ env = udev_device_get_property_value(
+ pp->udev, "FIND_MULTIPATHS_WAIT_UNTIL");
+ if (env == NULL || !strcmp(env, "0"))
+ return;
+ } else if (!is_mpath &&
+ (env == NULL || !strcmp(env, "0")))
+ return;
+
+ condlog(3, "triggering %s uevent for %s (is %smultipath member)",
+ action, pp->dev, is_mpath ? "" : "no ");
+ sysfs_attr_set_value(pp->udev, "uevent",
+ action, strlen(action));
+ trigger_partitions_udev_change(pp->udev, action,
+ strlen(action));
+}
+
+void
+trigger_paths_udev_change(struct multipath *mpp, bool is_mpath)
+{
+ struct pathgroup *pgp;
+ struct path *pp;
+ int i, j;
if (!mpp || !mpp->pg)
return;
@@ -584,39 +620,8 @@ trigger_paths_udev_change(struct multipath *mpp, bool is_mpath)
vector_foreach_slot (mpp->pg, pgp, i) {
if (!pgp->paths)
continue;
- vector_foreach_slot(pgp->paths, pp, j) {
- const char *env;
-
- if (!pp->udev)
- continue;
- /*
- * Paths that are already classified as multipath
- * members don't need another uevent.
- */
- env = udev_device_get_property_value(
- pp->udev, "DM_MULTIPATH_DEVICE_PATH");
-
- if (is_mpath && env != NULL && !strcmp(env, "1")) {
- /*
- * If FIND_MULTIPATHS_WAIT_UNTIL is not "0",
- * path is in "maybe" state and timer is running
- * Send uevent now (see multipath.rules).
- */
- env = udev_device_get_property_value(
- pp->udev, "FIND_MULTIPATHS_WAIT_UNTIL");
- if (env == NULL || !strcmp(env, "0"))
- continue;
- } else if (!is_mpath &&
- (env == NULL || !strcmp(env, "0")))
- continue;
-
- condlog(3, "triggering %s uevent for %s (is %smultipath member)",
- action, pp->dev, is_mpath ? "" : "no ");
- sysfs_attr_set_value(pp->udev, "uevent",
- action, strlen(action));
- trigger_partitions_udev_change(pp->udev, action,
- strlen(action));
- }
+ vector_foreach_slot(pgp->paths, pp, j)
+ trigger_path_udev_change(pp, is_mpath);
}
mpp->needs_paths_uevent = 0;
diff --git a/libmultipath/configure.h b/libmultipath/configure.h
index efe18b7d..2bf73e65 100644
--- a/libmultipath/configure.h
+++ b/libmultipath/configure.h
@@ -56,6 +56,7 @@ int coalesce_paths (struct vectors *vecs, vector curmp, char * refwwid, int forc
int get_refwwid (enum mpath_cmds cmd, const char *dev, enum devtypes dev_type,
vector pathvec, char **wwid);
struct udev_device *get_udev_device(const char *dev, enum devtypes dev_type);
+void trigger_path_udev_change(struct path *pp, bool is_mpath);
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);

View File

@ -0,0 +1,54 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Mon, 17 Jan 2022 16:46:18 -0600
Subject: [PATCH] multipathd: trigger udev change on path addition
When a multipath device is created for the first time, there is a window
where some path devices way be added to the multipath device, but never
claimed in udev. This can allow other device owners, like lvm, to think
they can use the device.
When a multipath device is first created, all the existing paths that
are not claimed by multipath have a uevent triggered so that they can
get claimed. After that, multipath assumes all future paths added to the
multipath device will have been claimed by multipath, since the device's
WWID is now in the wwids file. This doesn't work for any paths that
have already been processed by the multipath.rules udev rules before
the multipath device was created.
To close this window, when path device is added, and a matching
multipath device already exists, multipathd now checks if the device is
claimed by multipath, and if not, triggers a uevent to claim it.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/libmultipath.version | 5 +++++
multipathd/main.c | 2 ++
2 files changed, 7 insertions(+)
diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version
index dd1b4122..0d89e9e1 100644
--- a/libmultipath/libmultipath.version
+++ b/libmultipath/libmultipath.version
@@ -292,3 +292,8 @@ LIBMULTIPATH_9.1.0 {
global:
sysfs_get_ro;
} LIBMULTIPATH_9.0.0;
+
+LIBMULTIPATH_9.1.1 {
+global:
+ trigger_path_udev_change;
+} LIBMULTIPATH_9.1.0;
diff --git a/multipathd/main.c b/multipathd/main.c
index 6145e512..5def5301 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1062,6 +1062,8 @@ ev_add_path (struct path * pp, struct vectors * vecs, int need_do_map)
free_path(pp);
return 1;
}
+ if (mpp)
+ trigger_path_udev_change(pp, true);
if (mpp && mpp->wait_for_udev &&
(pathcount(mpp, PATH_UP) > 0 ||
(pathcount(mpp, PATH_GHOST) > 0 &&

View File

@ -0,0 +1,149 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 2 Feb 2022 17:00:21 -0600
Subject: [PATCH] RH: add support to mpathconf for setting arbitrary default
options
mpathconf now supports --option <name>:[<value>] for setting, changing,
or removing options from the defaults section of multipath.conf.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipath/mpathconf | 58 ++++++++++++++++++++++++++++++++++++++++---
multipath/mpathconf.8 | 7 ++++++
2 files changed, 62 insertions(+), 3 deletions(-)
diff --git a/multipath/mpathconf b/multipath/mpathconf
index 0de6b121..6e33fb99 100644
--- a/multipath/mpathconf
+++ b/multipath/mpathconf
@@ -17,7 +17,7 @@
# This program was largely ripped off from lvmconf
#
-unset ENABLE FIND FRIENDLY PROPERTY FOREIGN MODULE MULTIPATHD HAVE_DISABLE HAVE_WWID_DISABLE HAVE_FIND HAVE_BLACKLIST HAVE_EXCEPTIONS HAVE_DEFAULTS HAVE_FRIENDLY HAVE_PROPERTY HAVE_FOREIGN HAVE_MULTIPATHD HAVE_MODULE HAVE_OUTFILE SHOW_STATUS CHANGED_CONFIG WWID_LIST
+unset ENABLE FIND FRIENDLY PROPERTY FOREIGN MODULE MULTIPATHD HAVE_DISABLE HAVE_WWID_DISABLE HAVE_FIND HAVE_BLACKLIST HAVE_EXCEPTIONS HAVE_DEFAULTS HAVE_FRIENDLY HAVE_PROPERTY HAVE_FOREIGN HAVE_MULTIPATHD HAVE_MODULE HAVE_OUTFILE SHOW_STATUS CHANGED_CONFIG WWID_LIST HAVE_OPTION OPTION_NAME OPTION_VALUE
DEFAULT_CONFIG="# device-mapper-multipath configuration file
@@ -52,6 +52,7 @@ function usage
echo "Set find_multipaths (Default y): --find_multipaths <yes|no|strict|greedy|smart>"
echo "Set default property blacklist (Default n): --property_blacklist <y|n>"
echo "Set enable_foreign to show foreign devices (Default n): --enable_foreign <y|n>"
+ echo "Add/Change/Remove option in defaults section: --option <option_name>:<value>"
echo "Load the dm-multipath modules on enable (Default y): --with_module <y|n>"
echo "start/stop/reload multipathd (Default n): --with_multipathd <y|n>"
echo "select output file (Default /etc/multipath.conf): --outfile <FILE>"
@@ -162,6 +163,20 @@ function parse_args
exit 1
fi
;;
+ --option)
+ if [ -n "$2" ]; then
+ OPTION_NAME=$(echo $2 | cut -s -f1 -d:)
+ OPTION_VALUE=$(echo $2 | cut -s -f2 -d:)
+ if [ -z "$OPTION_NAME" ]; then
+ usage
+ exit 1
+ fi
+ shift 2
+ else
+ usage
+ exit 1
+ fi
+ ;;
--enable_foreign)
if [ -n "$2" ]; then
FOREIGN=$2
@@ -208,12 +223,15 @@ function parse_args
function validate_args
{
- if [ "$ENABLE" = "0" ] && [ -n "$FRIENDLY" -o -n "$FIND" -o -n "$PROPERTY" -o -n "$MODULE" ]; then
+ if [ "$ENABLE" = "0" ] && [ -n "$FRIENDLY" -o -n "$FIND" -o -n "$PROPERTY" -o -n "$MODULE" -o -n "$FOREIGN" -o -n "$OPTION_NAME" ]; then
echo "ignoring extra parameters on disable"
FRIENDLY=""
FIND=""
PROPERTY=""
MODULE=""
+ FOREIGN=""
+ OPTION_NAME=""
+ OPTION_VALUE=""
fi
if [ -n "$FRIENDLY" ] && [ "$FRIENDLY" != "y" -a "$FRIENDLY" != "n" ]; then
echo "--user_friendly_names must be either 'y' or 'n'"
@@ -235,7 +253,19 @@ function validate_args
echo "--enable_foreign must be either 'y' or 'n'"
exit 1
fi
- if [ -z "$ENABLE" -a -z "$FIND" -a -z "$FRIENDLY" -a -z "$PROPERTY" -a -z "$FOREIGN" ]; then
+ if [ -n "$OPTION_NAME" ]; then
+ if [[ $OPTION_NAME =~ [[:space:]]|#|\"|!|\{|\} ]]; then
+ echo "--option name \"$OPTION_NAME\" is invalid"
+ exit 1
+ elif [[ $OPTION_VALUE =~ \"|#|!|\{|\} ]]; then
+ echo "--option value \"$OPTION_VALUE\" is invalid"
+ exit 1
+ fi
+ if [[ $OPTION_VALUE =~ [[:space:]] ]]; then
+ OPTION_VALUE=\"$OPTION_VALUE\"
+ fi
+ fi
+ if [ -z "$ENABLE" -a -z "$FIND" -a -z "$FRIENDLY" -a -z "$PROPERTY" -a -z "$FOREIGN" -a -z "$OPTION_NAME" ]; then
SHOW_STATUS=1
fi
if [ -n "$MODULE" ] && [ "$MODULE" != "y" -a "$MODULE" != "n" ]; then
@@ -348,6 +378,13 @@ if [ "$HAVE_DEFAULTS" = "1" ]; then
elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*enable_foreign" ; then
HAVE_FOREIGN=3
fi
+ if [ -n "$OPTION_NAME" ]; then
+ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q '^[[:space:]]*'"$OPTION_NAME"'[[:space:]][[:space:]]*'"$OPTION_VALUE" ; then
+ HAVE_OPTION=1
+ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q '^[[:space:]]*'"$OPTION_NAME"'\([[:space:]].*\)\?$' ; then
+ HAVE_OPTION=0
+ fi
+ fi
fi
if [ "$HAVE_EXCEPTIONS" = "1" ]; then
@@ -532,6 +569,21 @@ elif [ "$FOREIGN" = "y" ]; then
fi
fi
+if [ -n "$OPTION_NAME" -a -n "$OPTION_VALUE" ]; then
+ if [ -z "$HAVE_OPTION" ]; then
+ sed -i '/^defaults[[:space:]]*{/ a\
+ '"$OPTION_NAME"' '"$OPTION_VALUE"'
+' $TMPFILE
+ CHANGED_CONFIG=1
+ elif [ "$HAVE_OPTION" = 0 ]; then
+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*'"$OPTION_NAME"'\([[:space:]].*\)\?$/ '"$OPTION_NAME"' '"$OPTION_VALUE"'/' $TMPFILE
+ CHANGED_CONFIG=1
+ fi
+elif [ -n "$OPTION_NAME" -a -n "$HAVE_OPTION" ]; then
+ sed -i '/^defaults[[:space:]]*{/,/^}/{/^[[:space:]]*'"$OPTION_NAME"'\([[:space:]].*\)\?$/d}' $TMPFILE
+ CHANGED_CONFIG=1
+fi
+
if [ -f "$OUTPUTFILE" ]; then
cp $OUTPUTFILE $OUTPUTFILE.old
if [ $? != 0 ]; then
diff --git a/multipath/mpathconf.8 b/multipath/mpathconf.8
index a14d831e..496383b7 100644
--- a/multipath/mpathconf.8
+++ b/multipath/mpathconf.8
@@ -101,6 +101,13 @@ to the
defaults section. if set to \fBn\fP, this removes the line, if present. This
command can be used along with any other command.
.TP
+.B --option \fB<option_name>:[<value>]\fP
+Sets the defaults section option \fB<option_name>\fP to \fB<value>\fP. If the
+option was not previously set in the defaults section, it is added. If it was
+set, its value is changed to \fB<value>\fP. If \fB<value>\fP is left blank,
+then the option is removed from the defaults section, if was set there. This
+command can be used along with any other command.
+.TP
.B --outfile \fB<filename>\fP
Write the resulting multipath configuration to \fB<filename>\fP instead of
\fB/etc/multipath.conf\fP.

View File

@ -0,0 +1,154 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Thu, 3 Feb 2022 13:26:18 -0600
Subject: [PATCH] RH: add support to mpathconf for setting recheck_wwid
mpathconf now supports --recheck_wwid <y|n> for setthing the
recheck_wwid option
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipath/mpathconf | 48 ++++++++++++++++++++++++++++++++++++++++---
multipath/mpathconf.8 | 9 ++++++++
2 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/multipath/mpathconf b/multipath/mpathconf
index 6e33fb99..319664b1 100644
--- a/multipath/mpathconf
+++ b/multipath/mpathconf
@@ -17,7 +17,7 @@
# This program was largely ripped off from lvmconf
#
-unset ENABLE FIND FRIENDLY PROPERTY FOREIGN MODULE MULTIPATHD HAVE_DISABLE HAVE_WWID_DISABLE HAVE_FIND HAVE_BLACKLIST HAVE_EXCEPTIONS HAVE_DEFAULTS HAVE_FRIENDLY HAVE_PROPERTY HAVE_FOREIGN HAVE_MULTIPATHD HAVE_MODULE HAVE_OUTFILE SHOW_STATUS CHANGED_CONFIG WWID_LIST HAVE_OPTION OPTION_NAME OPTION_VALUE
+unset ENABLE FIND FRIENDLY PROPERTY FOREIGN MODULE MULTIPATHD HAVE_DISABLE HAVE_WWID_DISABLE HAVE_FIND HAVE_BLACKLIST HAVE_EXCEPTIONS HAVE_DEFAULTS HAVE_FRIENDLY HAVE_PROPERTY HAVE_FOREIGN HAVE_MULTIPATHD HAVE_MODULE HAVE_OUTFILE SHOW_STATUS CHANGED_CONFIG WWID_LIST HAVE_OPTION OPTION_NAME OPTION_VALUE HAVE_RECHECK_WWID RECHECK_WWID
DEFAULT_CONFIG="# device-mapper-multipath configuration file
@@ -52,6 +52,7 @@ function usage
echo "Set find_multipaths (Default y): --find_multipaths <yes|no|strict|greedy|smart>"
echo "Set default property blacklist (Default n): --property_blacklist <y|n>"
echo "Set enable_foreign to show foreign devices (Default n): --enable_foreign <y|n>"
+ echo "Set recheck_wwid (Defaut n): --recheck_wwid <y|n>"
echo "Add/Change/Remove option in defaults section: --option <option_name>:<value>"
echo "Load the dm-multipath modules on enable (Default y): --with_module <y|n>"
echo "start/stop/reload multipathd (Default n): --with_multipathd <y|n>"
@@ -145,6 +146,15 @@ function parse_args
exit 1
fi
;;
+ --recheck_wwid)
+ if [ -n "$2" ]; then
+ RECHECK_WWID=$2
+ shift 2
+ else
+ usage
+ exit 1
+ fi
+ ;;
--find_multipaths)
if [ -n "$2" ]; then
FIND=$2
@@ -223,7 +233,7 @@ function parse_args
function validate_args
{
- if [ "$ENABLE" = "0" ] && [ -n "$FRIENDLY" -o -n "$FIND" -o -n "$PROPERTY" -o -n "$MODULE" -o -n "$FOREIGN" -o -n "$OPTION_NAME" ]; then
+ if [ "$ENABLE" = "0" ] && [ -n "$FRIENDLY" -o -n "$FIND" -o -n "$PROPERTY" -o -n "$MODULE" -o -n "$FOREIGN" -o -n "$OPTION_NAME" -o -n "$RECHECK_WWID" ]; then
echo "ignoring extra parameters on disable"
FRIENDLY=""
FIND=""
@@ -232,11 +242,16 @@ function validate_args
FOREIGN=""
OPTION_NAME=""
OPTION_VALUE=""
+ RECHECK_WWID=""
fi
if [ -n "$FRIENDLY" ] && [ "$FRIENDLY" != "y" -a "$FRIENDLY" != "n" ]; then
echo "--user_friendly_names must be either 'y' or 'n'"
exit 1
fi
+ if [ -n "$RECHECK_WWID" ] && [ "$RECHECK_WWID" != "y" -a "$RECHECK_WWID" != "n" ]; then
+ echo "--recheck_wwid must be either 'y' or 'n'"
+ exit 1
+ fi
if [ "$FIND" = "y" ]; then
FIND="yes"
elif [ "$FIND" = "n" ]; then
@@ -265,7 +280,7 @@ function validate_args
OPTION_VALUE=\"$OPTION_VALUE\"
fi
fi
- if [ -z "$ENABLE" -a -z "$FIND" -a -z "$FRIENDLY" -a -z "$PROPERTY" -a -z "$FOREIGN" -a -z "$OPTION_NAME" ]; then
+ if [ -z "$ENABLE" -a -z "$FIND" -a -z "$FRIENDLY" -a -z "$PROPERTY" -a -z "$FOREIGN" -a -z "$OPTION_NAME" -a -z "$RECHECK_WWID" ]; then
SHOW_STATUS=1
fi
if [ -n "$MODULE" ] && [ "$MODULE" != "y" -a "$MODULE" != "n" ]; then
@@ -367,6 +382,11 @@ if [ "$HAVE_DEFAULTS" = "1" ]; then
elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*user_friendly_names[[:space:]][[:space:]]*\(no\|0\)" ; then
HAVE_FRIENDLY=0
fi
+ if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*recheck_wwid[[:space:]][[:space:]]*\(yes\|1\)" ; then
+ HAVE_RECHECK_WWID=1
+ elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*recheck_wwid[[:space:]][[:space:]]*\(no\|0\)" ; then
+ HAVE_RECHECK_WWID=0
+ fi
if sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*#[[:space:]]*enable_foreign" ; then
HAVE_FOREIGN=0
elif sed -n '/^defaults[[:space:]]*{/,/^}/ p' $TMPFILE | grep -q "^[[:space:]]*enable_foreign[[:space:]][[:space:]]*\"\.\*\"" ; then
@@ -411,6 +431,11 @@ if [ -n "$SHOW_STATUS" ]; then
else
echo "user_friendly_names is enabled"
fi
+ if [ -z "$HAVE_RECHECK_WWID" -o "$HAVE_RECHECK_WWID" = 0 ]; then
+ echo "recheck_wwid is disabled"
+ else
+ echo "recheck_wwid is enabled"
+ fi
if [ -z "$HAVE_PROPERTY" -o "$HAVE_PROPERTY" = 0 ]; then
echo "default property blacklist is disabled"
else
@@ -527,6 +552,23 @@ elif [ "$FRIENDLY" = "y" ]; then
fi
fi
+if [ "$RECHECK_WWID" = "n" ]; then
+ if [ "$HAVE_RECHECK_WWID" = 1 ]; then
+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*recheck_wwid[[:space:]][[:space:]]*\(yes\|1\)/ recheck_wwid no/' $TMPFILE
+ CHANGED_CONFIG=1
+ fi
+elif [ "$RECHECK_WWID" = "y" ]; then
+ if [ -z "$HAVE_RECHECK_WWID" ]; then
+ sed -i '/^defaults[[:space:]]*{/ a\
+ recheck_wwid yes
+' $TMPFILE
+ CHANGED_CONFIG=1
+ elif [ "$HAVE_RECHECK_WWID" = 0 ]; then
+ sed -i '/^defaults[[:space:]]*{/,/^}/ s/^[[:space:]]*recheck_wwid[[:space:]][[:space:]]*\(no\|0\)/ recheck_wwid yes/' $TMPFILE
+ CHANGED_CONFIG=1
+ fi
+fi
+
if [ "$PROPERTY" = "n" ]; then
if [ "$HAVE_PROPERTY" = 1 ]; then
sed -i '/^blacklist_exceptions[[:space:]]*{/,/^}/ s/^[[:space:]]*property[[:space:]][[:space:]]*\"(SCSI_IDENT_|ID_WWN)\"/# property \"(SCSI_IDENT_|ID_WWN)\"/' $TMPFILE
diff --git a/multipath/mpathconf.8 b/multipath/mpathconf.8
index 496383b7..9c2fb835 100644
--- a/multipath/mpathconf.8
+++ b/multipath/mpathconf.8
@@ -77,6 +77,15 @@ to the
defaults section. If set to \fBn\fP, this removes the line, if present. This
command can be used along with any other command.
.TP
+.B --recheck_wwid \fP { \fBy\fP | \fBn\fP }
+If set to \fBy\fP, this adds the line
+.B recheck_wwid yes
+to the
+.B /etc/multipath.conf
+defaults section, or sets an existing line to \fByes\fP. If set to \fBn\fP, this
+sets an existing \fBrecheck_wwid\fP line to \fBno\fP. This command can be used
+along with any other command.
+.TP
.B --find_multipaths\fP { \fByes\fP | \fBno\fP | \fBstrict\fP | \fBgreedy\fP | \fBsmart\fP }
If set to \fB<value>\fP, this adds the line
.B find_multipaths <value>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,73 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Fri, 11 Feb 2022 17:23:39 -0600
Subject: [PATCH] multipathd: disallow changing to/from fpin marginal paths on
reconfig
Setting marginal_pathgroups to fpin causes two new threads to be created
when multipathd starts. Turning it on after multipathd starts up won't
cause the theads to start, and turing it off won't keep the threads from
working. So disallow changing marginal_pathgroups to/from "fpin" on
reconfigure.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipath/multipath.conf.5 | 13 ++++++++-----
multipathd/main.c | 9 +++++++++
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
index 5ed2cd3c..58ad5c9c 100644
--- a/multipath/multipath.conf.5
+++ b/multipath/multipath.conf.5
@@ -1102,15 +1102,18 @@ have been tried first. This prevents the possibility of IO errors occuring
while marginal paths are still usable. After the path has been monitored
for the configured time, and is declared healthy, it will be returned to its
normal pathgroup.
-However if this option is set to \fIfpin\fR multipathd will receive fpin
+If this option is set to \fIfpin\fR, multipathd will receive fpin
notifications, set path states to "marginal" accordingly, and regroup paths
-as described for "marginal_pathgroups yes". This option can't be used in combination
-with other options for "Shaky path detection" (see below).If it is set to fpin,
-marginal_path_xyz and san_path_err_xyz parameters are implicitly set to 0.
+as described for \fIon\fR. This option can't be used in combination
+with other options for "Shaky path detection" (see below). \fBNote:\fR If this
+is set to \fIfpin\fR, the \fImarginal_path_*\fR and \fIsan_path_err_*\fR
+options are implicitly set to \fIno\fP. Also, this option cannot be switched
+either to or from \fIfpin\fR on a multipathd reconfigure. multipathd must be
+restarted for the change to take effect.
See "Shaky paths detection" below for more information.
.RS
.TP
-The default is: \fBno\fR
+The default is: \fBoff\fR
.RE
.
.
diff --git a/multipathd/main.c b/multipathd/main.c
index 53be9b95..45b9572f 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -2792,6 +2792,7 @@ int
reconfigure (struct vectors * vecs)
{
struct config * old, *conf;
+ int old_marginal_pathgroups;
conf = load_config(DEFAULT_CONFIGFILE);
if (!conf)
@@ -2819,6 +2820,14 @@ reconfigure (struct vectors * vecs)
uxsock_timeout = conf->uxsock_timeout;
old = rcu_dereference(multipath_conf);
+ old_marginal_pathgroups = old->marginal_pathgroups;
+ if ((old_marginal_pathgroups == MARGINAL_PATHGROUP_FPIN) !=
+ (conf->marginal_pathgroups == MARGINAL_PATHGROUP_FPIN)) {
+ condlog(1, "multipathd must be restarted to turn %s fpin marginal paths",
+ (old_marginal_pathgroups == MARGINAL_PATHGROUP_FPIN)?
+ "off" : "on");
+ conf->marginal_pathgroups = old_marginal_pathgroups;
+ }
conf->sequence_nr = old->sequence_nr + 1;
rcu_assign_pointer(multipath_conf, conf);
call_rcu(&old->rcu, rcu_free_config);

View File

@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 16 Feb 2022 00:12:29 -0600
Subject: [PATCH] libmultipath: fix printing native nvme multipath topology.
Since commit 2f05df4 ("libmultipath: use strbuf in print.c"), when
multipath prints the topology of native nvme devices, instead of
printing the multipath device information, it prints "w [G]:d s". This
is because nvme_style() switched from calling snprintf(), which supports
format specifiers, to append_strbuf_str(), which doesn't, while still
keeping the same string, "%%w [%%G]:%%d %%s". Remove the extra percent
signs, since they don't need to be escaped in append_strbuf_str().
Fixes: 2f05df4 ("libmultipath: use strbuf in print.c")
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
---
libmultipath/foreign/nvme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c
index d40c0869..23355ca5 100644
--- a/libmultipath/foreign/nvme.c
+++ b/libmultipath/foreign/nvme.c
@@ -335,7 +335,7 @@ static int snprint_nvme_pg(const struct gen_pathgroup *gmp,
static int nvme_style(__attribute__((unused)) const struct gen_multipath* gm,
struct strbuf *buf, __attribute__((unused)) int verbosity)
{
- return append_strbuf_str(buf, "%%w [%%G]:%%d %%s");
+ return append_strbuf_str(buf, "%w [%G]:%d %s");
}
static const struct gen_multipath_ops nvme_map_ops = {

View File

@ -1,6 +1,6 @@
Name: device-mapper-multipath
Version: 0.8.7
Release: 3%{?dist}
Release: 7%{?dist}
Summary: Tools to manage multipath devices using device-mapper
License: GPLv2
URL: http://christophe.varoqui.free.fr/
@ -44,6 +44,15 @@ Patch0031: 0031-libmultipath-cleanup-invalid-config-handling.patch
Patch0032: 0032-libmultipath-don-t-return-error-on-invalid-values.patch
Patch0033: 0033-multipathd-avoid-unnecessary-path-read-only-reloads.patch
Patch0034: 0034-multipath-fix-exit-status-of-multipath-T.patch
Patch0035: 0035-RH-mpathconf-fix-setting-property_blacklist.patch
Patch0036: 0036-libmultipath-fix-disassemble-status-for-historical-s.patch
Patch0037: 0037-libmultipath-make-helper-function-to-trigger-path-ue.patch
Patch0038: 0038-multipathd-trigger-udev-change-on-path-addition.patch
Patch0039: 0039-RH-add-support-to-mpathconf-for-setting-arbitrary-de.patch
Patch0040: 0040-RH-add-support-to-mpathconf-for-setting-recheck_wwid.patch
Patch0041: 0041-multipathd-handle-fpin-events.patch
Patch0042: 0042-multipathd-disallow-changing-to-from-fpin-marginal-p.patch
Patch0043: 0043-libmultipath-fix-printing-native-nvme-multipath-topo.patch
# runtime
@ -243,6 +252,36 @@ fi
%{_pkgconfdir}/libdmmp.pc
%changelog
* Wed Feb 16 2022 Benjamin Marzinski <bmarzins@redhat.com> - 0.8.7-7
- Add 0043-libmultipath-fix-printing-native-nvme-multipath-topo.patch
- Resolves: bz #2054839
* Wed Feb 9 2022 Benjamin Marzinski <bmarzins@redhat.com> - 0.8.7-6
- Add 0041-multipathd-handle-fpin-events.patch
- Add 0042-multipathd-disallow-changing-to-from-fpin-marginal-p.patch
* Add "marginal_pathgroups fpin" for responding to PFIN-Li events
* Fixes bz #2053642
- Modify tests/restate_module
* Always offline the path with the lowest priority
* Fixes bz #2052633
- Resolves: bz #2052633, #2053642
* Mon Feb 7 2022 Benjamin Marzinski <bmarzins@redhat.com> - 0.8.7-5
- Add 0039-RH-add-support-to-mpathconf-for-setting-arbitrary-de.patch
* Fixes bz #2050421
- Add 0040-RH-add-support-to-mpathconf-for-setting-recheck_wwid.patch
* Fixes bz #2039749
- Resolves: bz #2039749, #2050421
* Tue Jan 18 2022 Benjamin Marzinski <bmarzins@redhat.com> - 0.8.7-4
- Add 0035-RH-mpathconf-fix-setting-property_blacklist.patch
- Add 0036-libmultipath-fix-disassemble-status-for-historical-s.patch
* Fixes bz #2042032
- Add 0037-libmultipath-make-helper-function-to-trigger-path-ue.patch
- Add 0038-multipathd-trigger-udev-change-on-path-addition.patch
* Fixes bz #2028835
- Resolves: bz #2028835, #2042032
* Fri Nov 19 2021 Benjamin Marzinski <bmarzins@redhat.com> - 0.8.7-3
- Add 0024-libmultipath-use-typedef-for-keyword-handler-functio.patch
- Add 0025-libmultipath-print-the-correct-file-when-parsing-fai.patch