diff --git a/0140-multipath-clean-up-find_multipaths-value-names.patch b/0140-multipath-clean-up-find_multipaths-value-names.patch new file mode 100644 index 0000000..b6b2288 --- /dev/null +++ b/0140-multipath-clean-up-find_multipaths-value-names.patch @@ -0,0 +1,103 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 13 Mar 2025 16:08:45 -0400 +Subject: [PATCH] multipath: clean up find_multipaths value names + +The preferred term is "on" instead of "yes". + +Signed-off-by: Benjamin Marzinski +--- + multipath/mpathconf | 14 +++++++------- + multipath/multipath.conf.5 | 14 ++++++++------ + 2 files changed, 15 insertions(+), 13 deletions(-) + +diff --git a/multipath/mpathconf b/multipath/mpathconf +index 319664b1..ce430075 100644 +--- a/multipath/mpathconf ++++ b/multipath/mpathconf +@@ -31,7 +31,7 @@ DEFAULT_CONFIG="# device-mapper-multipath configuration file + + defaults { + user_friendly_names yes +- find_multipaths yes ++ find_multipaths on + }" + + CONFIGFILE="/etc/multipath.conf" +@@ -49,7 +49,7 @@ function usage + echo "Disable: --disable" + echo "Only allow certain wwids (instead of enable): --allow " + echo "Set user_friendly_names (Default y): --user_friendly_names " +- echo "Set find_multipaths (Default y): --find_multipaths " ++ echo "Set find_multipaths (Default on): --find_multipaths " + echo "Set default property blacklist (Default n): --property_blacklist " + echo "Set enable_foreign to show foreign devices (Default n): --enable_foreign " + echo "Set recheck_wwid (Defaut n): --recheck_wwid " +@@ -253,11 +253,11 @@ function validate_args + exit 1 + fi + if [ "$FIND" = "y" ]; then +- FIND="yes" ++ FIND="on" + elif [ "$FIND" = "n" ]; then +- FIND="no" +- elif [ -n "$FIND" ] && [ "$FIND" != "yes" -a "$FIND" != "no" -a "$FIND" != "strict" -a "$FIND" != "greedy" -a "$FIND" != "smart" ]; then +- echo "--find_multipaths must be one of 'yes' 'no' 'strict' 'greedy' or 'smart'" ++ FIND="off" ++ elif [ -n "$FIND" ] && [ "$FIND" != "on" -a "$FIND" != "yes" -a "$FIND" != "off" -a "$FIND" != "no" -a "$FIND" != "strict" -a "$FIND" != "greedy" -a "$FIND" != "smart" ]; then ++ echo "--find_multipaths must be one of 'on' 'yes' 'y' 'off' 'no' 'n' 'strict' 'greedy' or 'smart'" + exit 1 + fi + if [ -n "$PROPERTY" ] && [ "$PROPERTY" != "y" -a "$PROPERTY" != "n" ]; then +@@ -422,7 +422,7 @@ if [ -n "$SHOW_STATUS" ]; then + echo "multipath is disabled" + fi + if [ -z "$HAVE_FIND" ]; then +- echo "find_multipaths is no" ++ echo "find_multipaths is off" + else + echo "find_multipaths is $HAVE_FIND" + fi +diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 +index 10eddc0c..8684bd63 100644 +--- a/multipath/multipath.conf.5 ++++ b/multipath/multipath.conf.5 +@@ -1159,22 +1159,24 @@ listed in the \fBwwids_file\fR. Users can manually set up multipath maps using t + \fBmultipathd add map\fR command. Once set up manually, the map is + remembered in the wwids file and will be set up automatically in the future. + .TP +-.I no ++.I off + Multipath behaves like \fBstrict\fR. Multipathd behaves like \fBgreedy\fR. ++\fIno\fR or \fI0\fR is accepted as an alias for \fIoff\fR. + .TP +-.I yes ++.I on + Both multipathd and multipath treat a device as multipath device if the + conditions for \fBstrict\fR are met, or if at least two non-blacklisted paths +-with the same WWID have been detected. ++with the same WWID have been detected. \fIyes\fR or \fI1\fR is accepted as an ++alias for \fIon\fR. + .TP + .I greedy + Both multipathd and multipath treat every non-blacklisted device as multipath + device path. + .TP + .I smart +-This differs from \fIfind_multipaths yes\fR only in ++This differs from \fIfind_multipaths on\fR only in + the way it treats new devices for which only one path has been +-detected yet. When such a device is first encounted in udev rules, it is ++detected yet. When such a device is first encountered in udev rules, it is + treated as a multipath device. multipathd waits whether additional paths with + the same WWID appears. If that happens, it sets up a multipath map. If it + doesn\'t happen until a +@@ -1184,7 +1186,7 @@ as non-multipath and passed on to upper layers. + \fBNote:\fR this may cause delays during device detection if + there are single-path devices which aren\'t blacklisted. + .TP +-The default is: \fBstrict\fR ++The default is: \fBoff\fR + .RE + . + . diff --git a/0141-multipathd-Add-multipathd-man-page-section-about-soc.patch b/0141-multipathd-Add-multipathd-man-page-section-about-soc.patch new file mode 100644 index 0000000..28262de --- /dev/null +++ b/0141-multipathd-Add-multipathd-man-page-section-about-soc.patch @@ -0,0 +1,71 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 6 Mar 2025 18:52:02 -0500 +Subject: [PATCH] multipathd: Add multipathd man page section about sockets + +Add a section with information about how to communicate with the +multipathd daemon to the man page. Also mention that multipathd +commands can be run directly from the command line. + +Signed-off-by: Benjamin Marzinski +--- + multipathd/multipathd.8 | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +diff --git a/multipathd/multipathd.8 b/multipathd/multipathd.8 +index d834f89e..d3aa7a73 100644 +--- a/multipathd/multipathd.8 ++++ b/multipathd/multipathd.8 +@@ -68,6 +68,18 @@ bindings file. If a \fIuser_friendly_name\fR doesn't already exist for a device, + will use its WWID as its alias. + . + .TP ++.B \-k\fIcommand\fB ++multipathd executes the given command (see \fBCOMMANDS\fR below). If the ++command contains whitespace or shell special characters, it needs to be quoted ++like in \fImultipathd -k'show topology'\fR. No whitespace is allowed between ++the \fB-k\fR and the command string. ++ ++Commands can also be issued without using \fB-k\fR. In this case, the command ++string should not be quoted. Command arguments that contain whitespace or ++special characters still need to be quoted, like in \fImultipathd show paths ++format "%n %w"\fR ++. ++.TP + .B \-k + multipathd will enter interactive mode. From this mode, the available commands can + be viewed by entering '\fIhelp\fR'. When you are finished entering commands, press +@@ -87,6 +99,33 @@ multipath devices on dmevents. Use this flag to force it to use the old event + waiting method, based on creating a seperate thread for each device. + . + . ++.\" ---------------------------------------------------------------------------- ++.SH COMMUNICATING WITH MULTIPATHD ++.\" ---------------------------------------------------------------------------- ++ ++In addition to the multipathd CLI, the \fBlibmpathcmd\fR library can be used to ++send commands (see \fBCOMMANDS\fR below) to the multipathd daemon from other ++programs. By default, multipathd listens on both the ++\fI@/org/kernel/linux/storage/multipathd\fR abstract namespace socket and the ++\fI/run/multipathd.socket\fR socket file. libmpathcmd will use either of these ++sockets to connect to multipathd. The socket file can be useful to communicate ++with multipathd from different namespaces since it can be bind mounted in them, ++unlike the abstract namespace socket. Multipathd will accept \fBlist|show\fR ++commands from any user. All other commands must be issued by root. ++ ++It is possible to change the sockets that multipathd listens on. If ++\fImultipathd.socket\fR is running, multipathd will use the sockets it listens ++on. A maximum of two sockets can be defined by \fImultipathd.socket\fR, and by ++default it listens on \fI@/org/kernel/linux/storage/multipathd\fR and ++\fI/run/multipathd.socket\fR. If \fImultipathd.socket\fR is not running, a ++single socket can be configured for listening on by setting the ++\fIMULTIPATH_SOCKET_NAME\fR environment variable when starting multipathd. This ++environment variable must also be set to make multipathd CLI commands (or any ++other program using libmpathcmd) connect to the multipathd daemon using a ++non-default socket, regardless of whether that socket was set for the daemon ++using \fImultipathd.socket\fR or the \fIMULTIPATH_SOCKET_NAME\fR environment ++variable. ++. + . + .\" ---------------------------------------------------------------------------- + .SH COMMANDS diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 8e2ac07..d5c2ad5 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.8.7 -Release: 36%{?dist} +Release: 37%{?dist} Summary: Tools to manage multipath devices using device-mapper License: GPLv2 URL: http://christophe.varoqui.free.fr/ @@ -149,6 +149,8 @@ Patch0136: 0136-multipathd-listen-on-pathname-and-abstract-socket-by.patch Patch0137: 0137-libmpathcmd-try-both-abstract-and-pathname-sockets.patch Patch0138: 0138-libmpathcmd-honor-MULTIPATH_SOCKET_NAME-environment-.patch Patch0139: 0139-multipathd-honor-MULTIPATH_SOCKET_NAME-environment-v.patch +Patch0140: 0140-multipath-clean-up-find_multipaths-value-names.patch +Patch0141: 0141-multipathd-Add-multipathd-man-page-section-about-soc.patch # runtime @@ -352,6 +354,14 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Thu Mar 13 2025 Benjamin Marzinski - 0.8.7-37 +- Add 0140-multipath-clean-up-find_multipaths-value-names.patch +- Add 0141-multipathd-Add-multipathd-man-page-section-about-soc.patch + * Fixes RHEL-82307 ("There is no man page for RFE: Enable multipathd + to communicate with a process in another network namespace") +- Fix multipath_conf_syntax OSCI test. +- Resolves: RHEL-82307 + * Tue Mar 4 2025 Benjamin Marzinski - 0.8.7-36 - Add 0128-multipath-tools-move-DEFAULT_SOCKET-definition-into-.patch - Add 0129-multipath-tools-add-helper-mpath_fill_sockaddr__.patch diff --git a/tests/multipath_conf_syntax/main.sh b/tests/multipath_conf_syntax/main.sh index fb303c3..e82f44f 100755 --- a/tests/multipath_conf_syntax/main.sh +++ b/tests/multipath_conf_syntax/main.sh @@ -44,6 +44,12 @@ assert () fi } +do_reconfigure () +{ + tok "multipathd reconfigure" + sleep 5 +} + rpm -q device-mapper-multipath || yum install -y device-mapper-multipath # cleanup existing devices and restart @@ -89,47 +95,46 @@ multipaths { } _EOF_ tok "multipath 2>&1 | grep 'missing closing quotes on line'" -trun "multipath -r" +do_reconfigure tok "multipath -ll | grep mypath" # test no value for alias trun "sed -i 's/alias.*$/alias/g' /etc/multipath.conf" -multipath tok "multipath 2>&1 | grep \"missing value for option 'alias' on line\"" -trun "multipath -r" +do_reconfigure tok "multipath -ll | grep mpath" # test missing starting quote on alias trun "sed -i 's/alias.*$/alias mypath\"/g' /etc/multipath.conf" tok "multipath 2>&1 |grep 'ignoring extra data starting with'" -trun "multipath -r" +do_reconfigure tok "multipath -ll | grep mypath" # test wrong quote on alias trun "sed -i 's/alias.*$/alias /g' /etc/multipath.conf" tnot "multipath 2>&1 | grep config" -trun "multipath -r" +do_reconfigure tok "multipath -ll | grep ''" # test value has a space trun "sed -i 's/alias.*$/alias mypath test/g' /etc/multipath.conf" tok "multipath 2>&1 |grep 'ignoring extra data starting with'" -trun "multipath -r" +do_reconfigure tok "multipath -ll | grep mypath" # test wrong alias keyword trun "sed -i 's/alias.*$/alia mypath/g' /etc/multipath.conf" tok "multipath 2>&1 | grep 'invalid keyword in the multipath section: alia'" -trun "multipath -r" +do_reconfigure tok "multipath -ll | grep mpath" trun "sed -i 's/alia.*$/alias mypath/g' /etc/multipath.conf" # test no space between the section name and the open bracket that followed it # fix issue about if a section doesn't have a space between the section name # and the open bracket, that section isn't read in. -trun "sed -i 's/multipaths.*/multipaths{/g' /etc/multipath.conf" +trun "sed -i 's/^multipaths.*/multipaths{/g' /etc/multipath.conf" tnot "multipath 2>&1 | grep config" -trun "multipath -r" +do_reconfigure tok "multipath -ll |grep mypath" # test wrong section keywords