From 6496193f3f25e1033cd68e6248baaa16bd4bf4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 17 Apr 2024 22:49:31 +0200 Subject: [PATCH 01/19] Stop harcoding paths Preparation for https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin. Packages must honour macros for directories, in particular %_sbindir may be set to /usr/bin. --- device-mapper-multipath.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 3cf8fb0..78bef5a 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -115,7 +115,6 @@ device-mapper-multipath's libdmmp C API library 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 From 588b3f63e9e24d8b4e5e810601fd417301f95e5a Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Mon, 20 May 2024 22:01:48 -0400 Subject: [PATCH 02/19] device-mapper-multipath-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 --- .gitignore | 1 + ...s-fix-misspelled-DM_UDEV_DISABLE_OTH.patch | 27 ++ ...ondlog-level-for-setscheduler-error-.patch | 27 ++ ...e-multipathd-scheduling-configurable.patch | 87 +++++ ...til-really-always-use-glibc-basename.patch | 144 ++++++++ ...multipathd-set-priority-to-RLIMIT_RT.patch | 134 +++++++ ...PUWeight-to-1000-and-LimitRTPRIO-to-.patch | 33 ++ ...s-explain-logic-for-device-becoming-.patch | 30 ++ ...s-don-t-import-DM_NOSCAN-from-udev-d.patch | 37 ++ ...s-don-t-import-ID_FS_VERSION-from-ud.patch | 27 ++ ...s-adapt-MPATH_DEVICE_READY-0-logic-t.patch | 67 ++++ ...s-adapt-coldplug-event-handling-ro-1.patch | 43 +++ ...s-don-t-import-properties-with-new-1.patch | 36 ++ ...s-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch | 75 ++++ ...ules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch | 55 +++ ...ull-pointer-dereference-in-uev_updat.patch | 27 -- ...path.rules-simplify-PATH_FAILED-case.patch | 38 ++ ...ipathd-fix-auto-resize-configuration.patch | 42 --- ...ules-make-label-names-more-intuitive.patch | 109 ++++++ 0017-kpartx.rules-ignore-DM_SUSPENDED.patch | 29 ++ ...tests-fix-CI-failures-on-arm-v7-with.patch | 270 ++++++++++++++ ...tests-fix-CI-failures-with-clang-on-.patch | 246 +++++++++++++ ...GitHub-actions-fixes-for-spelling-CI.patch | 31 ++ ...-run-workflows-if-workflow-file-has-.patch | 146 ++++++++ 0022-multipath-tools-add-TGTDIR-option.patch | 106 ++++++ ...ath-move-get_udev_for_mpp-to-sysfs.c.patch | 87 +++++ ...ibmultipath-add-mp_find_path_by_devt.patch | 60 +++ ...ath-fix-max_sectors_kb-on-adding-pat.patch | 33 ++ ...y-set-max_sectors_kb-on-map-creation.patch | 122 ++++++ ...th-set-max_sectors_kb-in-adopt_paths.patch | 233 ++++++++++++ ...-wildcard-k-for-printing-max_sectors.patch | 89 +++++ ...-update-documentation-for-max_sector.patch | 57 +++ ...th-tools-simplify-comment-in-hwtable.patch | 34 ++ ...tools-unify-text-in-multipath.conf.5.patch | 75 ++++ ...ltipath-tools-update-man-pages-dates.patch | 86 +++++ 0033-libmultipath-export-partmap_in_use.patch | 53 +++ ...nge-flush_on_last_del-to-fix-a-multi.patch | 346 ++++++++++++++++++ ...ove-redundant-config-option-from-Inf.patch | 31 ++ ...-dev_loss_tmo-to-avoid-race-with-no_.patch | 40 ++ ...x-deferred_remove-function-arguments.patch | 107 ++++++ ...e-bitwise-flags-for-map-flushing-API.patch | 212 +++++++++++ ...e-bitwise-flags-for-dm_simplecmd-API.patch | 117 ++++++ ...dd-argument-names-to-some-prototypes.patch | 34 ++ 0041-libmultipath-bump-version-to-0.9.9.patch | 27 ++ ...kflows-native.yaml-run-for-Fedora-40.patch | 24 ++ 0043-update-NEWS.md.patch | 134 +++++++ ...ultipath.conf.5.in-fix-man-page-date.patch | 24 ++ ... 0045-RH-fixup-udev-rules-for-redhat.patch | 16 +- ...property-blacklist-exception-builtin.patch | 6 +- ...RH-don-t-start-without-a-config-file.patch | 20 +- ...H-Fix-nvme-function-missing-argument.patch | 0 ... 0049-RH-use-rpm-optflags-if-present.patch | 10 +- ...hconf.patch => 0050-RH-add-mpathconf.patch | 13 +- ...om-kernel-cmdline-mpath.wwids-with-A.patch | 10 +- ...-default-find_mutipaths-value-to-off.patch | 6 +- ...empt-to-get-ANA-info-via-sysfs-first.patch | 0 ...-parse_vpd_pg83-match-scsi_id-output.patch | 18 +- ...si-device-handlers-to-modules-load.d.patch | 2 +- ...-RH-compile-with-libreadline-support.patch | 2 +- ...up.patch => 0057-RH-Add-mpathcleanup.patch | 8 +- device-mapper-multipath.spec | 91 ++++- sources | 2 +- 62 files changed, 3951 insertions(+), 145 deletions(-) create mode 100644 0001-11-dm-mpath.rules-fix-misspelled-DM_UDEV_DISABLE_OTH.patch create mode 100644 0002-multipathd-use-condlog-level-for-setscheduler-error-.patch create mode 100644 0003-multipathd-make-multipathd-scheduling-configurable.patch create mode 100644 0004-libmpathutil-really-always-use-glibc-basename.patch create mode 100644 0005-multipathd-make-multipathd-set-priority-to-RLIMIT_RT.patch create mode 100644 0006-multipathd-Set-CPUWeight-to-1000-and-LimitRTPRIO-to-.patch create mode 100644 0007-11-dm-mpath.rules-explain-logic-for-device-becoming-.patch create mode 100644 0008-11-dm-mpath.rules-don-t-import-DM_NOSCAN-from-udev-d.patch create mode 100644 0009-11-dm-mpath.rules-don-t-import-ID_FS_VERSION-from-ud.patch create mode 100644 0010-11-dm-mpath.rules-adapt-MPATH_DEVICE_READY-0-logic-t.patch create mode 100644 0011-11-dm-mpath.rules-adapt-coldplug-event-handling-ro-1.patch create mode 100644 0012-11-dm-mpath.rules-don-t-import-properties-with-new-1.patch create mode 100644 0013-11-dm-mpath.rules-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch create mode 100644 0014-11-dm-mpath.rules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch delete mode 100644 0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch create mode 100644 0015-11-dm-mpath.rules-simplify-PATH_FAILED-case.patch delete mode 100644 0015-multipathd-fix-auto-resize-configuration.patch create mode 100644 0016-11-dm-mpath.rules-make-label-names-more-intuitive.patch create mode 100644 0017-kpartx.rules-ignore-DM_SUSPENDED.patch create mode 100644 0018-multipath-tools-tests-fix-CI-failures-on-arm-v7-with.patch create mode 100644 0019-multipath-tools-tests-fix-CI-failures-with-clang-on-.patch create mode 100644 0020-GitHub-actions-fixes-for-spelling-CI.patch create mode 100644 0021-GitHub-workflows-run-workflows-if-workflow-file-has-.patch create mode 100644 0022-multipath-tools-add-TGTDIR-option.patch create mode 100644 0023-libmultipath-move-get_udev_for_mpp-to-sysfs.c.patch create mode 100644 0024-libmultipath-add-mp_find_path_by_devt.patch create mode 100644 0025-Revert-libmultipath-fix-max_sectors_kb-on-adding-pat.patch create mode 100644 0026-libmultipath-Only-set-max_sectors_kb-on-map-creation.patch create mode 100644 0027-libmultipath-set-max_sectors_kb-in-adopt_paths.patch create mode 100644 0028-libmultipath-add-wildcard-k-for-printing-max_sectors.patch create mode 100644 0029-multipath.conf-5-update-documentation-for-max_sector.patch create mode 100644 0030-multipath-tools-simplify-comment-in-hwtable.patch create mode 100644 0031-multipath-tools-unify-text-in-multipath.conf.5.patch create mode 100644 0032-multipath-tools-update-man-pages-dates.patch create mode 100644 0033-libmultipath-export-partmap_in_use.patch create mode 100644 0034-libmultipath-change-flush_on_last_del-to-fix-a-multi.patch create mode 100644 0035-libmultipath-remove-redundant-config-option-from-Inf.patch create mode 100644 0036-libmultipath-pad-dev_loss_tmo-to-avoid-race-with-no_.patch create mode 100644 0037-libmultipath-fix-deferred_remove-function-arguments.patch create mode 100644 0038-libmultipath-use-bitwise-flags-for-map-flushing-API.patch create mode 100644 0039-libmultipath-use-bitwise-flags-for-dm_simplecmd-API.patch create mode 100644 0040-libmultipath-add-argument-names-to-some-prototypes.patch create mode 100644 0041-libmultipath-bump-version-to-0.9.9.patch create mode 100644 0042-GitHub-Workflows-native.yaml-run-for-Fedora-40.patch create mode 100644 0043-update-NEWS.md.patch create mode 100644 0044-multipath.conf.5.in-fix-man-page-date.patch rename 0001-RH-fixup-udev-rules-for-redhat.patch => 0045-RH-fixup-udev-rules-for-redhat.patch (86%) rename 0002-RH-Remove-the-property-blacklist-exception-builtin.patch => 0046-RH-Remove-the-property-blacklist-exception-builtin.patch (96%) rename 0003-RH-don-t-start-without-a-config-file.patch => 0047-RH-don-t-start-without-a-config-file.patch (92%) rename 0004-RH-Fix-nvme-function-missing-argument.patch => 0048-RH-Fix-nvme-function-missing-argument.patch (100%) rename 0005-RH-use-rpm-optflags-if-present.patch => 0049-RH-use-rpm-optflags-if-present.patch (87%) rename 0006-RH-add-mpathconf.patch => 0050-RH-add-mpathconf.patch (98%) rename 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch => 0051-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch (96%) rename 0008-RH-reset-default-find_mutipaths-value-to-off.patch => 0052-RH-reset-default-find_mutipaths-value-to-off.patch (91%) rename 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch => 0053-RH-attempt-to-get-ANA-info-via-sysfs-first.patch (100%) rename 0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch => 0054-RH-make-parse_vpd_pg83-match-scsi_id-output.patch (84%) rename 0011-RH-add-scsi-device-handlers-to-modules-load.d.patch => 0055-RH-add-scsi-device-handlers-to-modules-load.d.patch (96%) rename 0012-RH-compile-with-libreadline-support.patch => 0056-RH-compile-with-libreadline-support.patch (96%) rename 0013-RH-Add-mpathcleanup.patch => 0057-RH-Add-mpathcleanup.patch (96%) diff --git a/.gitignore b/.gitignore index f698d08..80e9936 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ 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 diff --git a/0001-11-dm-mpath.rules-fix-misspelled-DM_UDEV_DISABLE_OTH.patch b/0001-11-dm-mpath.rules-fix-misspelled-DM_UDEV_DISABLE_OTH.patch new file mode 100644 index 0000000..4b9d7fc --- /dev/null +++ b/0001-11-dm-mpath.rules-fix-misspelled-DM_UDEV_DISABLE_OTH.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 1 Mar 2024 18:16:32 +0100 +Subject: [PATCH] 11-dm-mpath.rules: fix misspelled + DM_UDEV_DISABLE_OTHER_RULES_FLAG + +Fixes: b3582da ("11-dm-mpath.rules: use import logic like 13-dm-disk.rules") +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index d364f9bc..d9585abf 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -116,7 +116,7 @@ LABEL="scan_import" + ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="import_end" + + # Don't import the properties from db if we will run blkid later. +-ENV{DM_NOSCAN}!="1", ENV{DM_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" ++ENV{DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" + + IMPORT{db}="ID_FS_TYPE" + IMPORT{db}="ID_FS_USAGE" diff --git a/0002-multipathd-use-condlog-level-for-setscheduler-error-.patch b/0002-multipathd-use-condlog-level-for-setscheduler-error-.patch new file mode 100644 index 0000000..8a6ff99 --- /dev/null +++ b/0002-multipathd-use-condlog-level-for-setscheduler-error-.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Fri, 1 Mar 2024 19:37:29 -0500 +Subject: [PATCH] multipathd: use condlog level for setscheduler error message + +condlog uses its own log levels, so LOG_WARNING makes no sense. It +actually translates to a message sent at the LOG_DEBUG level. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + multipathd/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipathd/main.c b/multipathd/main.c +index 6193e691..85ac540f 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -3178,7 +3178,7 @@ setscheduler (void) + res = sched_setscheduler (0, SCHED_RR, &sched_param); + + if (res == -1) +- condlog(LOG_WARNING, "Could not set SCHED_RR at priority 99"); ++ condlog(2, "Could not set SCHED_RR at priority 99"); + return; + } + diff --git a/0003-multipathd-make-multipathd-scheduling-configurable.patch b/0003-multipathd-make-multipathd-scheduling-configurable.patch new file mode 100644 index 0000000..8529152 --- /dev/null +++ b/0003-multipathd-make-multipathd-scheduling-configurable.patch @@ -0,0 +1,87 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Fri, 1 Mar 2024 19:37:30 -0500 +Subject: [PATCH] multipathd: make multipathd scheduling configurable + +Currently multipathd always tries to run as a realtime process with a +priority of 99. This is excessive. As a first step towards fixing this, +make it possible at compile time to lower the priority or keep +multipathd from making itself a realtime process. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + Makefile.inc | 6 ++++++ + README.md | 3 +++ + multipathd/Makefile | 3 +++ + multipathd/main.c | 5 +++-- + 4 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/Makefile.inc b/Makefile.inc +index 5668e638..6d206281 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -18,6 +18,12 @@ READLINE := + # SCSI_DH_MODULES_PRELOAD := scsi_dh_alua scsi_dh_rdac + SCSI_DH_MODULES_PRELOAD := + ++# Multipathd scheduling priority. Set value from 1 to 99 to make multipathd ++# change its scheduling policy to SCHED_RR and its priority to the specified ++# value. set to 0 to stop multipathd from changing the scheduling policy and ++# priority it was started with. ++SCHED_RT_PRIO := 99 ++ + EXTRAVERSION := $(shell rev=$$(git rev-parse --short=7 HEAD 2>/dev/null); echo $${rev:+-g$$rev}) + + # PKG_CONFIG must be read from the environment to enable compilation +diff --git a/README.md b/README.md +index d4f35f57..bb41bf0e 100644 +--- a/README.md ++++ b/README.md +@@ -98,6 +98,9 @@ The following variables can be passed to the `make` command line: + By default, command line editing is disabled. + Note that using libreadline may + [make binary indistributable due to license incompatibility](https://github.com/opensvc/multipath-tools/issues/36). ++ * `SCHED_RT_PRIO={0-99}`: for values {1-99} set the realtime priority ++ multipathd will attempt to run with. for value 0, disable multipathd ++ changing itself to a realtime process. + * `ENABLE_LIBDMMP=0`: disable building libdmmp + * `ENABLE_DMEVENTS_POLL=0`: disable support for the device-mapper event + polling API. For use with pre-5.0 kernels that don't support dmevent polling +diff --git a/multipathd/Makefile b/multipathd/Makefile +index 997b40cf..7300f07a 100644 +--- a/multipathd/Makefile ++++ b/multipathd/Makefile +@@ -57,6 +57,9 @@ $(CLI): $(CLI_OBJS) + cli_handlers.o: cli_handlers.c + $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused-parameter -c -o $@ $< + ++main.o: main.c ++ $(Q)$(CC) $(CPPFLAGS) -DSCHED_RT_PRIO=$(SCHED_RT_PRIO) $(CFLAGS) -c -o $@ $< ++ + install: + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) + $(Q)$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir) +diff --git a/multipathd/main.c b/multipathd/main.c +index 85ac540f..9486a8a3 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -3172,7 +3172,7 @@ setscheduler (void) + { + int res; + static struct sched_param sched_param = { +- .sched_priority = 99 ++ .sched_priority = SCHED_RT_PRIO + }; + + res = sched_setscheduler (0, SCHED_RR, &sched_param); +@@ -3471,7 +3471,8 @@ child (__attribute__((unused)) void *param) + if (!vecs) + goto failed; + +- setscheduler(); ++ if (SCHED_RT_PRIO) ++ setscheduler(); + set_oom_adj(); + #ifdef FPIN_EVENT_HANDLER + if (conf->marginal_pathgroups == MARGINAL_PATHGROUP_FPIN) diff --git a/0004-libmpathutil-really-always-use-glibc-basename.patch b/0004-libmpathutil-really-always-use-glibc-basename.patch new file mode 100644 index 0000000..78f8859 --- /dev/null +++ b/0004-libmpathutil-really-always-use-glibc-basename.patch @@ -0,0 +1,144 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 3 Apr 2024 18:55:54 +0200 +Subject: [PATCH] libmpathutil: really always use glibc basename() + +Despite 03a5456 ("libmultipath: always use glibc basename()"), we +still call the system library's basename() from libmultipath. +musl libc until 1.24 provided a prototype for basename() in string.h, +which was not correct and was resolved to the destructive POSIX +basename(). musl libc 1.25 removed this prototype. + +While the remaining code path doesn't strictly depend on the non-destructive +behavior of glibc's basename(), it's cleaner and safer to use the same +implementation everywhere. + +Fixes: 03a5456 ("libmultipath: always use glibc basename()") +Fixes: https://github.com/opensvc/multipath-tools/pull/84 + +Signed-off-by: Martin Wilck +Reviewed-by: Khem Raj +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmpathutil/libmpathutil.version | 4 ++++ + libmpathutil/util.c | 5 +---- + libmpathutil/util.h | 5 +++++ + tests/util.c | 31 +++++++++++++++++++++++++++++++ + 4 files changed, 41 insertions(+), 4 deletions(-) + +diff --git a/libmpathutil/libmpathutil.version b/libmpathutil/libmpathutil.version +index 80d64a3e..fee74a32 100644 +--- a/libmpathutil/libmpathutil.version ++++ b/libmpathutil/libmpathutil.version +@@ -129,3 +129,7 @@ LIBMPATHUTIL_2.0 { + vector_move_up; + vector_sort; + }; ++ ++LIBMPATHUTIL_2.1 { ++ libmp_basename; ++}; +diff --git a/libmpathutil/util.c b/libmpathutil/util.c +index 9d147fca..23d303f9 100644 +--- a/libmpathutil/util.c ++++ b/libmpathutil/util.c +@@ -32,18 +32,15 @@ strchop(char *str) + return i; + } + +-#ifndef __GLIBC__ + /* + * glibc's non-destructive version of basename() + * License: LGPL-2.1-or-later + */ +-static const char *__basename(const char *filename) ++const char *libmp_basename(const char *filename) + { + char *p = strrchr(filename, '/'); + return p ? p + 1 : filename; + } +-#define basename(x) __basename(x) +-#endif + + int + basenamecpy (const char *src, char *dst, size_t size) +diff --git a/libmpathutil/util.h b/libmpathutil/util.h +index de9fcfdd..4997fed6 100644 +--- a/libmpathutil/util.h ++++ b/libmpathutil/util.h +@@ -12,6 +12,11 @@ + #include + + size_t strchop(char *); ++ ++const char *libmp_basename(const char *filename); ++#ifndef __GLIBC__ ++#define basename(x) libmp_basename(x) ++#endif + int basenamecpy (const char *src, char *dst, size_t size); + int filepresent (const char *run); + char *get_next_string(char **temp, const char *split_char); +diff --git a/tests/util.c b/tests/util.c +index d6083dce..4850ddcb 100644 +--- a/tests/util.c ++++ b/tests/util.c +@@ -16,6 +16,7 @@ + * + */ + ++#define _GNU_SOURCE + #include + #include + #include +@@ -23,6 +24,7 @@ + #include + #include + #include ++#include + #include "util.h" + + #include "globals.c" +@@ -163,6 +165,34 @@ static int test_basenamecpy(void) + return cmocka_run_group_tests(tests, NULL, NULL); + } + ++static void test_basename_01(void **state) ++{ ++ const char *path = "/foo/bar"; ++ const char *base; ++ ++ base = basename(path); ++ assert_string_equal(base, "bar"); ++ assert_string_equal(path, "/foo/bar"); ++} ++ ++static void test_basename_02(void **state) ++{ ++ const char *path = "/foo/bar/"; ++ const char *base; ++ ++ base = basename(path); ++ assert_string_equal(base, ""); ++ assert_string_equal(path, "/foo/bar/"); ++} ++ ++static int test_basename(void) { ++ const struct CMUnitTest tests[] = { ++ cmocka_unit_test(test_basename_01), ++ cmocka_unit_test(test_basename_02), ++ }; ++ return cmocka_run_group_tests(tests, NULL, NULL); ++} ++ + /* + * On big endian systems, if bitfield_t is 32bit, we need + * to swap the two 32 bit parts of a 64bit value to make +@@ -946,6 +976,7 @@ int main(void) + + init_test_verbosity(-1); + ret += test_basenamecpy(); ++ ret += test_basename(); + ret += test_bitmasks(); + ret += test_strlcpy(); + ret += test_strlcat(); diff --git a/0005-multipathd-make-multipathd-set-priority-to-RLIMIT_RT.patch b/0005-multipathd-make-multipathd-set-priority-to-RLIMIT_RT.patch new file mode 100644 index 0000000..fd12767 --- /dev/null +++ b/0005-multipathd-make-multipathd-set-priority-to-RLIMIT_RT.patch @@ -0,0 +1,134 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Tue, 9 Apr 2024 18:56:12 -0400 +Subject: [PATCH] multipathd: make multipathd set priority to RLIMIT_RTPRIO + +With this change, if the SCHED_RT_PRIO compiler flag has been removed. +Instead multipathd will call getrlimit(RLIMIT_RTPRIO, ...) and look at +the hard limit. It it's 0, multipath will do nothing. Otherwise it will +change its scheduling policy to SCHED_RR and its priority to the hard +limit. + +This allows users to change the priority of that multipathd runs with by +adding + +LimitRTPRIO= + +to the [Service] section of the multipathd.service unit file. Setting +LimitRTPRIO=0 will make multipathd run as a normal process, while +setting LimitRTPRIO=infinity will make it use the maximum SCHED_RR prio, +which is 99. + +To keep the existing behavior, multipathd.service now sets +LimitRTPRIO=infinity + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + Makefile.inc | 6 ------ + README.md | 3 --- + multipathd/Makefile | 3 --- + multipathd/main.c | 22 +++++++++++++++------- + multipathd/multipathd.service.in | 1 + + 5 files changed, 16 insertions(+), 19 deletions(-) + +diff --git a/Makefile.inc b/Makefile.inc +index 6d206281..5668e638 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -18,12 +18,6 @@ READLINE := + # SCSI_DH_MODULES_PRELOAD := scsi_dh_alua scsi_dh_rdac + SCSI_DH_MODULES_PRELOAD := + +-# Multipathd scheduling priority. Set value from 1 to 99 to make multipathd +-# change its scheduling policy to SCHED_RR and its priority to the specified +-# value. set to 0 to stop multipathd from changing the scheduling policy and +-# priority it was started with. +-SCHED_RT_PRIO := 99 +- + EXTRAVERSION := $(shell rev=$$(git rev-parse --short=7 HEAD 2>/dev/null); echo $${rev:+-g$$rev}) + + # PKG_CONFIG must be read from the environment to enable compilation +diff --git a/README.md b/README.md +index bb41bf0e..d4f35f57 100644 +--- a/README.md ++++ b/README.md +@@ -98,9 +98,6 @@ The following variables can be passed to the `make` command line: + By default, command line editing is disabled. + Note that using libreadline may + [make binary indistributable due to license incompatibility](https://github.com/opensvc/multipath-tools/issues/36). +- * `SCHED_RT_PRIO={0-99}`: for values {1-99} set the realtime priority +- multipathd will attempt to run with. for value 0, disable multipathd +- changing itself to a realtime process. + * `ENABLE_LIBDMMP=0`: disable building libdmmp + * `ENABLE_DMEVENTS_POLL=0`: disable support for the device-mapper event + polling API. For use with pre-5.0 kernels that don't support dmevent polling +diff --git a/multipathd/Makefile b/multipathd/Makefile +index 7300f07a..997b40cf 100644 +--- a/multipathd/Makefile ++++ b/multipathd/Makefile +@@ -57,9 +57,6 @@ $(CLI): $(CLI_OBJS) + cli_handlers.o: cli_handlers.c + $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused-parameter -c -o $@ $< + +-main.o: main.c +- $(Q)$(CC) $(CPPFLAGS) -DSCHED_RT_PRIO=$(SCHED_RT_PRIO) $(CFLAGS) -c -o $@ $< +- + install: + $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) + $(Q)$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir) +diff --git a/multipathd/main.c b/multipathd/main.c +index 9486a8a3..dd17d5c3 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -3171,14 +3171,23 @@ static void + setscheduler (void) + { + int res; +- static struct sched_param sched_param = { +- .sched_priority = SCHED_RT_PRIO +- }; ++ static struct sched_param sched_param; ++ struct rlimit rlim; ++ ++ if (getrlimit(RLIMIT_RTPRIO, &rlim) < 0 || rlim.rlim_max == 0) ++ return; ++ ++ sched_param.sched_priority = rlim.rlim_max > INT_MAX ? INT_MAX : ++ rlim.rlim_max; ++ res = sched_get_priority_max(SCHED_RR); ++ if (res > 0 && res < sched_param.sched_priority) ++ sched_param.sched_priority = res; + +- res = sched_setscheduler (0, SCHED_RR, &sched_param); ++ res = sched_setscheduler(0, SCHED_RR, &sched_param); + + if (res == -1) +- condlog(2, "Could not set SCHED_RR at priority 99"); ++ condlog(2, "Could not set SCHED_RR at priority %d", ++ sched_param.sched_priority); + return; + } + +@@ -3471,8 +3480,7 @@ child (__attribute__((unused)) void *param) + if (!vecs) + goto failed; + +- if (SCHED_RT_PRIO) +- setscheduler(); ++ setscheduler(); + set_oom_adj(); + #ifdef FPIN_EVENT_HANDLER + if (conf->marginal_pathgroups == MARGINAL_PATHGROUP_FPIN) +diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in +index 6d03ff71..18bb367e 100644 +--- a/multipathd/multipathd.service.in ++++ b/multipathd/multipathd.service.in +@@ -19,6 +19,7 @@ NotifyAccess=main + ExecStart=/sbin/multipathd -d -s + ExecReload=/sbin/multipathd reconfigure + TasksMax=infinity ++LimitRTPRIO=infinity + + [Install] + WantedBy=sysinit.target diff --git a/0006-multipathd-Set-CPUWeight-to-1000-and-LimitRTPRIO-to-.patch b/0006-multipathd-Set-CPUWeight-to-1000-and-LimitRTPRIO-to-.patch new file mode 100644 index 0000000..0cbe997 --- /dev/null +++ b/0006-multipathd-Set-CPUWeight-to-1000-and-LimitRTPRIO-to-.patch @@ -0,0 +1,33 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Mon, 15 Apr 2024 19:43:06 -0400 +Subject: [PATCH] multipathd: Set CPUWeight to 1000 and LimitRTPRIO to 10 + +If multipathd doesn't become a real time process, it was scheduled as a +normal process, without any priority increase. Bump up the CPUWeight so +that even as a normal process, it will still run with increased +priority. + +If multipathd did become a real time process, it set itself to the +highest priority, which is excessive. A priority of 10 is plenty. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + multipathd/multipathd.service.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in +index 18bb367e..a63ddd9a 100644 +--- a/multipathd/multipathd.service.in ++++ b/multipathd/multipathd.service.in +@@ -19,7 +19,8 @@ NotifyAccess=main + ExecStart=/sbin/multipathd -d -s + ExecReload=/sbin/multipathd reconfigure + TasksMax=infinity +-LimitRTPRIO=infinity ++LimitRTPRIO=10 ++CPUWeight=1000 + + [Install] + WantedBy=sysinit.target diff --git a/0007-11-dm-mpath.rules-explain-logic-for-device-becoming-.patch b/0007-11-dm-mpath.rules-explain-logic-for-device-becoming-.patch new file mode 100644 index 0000000..6241459 --- /dev/null +++ b/0007-11-dm-mpath.rules-explain-logic-for-device-becoming-.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 1 Mar 2024 19:53:14 +0100 +Subject: [PATCH] 11-dm-mpath.rules: explain logic for device becoming ready + while suspended + +Add a comment to explain why we must set MPATH_DEVICE_READY=0 when +we see a device becoming ready (number of active paths 0 -> 1) while +the device is suspended. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index d9585abf..b8d19d01 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -98,6 +98,8 @@ ENV{MPATH_DEVICE_READY}=="0", \ + # If the device comes back online, set DM_ACTIVATION so that + # upper layers do a rescan. If the device is currently suspended, + # we have to postpone the activation until the next event. ++# In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the ++# MPATH_UNCHANGED logic will cause later rules to skipped in the next event. + ENV{MPATH_DEVICE_READY}=="0", GOTO="dont_activate" + ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="dont_activate" + ENV{DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="dont_activate" diff --git a/0008-11-dm-mpath.rules-don-t-import-DM_NOSCAN-from-udev-d.patch b/0008-11-dm-mpath.rules-don-t-import-DM_NOSCAN-from-udev-d.patch new file mode 100644 index 0000000..3900b39 --- /dev/null +++ b/0008-11-dm-mpath.rules-don-t-import-DM_NOSCAN-from-udev-d.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 1 Mar 2024 19:57:59 +0100 +Subject: [PATCH] 11-dm-mpath.rules: don't import DM_NOSCAN from udev db + +DM_NOSCAN is our "output" flag for 13-dm-disk.rules, and it should +be treated the same way as DM_UDEV_DISABLE_OTHER_RULES_FLAG, which +isn't imported from the udev database. The state that we need to +remember is MPATH_DEVICE_READY, which we've already imported above, +and we will set the "output" flags accordingly in the "force_activation" +code path further down. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index b8d19d01..eb12b0c6 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -18,9 +18,11 @@ ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1 + + # If this uevent didn't come from dm, don't try to update the + # device state ++# Note that .MPATH_DEVICE_READY_OLD=="" here. Thus we won't activate the ++# device below at force_activation, which is correct. + ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \ +- IMPORT{db}="DM_NOSCAN", IMPORT{db}="DM_COLDPLUG_SUSPENDED", \ +- GOTO="scan_import" ++ IMPORT{db}="DM_COLDPLUG_SUSPENDED", \ ++ GOTO="force_activation" + + ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" + diff --git a/0009-11-dm-mpath.rules-don-t-import-ID_FS_VERSION-from-ud.patch b/0009-11-dm-mpath.rules-don-t-import-ID_FS_VERSION-from-ud.patch new file mode 100644 index 0000000..933a43a --- /dev/null +++ b/0009-11-dm-mpath.rules-don-t-import-ID_FS_VERSION-from-ud.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 1 Mar 2024 21:02:49 +0100 +Subject: [PATCH] 11-dm-mpath.rules: don't import ID_FS_VERSION from udev db + +Use the same set of properties to import as 13-dm-disk.rules. +ID_FS_VERSION isn't used in any udev rule I am aware of. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index eb12b0c6..4386b6ca 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -126,7 +126,6 @@ IMPORT{db}="ID_FS_TYPE" + IMPORT{db}="ID_FS_USAGE" + IMPORT{db}="ID_FS_UUID_ENC" + IMPORT{db}="ID_FS_LABEL_ENC" +-IMPORT{db}="ID_FS_VERSION" + IMPORT{db}="ID_PART_ENTRY_NAME" + IMPORT{db}="ID_PART_ENTRY_UUID" + IMPORT{db}="ID_PART_ENTRY_SCHEME" diff --git a/0010-11-dm-mpath.rules-adapt-MPATH_DEVICE_READY-0-logic-t.patch b/0010-11-dm-mpath.rules-adapt-MPATH_DEVICE_READY-0-logic-t.patch new file mode 100644 index 0000000..97b3901 --- /dev/null +++ b/0010-11-dm-mpath.rules-adapt-MPATH_DEVICE_READY-0-logic-t.patch @@ -0,0 +1,67 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 1 Mar 2024 20:53:50 +0100 +Subject: [PATCH] 11-dm-mpath.rules: adapt MPATH_DEVICE_READY=0 logic to + 10-dm.rules update + +With the late patches for 10-dm.rules, DM_UDEV_DISABLE_OTHER_RULES_FLAG isn't +restored from the udev database any more, so we don't need to restore +the flag to its original state before it is saved to the db. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index 4386b6ca..2f909c3a 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -19,7 +19,7 @@ ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1 + # If this uevent didn't come from dm, don't try to update the + # device state + # Note that .MPATH_DEVICE_READY_OLD=="" here. Thus we won't activate the +-# device below at force_activation, which is correct. ++# device below at mpath_is_ready, which is correct. + ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \ + IMPORT{db}="DM_COLDPLUG_SUSPENDED", \ + GOTO="force_activation" +@@ -84,25 +84,27 @@ ENV{DM_ACTION}=="PATH_FAILED|PATH_REINSTATED", \ + + LABEL="force_activation" + ++ENV{MPATH_DEVICE_READY}!="0", GOTO="mpath_is_ready" + # Do not initiate scanning if no path is available, + # otherwise there would be a hang or IO error on access. + # We'd like to avoid this, especially within udev processing. +-ENV{MPATH_DEVICE_READY}=="0", ENV{DM_NOSCAN}="1" +- +-# Skip all foreign rules if no path is available. ++# This is communicated to later rules in DM_NOSCAN. ++# Likewise, skip all foreign rules if no path is available. + # Use DM_UDEV_DISABLE_OTHER_RULES_FLAG to communicate this +-# to upper layers. The original value will be restored in a late +-# udev rule. +-ENV{MPATH_DEVICE_READY}=="0", \ +- ENV{.MPATH_SAVE_DISABLE_OTHER_RULES_FLAG}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}", \ +- ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" ++# to upper layers. With dm rules < v3, save the original value here; ++# it will be restored in a late udev rule. ++ENV{DM_UDEV_RULES_VSN}=="1|2", \ ++ ENV{.MPATH_SAVE_DISABLE_OTHER_RULES_FLAG}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}" ++ENV{DM_NOSCAN}="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" ++GOTO="dont_activate" ++ ++LABEL="mpath_is_ready" + + # If the device comes back online, set DM_ACTIVATION so that + # upper layers do a rescan. If the device is currently suspended, + # we have to postpone the activation until the next event. + # In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the + # MPATH_UNCHANGED logic will cause later rules to skipped in the next event. +-ENV{MPATH_DEVICE_READY}=="0", GOTO="dont_activate" + ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="dont_activate" + ENV{DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="dont_activate" + diff --git a/0011-11-dm-mpath.rules-adapt-coldplug-event-handling-ro-1.patch b/0011-11-dm-mpath.rules-adapt-coldplug-event-handling-ro-1.patch new file mode 100644 index 0000000..938a07f --- /dev/null +++ b/0011-11-dm-mpath.rules-adapt-coldplug-event-handling-ro-1.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 1 Mar 2024 20:55:40 +0100 +Subject: [PATCH] 11-dm-mpath.rules: adapt coldplug event handling ro + 10-dm.rules update + +With late late patches for 10-dm.rules, DM_UDEV_DISABLE_OTHER_RULES_FLAG is +never restored from the udev db. Thus we don't need to clear it here +any more for coldplug events. Also, we must use .DM_SUSPENDED instead of +DM_SUSPENDED as input flag with the v3 rule set (other occurences of +DM_SUSPENDED will be replaced in a follow-up patch). + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index 2f909c3a..5f547cab 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -9,12 +9,17 @@ ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}=="1", \ + PROGRAM="/bin/logger -t 11-dm-mpath.rules -p daemon.warning \"Coldplug event for suspended device\"", \ + ENV{DM_COLDPLUG_SUSPENDED}="1", GOTO="scan_import" + +-# Coldplug event. DM_UDEV_DISABLE_OTHER_RULES_FLAG has been restored ++# Coldplug event. Import previously set properties. ++ACTION!="add", GOTO="mpath_coldplug_end" ++ENV{DM_ACTIVATION}!="1", GOTO="mpath_coldplug_end" ++ENV{DM_UDEV_RULES_VSN}!="1|2", ENV{.DM_SUSPENDED}!="1", GOTO="scan_import" ++# With DM rules < v3, DM_UDEV_DISABLE_OTHER_RULES_FLAG has been restored + # from DB in 10-dm.rules. If the device is not suspended, clear the flag. + # This is safe for multipath where DM_UDEV_DISABLE_OTHER_RULES_FLAG is basically + # equivalent to DM_SUSPENDED==1 || DISK_RO==1 +-ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1", \ ++ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1", \ + ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="", GOTO="scan_import" ++LABEL="mpath_coldplug_end" + + # If this uevent didn't come from dm, don't try to update the + # device state diff --git a/0012-11-dm-mpath.rules-don-t-import-properties-with-new-1.patch b/0012-11-dm-mpath.rules-don-t-import-properties-with-new-1.patch new file mode 100644 index 0000000..f4e69cf --- /dev/null +++ b/0012-11-dm-mpath.rules-don-t-import-properties-with-new-1.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 1 Mar 2024 20:58:47 +0100 +Subject: [PATCH] 11-dm-mpath.rules: don't import properties with new + 13-dm-disk.rules + +With the late changes to 13-dm-disk.rules, we don't need to import any +blkid-generated properties from the udev database, because they will +be imported later. + +Except for ID_FS_TYPE, this actually holds since lvm2 commit 94f77a4 ("udev: +import previous results of blkid when in suspended state"), included in lvm2 +2.03.19, but we have no simple way to detect the version of the lvm2 rules. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index 5f547cab..95126bf2 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -126,6 +126,10 @@ LABEL="scan_import" + # have never been properly set. Don't import them. + ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="import_end" + ++# DM rules v3 will import missing properties on 13-dm-disk.rules. ++# No need to do it here. ++ENV{DM_UDEV_RULES_VSN}!="1|2", GOTO="import_end" ++ + # Don't import the properties from db if we will run blkid later. + ENV{DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" + diff --git a/0013-11-dm-mpath.rules-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch b/0013-11-dm-mpath.rules-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch new file mode 100644 index 0000000..e922427 --- /dev/null +++ b/0013-11-dm-mpath.rules-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch @@ -0,0 +1,75 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 1 Mar 2024 22:33:59 +0100 +Subject: [PATCH] 11-dm-mpath.rules: replace DM_SUSPENDED by .DM_SUSPENDED + +With the late changes to the device mapper rules, DM_SUSPENDED +is not exported any more. Use .DM_SUSPENDED instead. + +Note that although 11-dm-mpath.rules is not a part of lvm2, it +can be considered as part of the device-mapper layer (everything +before 13-dm-disk.rules can), and is thus allowed to use +.DM_SUSPENDED. In practice .DM_SUSPENDED is equivalent to +DM_UDEV_DISABLE_OTHER_RULES_FLAG for multipath devices, but +using .DM_SUSPENDED here makes the intention more obvious. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index 95126bf2..efc6416f 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -4,8 +4,11 @@ ENV{DM_UUID}!="mpath-?*", GOTO="mpath_end" + + IMPORT{db}="MPATH_DEVICE_READY" + ++# device-mapper rules v2 compatibility ++ENV{.DM_SUSPENDED}!="?*", ENV{.DM_SUSPENDED}="$env{DM_SUSPENDED}" ++ + # Coldplug event while device is suspended (e.g. during a reload) +-ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}=="1", \ ++ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{.DM_SUSPENDED}=="1", \ + PROGRAM="/bin/logger -t 11-dm-mpath.rules -p daemon.warning \"Coldplug event for suspended device\"", \ + ENV{DM_COLDPLUG_SUSPENDED}="1", GOTO="scan_import" + +@@ -17,7 +20,7 @@ ENV{DM_UDEV_RULES_VSN}!="1|2", ENV{.DM_SUSPENDED}!="1", GOTO="scan_import" + # from DB in 10-dm.rules. If the device is not suspended, clear the flag. + # This is safe for multipath where DM_UDEV_DISABLE_OTHER_RULES_FLAG is basically + # equivalent to DM_SUSPENDED==1 || DISK_RO==1 +-ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1", \ ++ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{.DM_SUSPENDED}!="1", ENV{DISK_RO}!="1", \ + ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="", GOTO="scan_import" + LABEL="mpath_coldplug_end" + +@@ -68,7 +71,7 @@ LABEL="mpath_action" + # Activation might have been partially skipped. Activate the device now, + # i.e. disable the MPATH_UNCHANGED logic and set DM_ACTIVATION=1. + IMPORT{db}="DM_COLDPLUG_SUSPENDED" +-ENV{DM_COLDPLUG_SUSPENDED}=="1", ENV{DM_SUSPENDED}!="1", \ ++ENV{DM_COLDPLUG_SUSPENDED}=="1", ENV{.DM_SUSPENDED}!="1", \ + ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0", \ + PROGRAM="/bin/logger -t 11-dm-mpath.rules -p daemon.notice \"Forcing activation of previously suspended device\"", \ + GOTO="force_activation" +@@ -111,7 +114,7 @@ LABEL="mpath_is_ready" + # In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the + # MPATH_UNCHANGED logic will cause later rules to skipped in the next event. + ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="dont_activate" +-ENV{DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="dont_activate" ++ENV{.DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="dont_activate" + + ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" + LABEL="dont_activate" +@@ -145,7 +148,7 @@ IMPORT{db}="ID_PART_GPT_AUTO_ROOT" + LABEL="import_end" + + # Reset previous DM_COLDPLUG_SUSPENDED if activation happens now +-ENV{DM_SUSPENDED}!="1", ENV{DM_ACTIVATION}=="1", ENV{DM_COLDPLUG_SUSPENDED}="" ++ENV{.DM_SUSPENDED}!="1", ENV{DM_ACTIVATION}=="1", ENV{DM_COLDPLUG_SUSPENDED}="" + + # Multipath maps should take precedence over their members. + ENV{DM_UDEV_LOW_PRIORITY_FLAG}!="1", OPTIONS+="link_priority=50" diff --git a/0014-11-dm-mpath.rules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch b/0014-11-dm-mpath.rules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch new file mode 100644 index 0000000..a5eecaf --- /dev/null +++ b/0014-11-dm-mpath.rules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch @@ -0,0 +1,55 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 1 Mar 2024 23:23:53 +0100 +Subject: [PATCH] 11-dm-mpath.rules: replace DM_NOSCAN by .DM_NOSCAN + +We don't need to restore DM_NOSCAN from the db anymore, so we can rename +it to .DM_NOSCAN, making it a temporary property. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index efc6416f..3ae3c054 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -96,14 +96,14 @@ ENV{MPATH_DEVICE_READY}!="0", GOTO="mpath_is_ready" + # Do not initiate scanning if no path is available, + # otherwise there would be a hang or IO error on access. + # We'd like to avoid this, especially within udev processing. +-# This is communicated to later rules in DM_NOSCAN. ++# This is communicated to later rules in .DM_NOSCAN. + # Likewise, skip all foreign rules if no path is available. + # Use DM_UDEV_DISABLE_OTHER_RULES_FLAG to communicate this + # to upper layers. With dm rules < v3, save the original value here; + # it will be restored in a late udev rule. + ENV{DM_UDEV_RULES_VSN}=="1|2", \ + ENV{.MPATH_SAVE_DISABLE_OTHER_RULES_FLAG}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}" +-ENV{DM_NOSCAN}="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" ++ENV{.DM_NOSCAN}="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" + GOTO="dont_activate" + + LABEL="mpath_is_ready" +@@ -134,7 +134,7 @@ ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="import_end" + ENV{DM_UDEV_RULES_VSN}!="1|2", GOTO="import_end" + + # Don't import the properties from db if we will run blkid later. +-ENV{DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" ++ENV{.DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" + + IMPORT{db}="ID_FS_TYPE" + IMPORT{db}="ID_FS_USAGE" +@@ -150,6 +150,9 @@ LABEL="import_end" + # Reset previous DM_COLDPLUG_SUSPENDED if activation happens now + ENV{.DM_SUSPENDED}!="1", ENV{DM_ACTIVATION}=="1", ENV{DM_COLDPLUG_SUSPENDED}="" + ++# device-mapper rules v2 compatibility for 13-dm-disk.rules ++ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{DM_NOSCAN}="$env{.DM_NOSCAN}" ++ + # Multipath maps should take precedence over their members. + ENV{DM_UDEV_LOW_PRIORITY_FLAG}!="1", OPTIONS+="link_priority=50" + diff --git a/0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch b/0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch deleted file mode 100644 index 7655591..0000000 --- a/0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -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 ---- - 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; diff --git a/0015-11-dm-mpath.rules-simplify-PATH_FAILED-case.patch b/0015-11-dm-mpath.rules-simplify-PATH_FAILED-case.patch new file mode 100644 index 0000000..ce393ae --- /dev/null +++ b/0015-11-dm-mpath.rules-simplify-PATH_FAILED-case.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 6 Mar 2024 21:17:51 +0100 +Subject: [PATCH] 11-dm-mpath.rules: simplify PATH_FAILED case + +This combination of a GOTO and a simple rule can be combined +into a single rule. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index 3ae3c054..4777fbec 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -56,14 +56,10 @@ PROGRAM=="@BINDIR@/multipath -U -v1 %k", GOTO="paths_ok" + ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action" + LABEL="paths_ok" + +-# Don't mark a device ready on a PATH_FAILED event. even if +-# DM_NR_VALID_PATHS is greater than 0. Just keep the existing +-# value +-ENV{DM_ACTION}=="PATH_FAILED", GOTO="mpath_action" +- +-# This event is either a PATH_REINSTATED or a table reload where +-# there are active paths. Mark the device ready +-ENV{MPATH_DEVICE_READY}="1" ++# For PATH_FAILED events, keep the existing value of MPATH_DEVICE_READY. ++# If it's not PATH_FAILED, this event is either a PATH_REINSTATED or a ++# table reload where there are active paths. Mark the device ready. ++ENV{DM_ACTION}!="PATH_FAILED", ENV{MPATH_DEVICE_READY}="1" + + LABEL="mpath_action" + diff --git a/0015-multipathd-fix-auto-resize-configuration.patch b/0015-multipathd-fix-auto-resize-configuration.patch deleted file mode 100644 index 35e4d48..0000000 --- a/0015-multipathd-fix-auto-resize-configuration.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -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 ---- - 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, diff --git a/0016-11-dm-mpath.rules-make-label-names-more-intuitive.patch b/0016-11-dm-mpath.rules-make-label-names-more-intuitive.patch new file mode 100644 index 0000000..e81f04f --- /dev/null +++ b/0016-11-dm-mpath.rules-make-label-names-more-intuitive.patch @@ -0,0 +1,109 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 1 Mar 2024 21:54:26 +0100 +Subject: [PATCH] 11-dm-mpath.rules: make label names more intuitive + +The labels "dont_activate" and "scan_import" denote the same code line. +Remove "dont_activate". Improve two misleading label names. + +Substitutions: + dont_activate -> scan_import + force_activation -> check_mpath_ready + mpath_action -> check_mpath_unchanged + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index 4777fbec..0562eddf 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -30,7 +30,7 @@ LABEL="mpath_coldplug_end" + # device below at mpath_is_ready, which is correct. + ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \ + IMPORT{db}="DM_COLDPLUG_SUSPENDED", \ +- GOTO="force_activation" ++ GOTO="check_mpath_ready" + + ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" + +@@ -38,13 +38,13 @@ ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" + # table with no active devices. If this happens, mark the + # device not ready + ENV{DM_SUBSYSTEM_UDEV_FLAG2}=="1", ENV{MPATH_DEVICE_READY}="0", \ +- GOTO="mpath_action" ++ GOTO="check_mpath_unchanged" + + # If the last path has failed mark the device not ready + # Note that DM_NR_VALID_PATHS is only set for PATH_FAILED|PATH_REINSTATED + # events. + # This may not be reliable, as events aren't necessarily received in order. +-ENV{DM_NR_VALID_PATHS}=="0", ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action" ++ENV{DM_NR_VALID_PATHS}=="0", ENV{MPATH_DEVICE_READY}="0", GOTO="check_mpath_unchanged" + + # Don't run multipath -U during "coldplug" after switching root, + # because paths are just being added to the udev db. +@@ -53,7 +53,8 @@ ACTION=="add", ENV{.MPATH_DEVICE_READY_OLD}=="1", GOTO="paths_ok" + # Check the map state directly with multipath -U. + # This doesn't attempt I/O on the device. + PROGRAM=="@BINDIR@/multipath -U -v1 %k", GOTO="paths_ok" +-ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action" ++ENV{MPATH_DEVICE_READY}="0", GOTO="check_mpath_unchanged" ++ + LABEL="paths_ok" + + # For PATH_FAILED events, keep the existing value of MPATH_DEVICE_READY. +@@ -61,7 +62,7 @@ LABEL="paths_ok" + # table reload where there are active paths. Mark the device ready. + ENV{DM_ACTION}!="PATH_FAILED", ENV{MPATH_DEVICE_READY}="1" + +-LABEL="mpath_action" ++LABEL="check_mpath_unchanged" + + # A previous coldplug event occurred while the device was suspended. + # Activation might have been partially skipped. Activate the device now, +@@ -70,7 +71,7 @@ IMPORT{db}="DM_COLDPLUG_SUSPENDED" + ENV{DM_COLDPLUG_SUSPENDED}=="1", ENV{.DM_SUSPENDED}!="1", \ + ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0", \ + PROGRAM="/bin/logger -t 11-dm-mpath.rules -p daemon.notice \"Forcing activation of previously suspended device\"", \ +- GOTO="force_activation" ++ GOTO="check_mpath_ready" + + # DM_SUBSYSTEM_UDEV_FLAG0 is the "RELOAD" flag for multipath subsystem. + # Drop the DM_ACTIVATION flag here as mpath reloads tables if any of its +@@ -86,7 +87,7 @@ ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", \ + ENV{DM_ACTION}=="PATH_FAILED|PATH_REINSTATED", \ + ENV{DM_ACTIVATION}="0", ENV{MPATH_UNCHANGED}="1" + +-LABEL="force_activation" ++LABEL="check_mpath_ready" + + ENV{MPATH_DEVICE_READY}!="0", GOTO="mpath_is_ready" + # Do not initiate scanning if no path is available, +@@ -100,7 +101,7 @@ ENV{MPATH_DEVICE_READY}!="0", GOTO="mpath_is_ready" + ENV{DM_UDEV_RULES_VSN}=="1|2", \ + ENV{.MPATH_SAVE_DISABLE_OTHER_RULES_FLAG}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}" + ENV{.DM_NOSCAN}="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" +-GOTO="dont_activate" ++GOTO="scan_import" + + LABEL="mpath_is_ready" + +@@ -109,11 +110,10 @@ LABEL="mpath_is_ready" + # we have to postpone the activation until the next event. + # In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the + # MPATH_UNCHANGED logic will cause later rules to skipped in the next event. +-ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="dont_activate" +-ENV{.DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="dont_activate" ++ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="scan_import" ++ENV{.DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="scan_import" + + ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" +-LABEL="dont_activate" + + # The code to check multipath state ends here. We need to set + # properties and symlinks regardless whether the map is usable or diff --git a/0017-kpartx.rules-ignore-DM_SUSPENDED.patch b/0017-kpartx.rules-ignore-DM_SUSPENDED.patch new file mode 100644 index 0000000..3b0ac76 --- /dev/null +++ b/0017-kpartx.rules-ignore-DM_SUSPENDED.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 1 Mar 2024 21:17:26 +0100 +Subject: [PATCH] kpartx.rules: ignore DM_SUSPENDED + +DM_SUSPENDED=1 implies DM_UDEV_DISABLE_OTHER_RULES_FLAG=1, no +need to check it again. The DM_NOSCAN check needs to remain in +order to keep compatibility with dm rules v2. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + kpartx/kpartx.rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules +index 1969dee0..8dd3369c 100644 +--- a/kpartx/kpartx.rules ++++ b/kpartx/kpartx.rules +@@ -27,7 +27,7 @@ ENV{DM_SUBSYSTEM_UDEV_FLAG1}=="1", GOTO="mpath_kpartx_end" + ENV{MPATH_UNCHANGED}=="1", GOTO="mpath_kpartx_end" + + # Don't run kpartx now if we know it will fail or hang. +-ENV{DM_SUSPENDED}=="1", GOTO="mpath_kpartx_end" ++# This is required for device mapper rules v2 compatibility. + ENV{DM_NOSCAN}=="1", GOTO="mpath_kpartx_end" + + # Run kpartx diff --git a/0018-multipath-tools-tests-fix-CI-failures-on-arm-v7-with.patch b/0018-multipath-tools-tests-fix-CI-failures-on-arm-v7-with.patch new file mode 100644 index 0000000..2840cec --- /dev/null +++ b/0018-multipath-tools-tests-fix-CI-failures-on-arm-v7-with.patch @@ -0,0 +1,270 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 4 Apr 2024 23:23:28 +0200 +Subject: [PATCH] multipath-tools tests: fix CI failures on arm/v7 with glibc + 2.37 + +glibc 2.37 has added several new wrappers around the ioctl and +io_getevents system calls on 32 bit systems, to deal with 64bit +time_t. These aren't resolved with cmocka's wrapping technique. + +Fix this with C preprocessor trickery, similar to +7b217f8 ("multipath-tools: Makefile.inc: set _FILE_OFFSET_BITS=64"). + +Note: the directio test with DIO_TEST_DEV for fails under qemu-linux-user +with foreign-arch binfmt, because aio-related system calls are unsupported +by qemu-linux-user. See https://gitlab.com/qemu-project/qemu/-/issues/210. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + tests/directio.c | 28 ++++++++++++++-------------- + tests/vpd.c | 35 ++++++++++++++++++----------------- + tests/wrap64.h | 25 ++++++++++++++++++++++++- + 3 files changed, 56 insertions(+), 32 deletions(-) + +diff --git a/tests/directio.c b/tests/directio.c +index cbedcc9c..d5f84f10 100644 +--- a/tests/directio.c ++++ b/tests/directio.c +@@ -41,13 +41,13 @@ struct timespec full_timeout = { .tv_sec = -1 }; + #define ioctl_request_t int + #endif + +-int __real_ioctl(int fd, ioctl_request_t request, void *argp); ++int REAL_IOCTL(int fd, ioctl_request_t request, void *argp); + +-int __wrap_ioctl(int fd, ioctl_request_t request, void *argp) ++int WRAP_IOCTL(int fd, ioctl_request_t request, void *argp) + { + #ifdef DIO_TEST_DEV + mock_type(int); +- return __real_ioctl(fd, request, argp); ++ return REAL_IOCTL(fd, request, argp); + #else + int *blocksize = (int *)argp; + +@@ -148,10 +148,10 @@ int __wrap_io_cancel(io_context_t ctx, struct iocb *iocb, struct io_event *evt) + #endif + } + +-int __real_io_getevents(io_context_t ctx, long min_nr, long nr, ++int REAL_IO_GETEVENTS(io_context_t ctx, long min_nr, long nr, + struct io_event *events, struct timespec *timeout); + +-int __wrap_io_getevents(io_context_t ctx, long min_nr, long nr, ++int WRAP_IO_GETEVENTS(io_context_t ctx, long min_nr, long nr, + struct io_event *events, struct timespec *timeout) + { + int nr_evs; +@@ -169,8 +169,8 @@ int __wrap_io_getevents(io_context_t ctx, long min_nr, long nr, + #ifdef DIO_TEST_DEV + mock_ptr_type(struct timespec *); + mock_ptr_type(struct io_event *); +- assert_int_equal(nr_evs, __real_io_getevents(ctx, min_nr, nr_evs, +- events, timeout)); ++ assert_int_equal(nr_evs, REAL_IO_GETEVENTS(ctx, min_nr, nr_evs, ++ events, timeout)); + #else + sleep_tmo = mock_ptr_type(struct timespec *); + if (sleep_tmo) { +@@ -193,7 +193,7 @@ int __wrap_io_getevents(io_context_t ctx, long min_nr, long nr, + + static void return_io_getevents_none(void) + { +- will_return(__wrap_io_getevents, 0); ++ wrap_will_return(WRAP_IO_GETEVENTS, 0); + } + + static void return_io_getevents_nr(struct timespec *ts, int nr, +@@ -207,15 +207,15 @@ static void return_io_getevents_nr(struct timespec *ts, int nr, + mock_events[i + ev_off].res = reqs[i]->blksize; + } + while (nr > 0) { +- will_return(__wrap_io_getevents, (nr > 128)? 128 : nr); +- will_return(__wrap_io_getevents, ts); +- will_return(__wrap_io_getevents, &mock_events[off + ev_off]); ++ wrap_will_return(WRAP_IO_GETEVENTS, (nr > 128)? 128 : nr); ++ wrap_will_return(WRAP_IO_GETEVENTS, ts); ++ wrap_will_return(WRAP_IO_GETEVENTS, &mock_events[off + ev_off]); + ts = NULL; + off += 128; + nr -= 128; + } + if (nr == 0) +- will_return(__wrap_io_getevents, 0); ++ wrap_will_return(WRAP_IO_GETEVENTS, 0); + ev_off += i; + } + +@@ -251,7 +251,7 @@ static void do_libcheck_init(struct checker *c, int blocksize, + struct directio_context * ct; + + c->fd = test_fd; +- will_return(__wrap_ioctl, blocksize); ++ wrap_will_return(WRAP_IOCTL, blocksize); + assert_int_equal(libcheck_init(c), 0); + ct = (struct directio_context *)c->context; + assert_non_null(ct); +@@ -762,7 +762,7 @@ int main(void) + { + int ret = 0; + +- init_test_verbosity(2); ++ init_test_verbosity(5); + ret += test_directio(); + return ret; + } +diff --git a/tests/vpd.c b/tests/vpd.c +index 1b2d62d6..e3212e61 100644 +--- a/tests/vpd.c ++++ b/tests/vpd.c +@@ -20,6 +20,7 @@ + #include "vector.h" + #include "structs.h" + #include "discovery.h" ++#include "wrap64.h" + #include "globals.c" + + #define VPD_BUFSIZ 4096 +@@ -58,7 +59,7 @@ static const char vendor_id[] = "Linux"; + static const char test_id[] = + "A123456789AbcDefB123456789AbcDefC123456789AbcDefD123456789AbcDef"; + +-int __wrap_ioctl(int fd, unsigned long request, void *param) ++int WRAP_IOCTL(int fd, unsigned long request, void *param) + { + int len; + struct sg_io_hdr *io_hdr; +@@ -428,8 +429,8 @@ static void test_vpd_vnd_ ## len ## _ ## wlen(void **state) \ + /* Replace spaces, like code under test */ \ + exp_subst = subst_spaces(exp_wwid); \ + free(exp_wwid); \ +- will_return(__wrap_ioctl, n); \ +- will_return(__wrap_ioctl, vt->vpdbuf); \ ++ wrap_will_return(WRAP_IOCTL, n); \ ++ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ + ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen); \ + assert_correct_wwid("test_vpd_vnd_" #len "_" #wlen, \ + exp_len, ret, '1', 0, false, \ +@@ -458,8 +459,8 @@ static void test_vpd_str_ ## typ ## _ ## len ## _ ## wlen(void **state) \ + exp_len--; \ + if (exp_len >= wlen) \ + exp_len = wlen - 1; \ +- will_return(__wrap_ioctl, n); \ +- will_return(__wrap_ioctl, vt->vpdbuf); \ ++ wrap_will_return(WRAP_IOCTL, n); \ ++ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ + ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen); \ + assert_correct_wwid("test_vpd_str_" #typ "_" #len "_" #wlen, \ + exp_len, ret, byte0[type], 0, \ +@@ -495,8 +496,8 @@ static void test_vpd_naa_ ## naa ## _ ## wlen(void **state) \ + \ + n = create_vpd83(vt->vpdbuf, sizeof(vt->vpdbuf), test_id, \ + 3, naa, 0); \ +- will_return(__wrap_ioctl, n); \ +- will_return(__wrap_ioctl, vt->vpdbuf); \ ++ wrap_will_return(WRAP_IOCTL, n); \ ++ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ + ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen); \ + assert_correct_wwid("test_vpd_naa_" #naa "_" #wlen, \ + exp_len, ret, '3', '0' + naa, true, \ +@@ -518,8 +519,8 @@ static void test_vpd_naa_##NAA##_badlen_##BAD(void **state) \ + n = create_vpd83(vt->vpdbuf, sizeof(vt->vpdbuf), test_id, 3, NAA, 0); \ + \ + vt->vpdbuf[7] = BAD; \ +- will_return(__wrap_ioctl, n); \ +- will_return(__wrap_ioctl, vt->vpdbuf); \ ++ wrap_will_return(WRAP_IOCTL, n); \ ++ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ + ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, 40); \ + assert_int_equal(-ret, -ERR); \ + } +@@ -545,11 +546,11 @@ static void test_vpd_eui_ ## len ## _ ## wlen ## _ ## sml(void **state) \ + /* overwrite the page size to DEFAULT_SGIO_LEN + 1 */ \ + put_unaligned_be16(255, vt->vpdbuf + 2); \ + /* this causes get_vpd_sgio to do a second ioctl */ \ +- will_return(__wrap_ioctl, n); \ +- will_return(__wrap_ioctl, vt->vpdbuf); \ ++ wrap_will_return(WRAP_IOCTL, n); \ ++ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ + } \ +- will_return(__wrap_ioctl, n); \ +- will_return(__wrap_ioctl, vt->vpdbuf); \ ++ wrap_will_return(WRAP_IOCTL, n); \ ++ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ + ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen); \ + assert_correct_wwid("test_vpd_eui_" #len "_" #wlen "_" #sml, \ + exp_len, ret, '2', 0, true, \ +@@ -571,8 +572,8 @@ static void test_vpd_eui_badlen_##LEN##_##BAD(void **state) \ + n = create_vpd83(vt->vpdbuf, sizeof(vt->vpdbuf), test_id, 2, 0, LEN); \ + \ + vt->vpdbuf[7] = BAD; \ +- will_return(__wrap_ioctl, n); \ +- will_return(__wrap_ioctl, vt->vpdbuf); \ ++ wrap_will_return(WRAP_IOCTL, n); \ ++ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ + ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, 40); \ + assert_int_equal(ret, ERR); \ + if (ERR >= 0) \ +@@ -600,8 +601,8 @@ static void test_vpd80_ ## size ## _ ## len ## _ ## wlen(void **state) \ + exp_len = wlen - 1; \ + n = create_vpd80(vt->vpdbuf, sizeof(vt->vpdbuf), input, \ + size, len); \ +- will_return(__wrap_ioctl, n); \ +- will_return(__wrap_ioctl, vt->vpdbuf); \ ++ wrap_will_return(WRAP_IOCTL, n); \ ++ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ + ret = get_vpd_sgio(10, 0x80, 0, vt->wwid, wlen); \ + assert_correct_wwid("test_vpd80_" #size "_" #len "_" #wlen, \ + exp_len, ret, 0, 0, false, \ +diff --git a/tests/wrap64.h b/tests/wrap64.h +index 8c91d279..b0a4d831 100644 +--- a/tests/wrap64.h ++++ b/tests/wrap64.h +@@ -1,5 +1,7 @@ + #ifndef _WRAP64_H + #define _WRAP64_H 1 ++#include ++#include + #include "util.h" + + /* +@@ -31,7 +33,9 @@ + * fcntl() needs special treatment; fcntl64() has been introduced in 2.28. + * https://savannah.gnu.org/forum/forum.php?forum_id=9205 + */ +-#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 28) ++#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 37) && defined(__arm__) && __ARM_ARCH == 7 ++#define WRAP_FCNTL_NAME __fcntl_time64 ++#elif defined(__GLIBC__) && __GLIBC_PREREQ(2, 28) + #define WRAP_FCNTL_NAME WRAP_NAME(fcntl) + #else + #define WRAP_FCNTL_NAME fcntl +@@ -39,6 +43,25 @@ + #define WRAP_FCNTL CONCAT2(__wrap_, WRAP_FCNTL_NAME) + #define REAL_FCNTL CONCAT2(__real_, WRAP_FCNTL_NAME) + ++/* ++ * glibc 2.37 uses __ioctl_time64 for ioctl ++ */ ++#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 37) && defined(__arm__) && __ARM_ARCH == 7 ++#define WRAP_IOCTL_NAME __ioctl_time64 ++#else ++#define WRAP_IOCTL_NAME ioctl ++#endif ++#define WRAP_IOCTL CONCAT2(__wrap_, WRAP_IOCTL_NAME) ++#define REAL_IOCTL CONCAT2(__real_, WRAP_IOCTL_NAME) ++ ++#if defined(__NR_io_pgetevents) && __BITS_PER_LONG == 32 && defined(_TIME_BITS) && _TIME_BITS == 64 ++#define WRAP_IO_GETEVENTS_NAME io_getevents_time64 ++#else ++#define WRAP_IO_GETEVENTS_NAME io_getevents ++#endif ++#define WRAP_IO_GETEVENTS CONCAT2(__wrap_, WRAP_IO_GETEVENTS_NAME) ++#define REAL_IO_GETEVENTS CONCAT2(__real_, WRAP_IO_GETEVENTS_NAME) ++ + /* + * will_return() is itself a macro that uses CPP "stringizing". We need a + * macro indirection to make sure the *value* of WRAP_FUNC() is stringized diff --git a/0019-multipath-tools-tests-fix-CI-failures-with-clang-on-.patch b/0019-multipath-tools-tests-fix-CI-failures-with-clang-on-.patch new file mode 100644 index 0000000..d1dedac --- /dev/null +++ b/0019-multipath-tools-tests-fix-CI-failures-with-clang-on-.patch @@ -0,0 +1,246 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 5 Apr 2024 22:21:43 +0200 +Subject: [PATCH] multipath-tools tests: fix CI failures with clang on Fedora + Rawhide + +Fedora's glibc 2.39 includes the following patch: + +https://patches.linaro.org/project/libc-alpha/patch/20240208184622.332678-10-adhemerval.zanella@linaro.org/ + +It causes open("file", O_RDONLY) to resolve to __open64_2(), +whereas it resolves to open64() with gcc, causing CI failures because of +wrong wrapper substitutions. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + tests/dmevents.c | 6 ++--- + tests/sysfs.c | 58 ++++++++++++++++++++++++------------------------ + tests/test-lib.c | 6 ++--- + tests/wrap64.h | 14 ++++++++++++ + 4 files changed, 49 insertions(+), 35 deletions(-) + +diff --git a/tests/dmevents.c b/tests/dmevents.c +index 540bf0d3..395b16d7 100644 +--- a/tests/dmevents.c ++++ b/tests/dmevents.c +@@ -207,7 +207,7 @@ static int teardown(void **state) + return 0; + } + +-int WRAP_FUNC(open)(const char *pathname, int flags) ++int WRAP_OPEN(const char *pathname, int flags) + { + assert_ptr_equal(pathname, "/dev/mapper/control"); + assert_int_equal(flags, O_RDWR); +@@ -389,7 +389,7 @@ static void test_init_waiter_bad1(void **state) + struct test_data *datap = (struct test_data *)(*state); + if (datap == NULL) + skip(); +- wrap_will_return(WRAP_FUNC(open), -1); ++ wrap_will_return(WRAP_OPEN, -1); + assert_int_equal(init_dmevent_waiter(&datap->vecs), -1); + assert_ptr_equal(waiter, NULL); + } +@@ -400,7 +400,7 @@ static void test_init_waiter_good0(void **state) + struct test_data *datap = (struct test_data *)(*state); + if (datap == NULL) + skip(); +- wrap_will_return(WRAP_FUNC(open), 2); ++ wrap_will_return(WRAP_OPEN, 2); + assert_int_equal(init_dmevent_waiter(&datap->vecs), 0); + assert_ptr_not_equal(waiter, NULL); + } +diff --git a/tests/sysfs.c b/tests/sysfs.c +index fc256d87..c623d1bb 100644 +--- a/tests/sysfs.c ++++ b/tests/sysfs.c +@@ -29,7 +29,7 @@ char *__wrap_udev_device_get_syspath(struct udev_device *ud) + return val; + } + +-int WRAP_FUNC(open)(const char *pathname, int flags) ++int WRAP_OPEN(const char *pathname, int flags) + { + int ret; + +@@ -167,10 +167,10 @@ static void test_sagv_open_fail(void **state) + + will_return(__wrap_udev_device_get_syspath, "/foo"); + expect_condlog(4, "open '/foo/bar'"); +- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); +- expect_value(WRAP_FUNC(open), flags, O_RDONLY); ++ expect_string(WRAP_OPEN, pathname, "/foo/bar"); ++ expect_value(WRAP_OPEN, flags, O_RDONLY); + errno = ENOENT; +- wrap_will_return(WRAP_FUNC(open), -1); ++ wrap_will_return(WRAP_OPEN, -1); + expect_condlog(3, "__sysfs_attr_get_value: attribute '/foo/bar' cannot be opened"); + assert_int_equal(sysfs_attr_get_value((void *)state, "bar", + buf, sizeof(buf)), -ENOENT); +@@ -182,9 +182,9 @@ static void test_sagv_read_fail(void **state) + + will_return(__wrap_udev_device_get_syspath, "/foo"); + expect_condlog(4, "open '/foo/bar'"); +- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); +- expect_value(WRAP_FUNC(open), flags, O_RDONLY); +- wrap_will_return(WRAP_FUNC(open), TEST_FD); ++ expect_string(WRAP_OPEN, pathname, "/foo/bar"); ++ expect_value(WRAP_OPEN, flags, O_RDONLY); ++ wrap_will_return(WRAP_OPEN, TEST_FD); + expect_value(__wrap_read, fd, TEST_FD); + expect_value(__wrap_read, count, sizeof(buf)); + errno = EISDIR; +@@ -197,9 +197,9 @@ static void test_sagv_read_fail(void **state) + + will_return(__wrap_udev_device_get_syspath, "/foo"); + expect_condlog(4, "open '/foo/baz'"); +- expect_string(WRAP_FUNC(open), pathname, "/foo/baz"); +- expect_value(WRAP_FUNC(open), flags, O_RDONLY); +- wrap_will_return(WRAP_FUNC(open), TEST_FD); ++ expect_string(WRAP_OPEN, pathname, "/foo/baz"); ++ expect_value(WRAP_OPEN, flags, O_RDONLY); ++ wrap_will_return(WRAP_OPEN, TEST_FD); + expect_value(__wrap_read, fd, TEST_FD); + expect_value(__wrap_read, count, sizeof(buf)); + errno = EPERM; +@@ -223,9 +223,9 @@ static void _test_sagv_read(void **state, unsigned int bufsz) + memset(buf, '.', sizeof(buf)); + will_return(__wrap_udev_device_get_syspath, "/foo"); + expect_condlog(4, "open '/foo/bar'"); +- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); +- expect_value(WRAP_FUNC(open), flags, O_RDONLY); +- wrap_will_return(WRAP_FUNC(open), TEST_FD); ++ expect_string(WRAP_OPEN, pathname, "/foo/bar"); ++ expect_value(WRAP_OPEN, flags, O_RDONLY); ++ wrap_will_return(WRAP_OPEN, TEST_FD); + expect_value(__wrap_read, fd, TEST_FD); + expect_value(__wrap_read, count, bufsz); + will_return(__wrap_read, sizeof(input) - 1); +@@ -250,9 +250,9 @@ static void _test_sagv_read(void **state, unsigned int bufsz) + memset(buf, '.', sizeof(buf)); + will_return(__wrap_udev_device_get_syspath, "/foo"); + expect_condlog(4, "open '/foo/baz'"); +- expect_string(WRAP_FUNC(open), pathname, "/foo/baz"); +- expect_value(WRAP_FUNC(open), flags, O_RDONLY); +- wrap_will_return(WRAP_FUNC(open), TEST_FD); ++ expect_string(WRAP_OPEN, pathname, "/foo/baz"); ++ expect_value(WRAP_OPEN, flags, O_RDONLY); ++ wrap_will_return(WRAP_OPEN, TEST_FD); + expect_value(__wrap_read, fd, TEST_FD); + expect_value(__wrap_read, count, bufsz); + will_return(__wrap_read, sizeof(input) - 1); +@@ -301,9 +301,9 @@ static void _test_sagv_read_zeroes(void **state, unsigned int bufsz) + memset(buf, '.', sizeof(buf)); + will_return(__wrap_udev_device_get_syspath, "/foo"); + expect_condlog(4, "open '/foo/bar'"); +- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); +- expect_value(WRAP_FUNC(open), flags, O_RDONLY); +- wrap_will_return(WRAP_FUNC(open), TEST_FD); ++ expect_string(WRAP_OPEN, pathname, "/foo/bar"); ++ expect_value(WRAP_OPEN, flags, O_RDONLY); ++ wrap_will_return(WRAP_OPEN, TEST_FD); + expect_value(__wrap_read, fd, TEST_FD); + expect_value(__wrap_read, count, bufsz); + will_return(__wrap_read, sizeof(input) - 1); +@@ -386,10 +386,10 @@ static void test_sasv_open_fail(void **state) + + will_return(__wrap_udev_device_get_syspath, "/foo"); + expect_condlog(4, "open '/foo/bar'"); +- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); +- expect_value(WRAP_FUNC(open), flags, O_WRONLY); ++ expect_string(WRAP_OPEN, pathname, "/foo/bar"); ++ expect_value(WRAP_OPEN, flags, O_WRONLY); + errno = EPERM; +- wrap_will_return(WRAP_FUNC(open), -1); ++ wrap_will_return(WRAP_OPEN, -1); + expect_condlog(3, "sysfs_attr_set_value: attribute '/foo/bar' cannot be opened"); + assert_int_equal(sysfs_attr_set_value((void *)state, "bar", + buf, sizeof(buf)), -EPERM); +@@ -401,9 +401,9 @@ static void test_sasv_write_fail(void **state) + + will_return(__wrap_udev_device_get_syspath, "/foo"); + expect_condlog(4, "open '/foo/bar'"); +- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); +- expect_value(WRAP_FUNC(open), flags, O_WRONLY); +- wrap_will_return(WRAP_FUNC(open), TEST_FD); ++ expect_string(WRAP_OPEN, pathname, "/foo/bar"); ++ expect_value(WRAP_OPEN, flags, O_WRONLY); ++ wrap_will_return(WRAP_OPEN, TEST_FD); + expect_value(__wrap_write, fd, TEST_FD); + expect_value(__wrap_write, count, sizeof(buf)); + errno = EISDIR; +@@ -422,9 +422,9 @@ static void _test_sasv_write(void **state, unsigned int n_written) + assert_in_range(n_written, 0, sizeof(buf)); + will_return(__wrap_udev_device_get_syspath, "/foo"); + expect_condlog(4, "open '/foo/bar'"); +- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); +- expect_value(WRAP_FUNC(open), flags, O_WRONLY); +- wrap_will_return(WRAP_FUNC(open), TEST_FD); ++ expect_string(WRAP_OPEN, pathname, "/foo/bar"); ++ expect_value(WRAP_OPEN, flags, O_WRONLY); ++ wrap_will_return(WRAP_OPEN, TEST_FD); + expect_value(__wrap_write, fd, TEST_FD); + expect_value(__wrap_write, count, sizeof(buf)); + will_return(__wrap_write, n_written); +@@ -489,7 +489,7 @@ int main(void) + { + int ret = 0; + +- init_test_verbosity(4); ++ init_test_verbosity(5); + ret += test_sysfs(); + return ret; + } +diff --git a/tests/test-lib.c b/tests/test-lib.c +index 665d438e..cdb2780d 100644 +--- a/tests/test-lib.c ++++ b/tests/test-lib.c +@@ -40,17 +40,17 @@ const char default_wwid_1[] = "TEST-WWID-1"; + */ + + +-int REAL_FUNC(open)(const char *path, int flags, int mode); ++int REAL_OPEN(const char *path, int flags, int mode); + + static const char _mocked_filename[] = "mocked_path"; + +-int WRAP_FUNC(open)(const char *path, int flags, int mode) ++int WRAP_OPEN(const char *path, int flags, int mode) + { + condlog(4, "%s: %s", __func__, path); + + if (!strcmp(path, _mocked_filename)) + return 111; +- return REAL_FUNC(open)(path, flags, mode); ++ return REAL_OPEN(path, flags, mode); + } + + int __wrap_libmp_get_version(int which, unsigned int version[3]) +diff --git a/tests/wrap64.h b/tests/wrap64.h +index b0a4d831..7e434206 100644 +--- a/tests/wrap64.h ++++ b/tests/wrap64.h +@@ -29,6 +29,20 @@ + #define WRAP_FUNC(x) CONCAT2(__wrap_, WRAP_NAME(x)) + #define REAL_FUNC(x) CONCAT2(__real_, WRAP_NAME(x)) + ++/* ++ * With clang, glibc 2.39, and _FILE_OFFSET_BITS==64, ++ * open() resolves to __open64_2(). ++ */ ++#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 39) && \ ++ defined(__clang__) && __clang__ == 1 && \ ++ defined(__fortify_use_clang) && __fortify_use_clang == 1 ++#define WRAP_OPEN_NAME __open64_2 ++#else ++#define WRAP_OPEN_NAME WRAP_NAME(open) ++#endif ++#define WRAP_OPEN CONCAT2(__wrap_, WRAP_OPEN_NAME) ++#define REAL_OPEN CONCAT2(__real_, WRAP_OPEN_NAME) ++ + /* + * fcntl() needs special treatment; fcntl64() has been introduced in 2.28. + * https://savannah.gnu.org/forum/forum.php?forum_id=9205 diff --git a/0020-GitHub-actions-fixes-for-spelling-CI.patch b/0020-GitHub-actions-fixes-for-spelling-CI.patch new file mode 100644 index 0000000..21b74ff --- /dev/null +++ b/0020-GitHub-actions-fixes-for-spelling-CI.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 8 Mar 2024 10:04:39 +0100 +Subject: [PATCH] GitHub actions: fixes for spelling CI + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/actions/spelling/patterns.txt | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt +index 57767ea1..858faee6 100644 +--- a/.github/actions/spelling/patterns.txt ++++ b/.github/actions/spelling/patterns.txt +@@ -22,6 +22,7 @@ + \bdmmp_pgs\b + \bdmmp_mpath_kdev_name_get\b + \bfast_io_fail_tmo\b ++\bLimitRTPRIO\b + \bmax_fds\b + \bmissing_uev_wait_timeout\b + \bMPATH_MAX_PARAM_LEN\b +@@ -86,6 +87,7 @@ + \bprin_resvdescr\b + \bprout_param_descriptor\b + \brq_servact\b ++\bSCHED_RT_PRIO\b + \bssize_t\b + \btrnptid_list\b + \buxsock_timeout\b diff --git a/0021-GitHub-workflows-run-workflows-if-workflow-file-has-.patch b/0021-GitHub-workflows-run-workflows-if-workflow-file-has-.patch new file mode 100644 index 0000000..59cdd0e --- /dev/null +++ b/0021-GitHub-workflows-run-workflows-if-workflow-file-has-.patch @@ -0,0 +1,146 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Tue, 27 Feb 2024 09:57:47 +0100 +Subject: [PATCH] GitHub workflows: run workflows if workflow file has changed + +We want to run workflows if the workflow file itself has changed. + +Fixes: 2cbe81a ("GitHub Workflows: run expensive workflows only on relevant changes") +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/workflows/abi.yaml | 1 + + .github/workflows/foreign.yaml | 2 ++ + .github/workflows/multiarch-stable.yaml | 2 ++ + .github/workflows/multiarch.yaml | 2 ++ + .github/workflows/native.yaml | 2 ++ + .github/workflows/rolling.yaml | 2 ++ + .github/workflows/spelling.yml | 2 ++ + 7 files changed, 13 insertions(+) + +diff --git a/.github/workflows/abi.yaml b/.github/workflows/abi.yaml +index 53382420..393322e5 100644 +--- a/.github/workflows/abi.yaml ++++ b/.github/workflows/abi.yaml +@@ -5,6 +5,7 @@ on: + - queue + - abi + paths: ++ - '.github/workflows/abi.yaml' + - '**.h' + - '**.c' + pull_request: +diff --git a/.github/workflows/foreign.yaml b/.github/workflows/foreign.yaml +index 92f6d17a..a62ae009 100644 +--- a/.github/workflows/foreign.yaml ++++ b/.github/workflows/foreign.yaml +@@ -6,6 +6,7 @@ on: + - queue + - tip + paths: ++ - '.github/workflows/foreign.yaml' + - '**.h' + - '**.c' + - '**Makefile*' +@@ -15,6 +16,7 @@ on: + - master + - queue + paths: ++ - '.github/workflows/foreign.yaml' + - '**.h' + - '**.c' + - '**Makefile*' +diff --git a/.github/workflows/multiarch-stable.yaml b/.github/workflows/multiarch-stable.yaml +index 45b74c51..e51d383c 100644 +--- a/.github/workflows/multiarch-stable.yaml ++++ b/.github/workflows/multiarch-stable.yaml +@@ -6,6 +6,7 @@ on: + - queue + - tip + paths: ++ - '.github/workflows/multiarch-stable.yaml' + - '**.h' + - '**.c' + - '**Makefile*' +@@ -15,6 +16,7 @@ on: + - master + - queue + paths: ++ - '.github/workflows/multiarch-stable.yaml' + - '**.h' + - '**.c' + - '**Makefile*' +diff --git a/.github/workflows/multiarch.yaml b/.github/workflows/multiarch.yaml +index b4dec9c7..7b762e5c 100644 +--- a/.github/workflows/multiarch.yaml ++++ b/.github/workflows/multiarch.yaml +@@ -6,6 +6,7 @@ on: + - queue + - tip + paths: ++ - '.github/workflows/multiarch.yaml' + - '**.h' + - '**.c' + - '**Makefile*' +@@ -15,6 +16,7 @@ on: + - master + - queue + paths: ++ - '.github/workflows/multiarch.yaml' + - '**.h' + - '**.c' + - '**Makefile*' +diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml +index 09133c1e..0ef9df94 100644 +--- a/.github/workflows/native.yaml ++++ b/.github/workflows/native.yaml +@@ -6,6 +6,7 @@ on: + - queue + - tip + paths: ++ - '.github/workflows/native.yaml' + - '**.h' + - '**.c' + - '**Makefile*' +@@ -15,6 +16,7 @@ on: + - master + - queue + paths: ++ - '.github/workflows/native.yaml' + - '**.h' + - '**.c' + - '**Makefile*' +diff --git a/.github/workflows/rolling.yaml b/.github/workflows/rolling.yaml +index 1f1507ee..3536b944 100644 +--- a/.github/workflows/rolling.yaml ++++ b/.github/workflows/rolling.yaml +@@ -6,6 +6,7 @@ on: + - queue + - tip + paths: ++ - '.github/workflows/rolling.yaml' + - '**.h' + - '**.c' + - '**Makefile*' +@@ -15,6 +16,7 @@ on: + - master + - queue + paths: ++ - '.github/workflows/rolling.yaml' + - '**.h' + - '**.c' + - '**Makefile*' +diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml +index 0416fa9e..7943ebb8 100644 +--- a/.github/workflows/spelling.yml ++++ b/.github/workflows/spelling.yml +@@ -63,7 +63,9 @@ on: + tags-ignore: + - "**" + paths: ++ - '.github/workflows/spelling.yml' + - 'README*' ++ - 'NEWS.md' + - '**.3' + - '**.5' + - '**.8' diff --git a/0022-multipath-tools-add-TGTDIR-option.patch b/0022-multipath-tools-add-TGTDIR-option.patch new file mode 100644 index 0000000..d26fb18 --- /dev/null +++ b/0022-multipath-tools-add-TGTDIR-option.patch @@ -0,0 +1,106 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 17 Apr 2024 14:44:45 +0200 +Subject: [PATCH] multipath-tools: add TGTDIR option + +TGTDIR is a convenience option for developers for building multipath-tools such +that compiled-in paths of the plugins, config files, etc. match an +installation under some optional path. See README.md for instructions and +examples. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + .github/actions/spelling/expect.txt | 2 ++ + Makefile.inc | 8 +++---- + README.md | 33 +++++++++++++++++++++++++++++ + 3 files changed, 39 insertions(+), 4 deletions(-) + +diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt +index 5906403d..fc9f22f8 100644 +--- a/.github/actions/spelling/expect.txt ++++ b/.github/actions/spelling/expect.txt +@@ -167,6 +167,7 @@ retrigger + rhabarber + rootprefix + rootprefixdir ++rpmbuild + rport + rtpi + sas +@@ -200,6 +201,7 @@ tcp + TESTDEPS + testname + tgill ++TGTDIR + TIDS + tmo + tpg +diff --git a/Makefile.inc b/Makefile.inc +index 5668e638..81b86cd8 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -101,9 +101,9 @@ WARNFLAGS := -Werror -Wall -Wextra -Wformat=2 $(WFORMATOVERFLOW) -Werror=implici + $(WNOCLOBBERED) -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) $(W_URCU_TYPE_LIMITS) + CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) \ + -D_FILE_OFFSET_BITS=64 \ +- -DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(plugindir)\" \ +- -DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(configdir)\" \ +- -DDEFAULT_CONFIGFILE=\"$(configfile)\" -DSTATE_DIR=\"$(statedir)\" \ ++ -DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(TGTDIR)$(plugindir)\" \ ++ -DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \ ++ -DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" -DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \ + -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP + CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe + BIN_CFLAGS := -fPIE -DPIE +@@ -149,4 +149,4 @@ NV_VERSION_SCRIPT = $(DEVLIB:%.so=%-nv.version) + + %: %.in + @echo creating $@ +- $(Q)sed 's:@CONFIGFILE@:'$(configfile)':g;s:@CONFIGDIR@:'$(configdir)':g;s:@STATE_DIR@:'$(statedir)':g;s:@RUNTIME_DIR@:'$(runtimedir)':g;s/@MODPROBE_UNIT@/'$(MODPROBE_UNIT)'/g;s:@BINDIR@:'$(bindir)':g' $< >$@ ++ $(Q)sed 's:@CONFIGFILE@:'$(TGTDIR)$(configfile)':g;s:@CONFIGDIR@:'$(TGTDIR)$(configdir)':g;s:@STATE_DIR@:'$(TGTDIR)$(statedir)':g;s:@RUNTIME_DIR@:'$(runtimedir)':g;s/@MODPROBE_UNIT@/'$(MODPROBE_UNIT)'/g;s:@BINDIR@:'$(bindir)':g' $< >$@ +diff --git a/README.md b/README.md +index d4f35f57..7207b14c 100644 +--- a/README.md ++++ b/README.md +@@ -151,6 +151,39 @@ sufficient control. See `Makefile.inc` for even more fine-grained control. + On such distributions, override `unitdir` and `libudevdir` to use systemd's + `rootprefix`: `make libudevdir=/lib/udev unitdir=/lib/systemd/system` + ++### prefix, DESTDIR and TGTDIR ++ ++`prefix` and related variables are included in compiled-in paths like ++`plugindir` and are used by `make install`. Using `prefix` is useful if ++multipath-tools is built locally on the same host where it's supposed to be ++installed. ++ ++By convention, the `DESTDIR` variable is prepended to all paths by `make ++install`, but not to any compiled-in paths. ++It is useful if the software is built on one system (build host) but intended ++to be run on another system (installation host). This is typically used in build ++systems like *rpmbuild* to set a root directory for all the installed ++files. ++ ++On the contrary, the `TGTDIR` variable is used for compiled-in paths only, and ++ignored by `make install`. It is useful for running multipath-tools in a separate ++subdirectory in the installation host, mostly for testing / development ++purposes. ++ ++For example, ++ ++ make prefix=/opt DESTDIR=/build TGTDIR=/test install ++ ++will install plugins into `/build/opt/lib64/multipath` on the build ++host. On the installation host, the plugins will be expected to be found under ++`/test/opt/lib64/multipath`. If the developer runs ++ ++ rsync -a $BUILD_HOST:$DESTDIR/ $INSTALL_HOST:$TGTDIR/ ++ ++and adds `$TGTDIR/lib64` to `LD_LIBRARY_PATH` on the installation host, the ++multipath binaries installed under `$TGTDIR` will find their plugins and ++configuration files in the expected compiled-in paths. ++ + ### Compiler Options + + Use `OPTFLAGS` to change optimization-related compiler options; diff --git a/0023-libmultipath-move-get_udev_for_mpp-to-sysfs.c.patch b/0023-libmultipath-move-get_udev_for_mpp-to-sysfs.c.patch new file mode 100644 index 0000000..b59f879 --- /dev/null +++ b/0023-libmultipath-move-get_udev_for_mpp-to-sysfs.c.patch @@ -0,0 +1,87 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 17 Apr 2024 17:18:18 +0200 +Subject: [PATCH] libmultipath: move get_udev_for_mpp to sysfs.c + +No functional changes, just code movement. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmultipath/configure.c | 20 -------------------- + libmultipath/sysfs.c | 19 +++++++++++++++++++ + libmultipath/sysfs.h | 4 ++++ + 3 files changed, 23 insertions(+), 20 deletions(-) + +diff --git a/libmultipath/configure.c b/libmultipath/configure.c +index 4ecf6ba4..89ac03d5 100644 +--- a/libmultipath/configure.c ++++ b/libmultipath/configure.c +@@ -453,26 +453,6 @@ pgcmp (struct multipath * mpp, struct multipath * cmpp) + return r; + } + +-static struct udev_device * +-get_udev_for_mpp(const struct multipath *mpp) +-{ +- dev_t devnum; +- struct udev_device *udd; +- +- if (!mpp || !has_dm_info(mpp)) { +- condlog(1, "%s called with empty mpp", __func__); +- return NULL; +- } +- +- devnum = makedev(mpp->dmi.major, mpp->dmi.minor); +- udd = udev_device_new_from_devnum(udev, 'b', devnum); +- if (!udd) { +- condlog(1, "failed to get udev device for %s", mpp->alias); +- return NULL; +- } +- return udd; +-} +- + void trigger_partitions_udev_change(struct udev_device *dev, + const char *action, int len) + { +diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c +index 328951ed..afe9de91 100644 +--- a/libmultipath/sysfs.c ++++ b/libmultipath/sysfs.c +@@ -339,3 +339,22 @@ bool sysfs_is_multipathed(struct path *pp, bool set_wwid) + + return found; + } ++ ++struct udev_device *get_udev_for_mpp(const struct multipath *mpp) ++{ ++ dev_t devnum; ++ struct udev_device *udd; ++ ++ if (!mpp || !has_dm_info(mpp)) { ++ condlog(1, "%s called with empty mpp", __func__); ++ return NULL; ++ } ++ ++ devnum = makedev(mpp->dmi.major, mpp->dmi.minor); ++ udd = udev_device_new_from_devnum(udev, 'b', devnum); ++ if (!udd) { ++ condlog(1, "failed to get udev device for %s", mpp->alias); ++ return NULL; ++ } ++ return udd; ++} +diff --git a/libmultipath/sysfs.h b/libmultipath/sysfs.h +index 2db86bd6..3be3f665 100644 +--- a/libmultipath/sysfs.h ++++ b/libmultipath/sysfs.h +@@ -39,4 +39,8 @@ do { \ + int sysfs_get_size (struct path *pp, unsigned long long * size); + int sysfs_check_holders(char * check_devt, char * new_devt); + bool sysfs_is_multipathed(struct path *pp, bool set_wwid); ++ ++struct multipath; ++struct udev_device *get_udev_for_mpp(const struct multipath *mpp); ++ + #endif diff --git a/0024-libmultipath-add-mp_find_path_by_devt.patch b/0024-libmultipath-add-mp_find_path_by_devt.patch new file mode 100644 index 0000000..8a85be2 --- /dev/null +++ b/0024-libmultipath-add-mp_find_path_by_devt.patch @@ -0,0 +1,60 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 17 Apr 2024 14:57:33 +0200 +Subject: [PATCH] libmultipath: add mp_find_path_by_devt() + +A helper function that searches a struct multipath by dev_t, and +works whether or not mpp->paths is currently available. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmultipath/structs.c | 19 +++++++++++++++++++ + libmultipath/structs.h | 3 +++ + 2 files changed, 22 insertions(+) + +diff --git a/libmultipath/structs.c b/libmultipath/structs.c +index 74e31a13..e248fb51 100644 +--- a/libmultipath/structs.c ++++ b/libmultipath/structs.c +@@ -526,6 +526,25 @@ find_path_by_devt (const struct _vector *pathvec, const char * dev_t) + return NULL; + } + ++struct path *mp_find_path_by_devt(const struct multipath *mpp, const char *devt) ++{ ++ struct path *pp; ++ struct pathgroup *pgp; ++ unsigned int i, j; ++ ++ pp = find_path_by_devt(mpp->paths, devt); ++ if (pp) ++ return pp; ++ ++ vector_foreach_slot (mpp->pg, pgp, i){ ++ vector_foreach_slot (pgp->paths, pp, j){ ++ if (!strcmp(pp->dev_t, devt)) ++ return pp; ++ } ++ } ++ return NULL; ++} ++ + static int do_pathcount(const struct multipath *mpp, const int *states, + unsigned int nr_states) + { +diff --git a/libmultipath/structs.h b/libmultipath/structs.h +index 734905e2..a25eb9d5 100644 +--- a/libmultipath/structs.h ++++ b/libmultipath/structs.h +@@ -568,6 +568,9 @@ struct path * find_path_by_devt (const struct _vector *pathvec, const char *devt + struct path * find_path_by_dev (const struct _vector *pathvec, const char *dev); + struct path * first_path (const struct multipath *mpp); + ++struct path *mp_find_path_by_devt(const struct multipath *mpp, const char *devt); ++ ++ + int pathcount (const struct multipath *, int); + int count_active_paths(const struct multipath *); + int count_active_pending_paths(const struct multipath *); diff --git a/0025-Revert-libmultipath-fix-max_sectors_kb-on-adding-pat.patch b/0025-Revert-libmultipath-fix-max_sectors_kb-on-adding-pat.patch new file mode 100644 index 0000000..aaa0e9f --- /dev/null +++ b/0025-Revert-libmultipath-fix-max_sectors_kb-on-adding-pat.patch @@ -0,0 +1,33 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 11 Apr 2024 17:20:14 +0200 +Subject: [PATCH] Revert "libmultipath: fix max_sectors_kb on adding path" + +This reverts commit bbb77f318ee483292f50a7782aecaecc7e60f727. +Reviewed-by: Benjamin Marzinski + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/configure.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/libmultipath/configure.c b/libmultipath/configure.c +index 89ac03d5..13602f3f 100644 +--- a/libmultipath/configure.c ++++ b/libmultipath/configure.c +@@ -575,12 +575,11 @@ sysfs_set_max_sectors_kb(struct multipath *mpp, int is_reload) + ssize_t len; + int i, j, ret, err = 0; + struct udev_device *udd; +- int max_sectors_kb = mpp->max_sectors_kb; ++ int max_sectors_kb; + +- /* by default, do not initialize max_sectors_kb on the device */ +- if (max_sectors_kb == MAX_SECTORS_KB_UNDEF && !is_reload) ++ if (mpp->max_sectors_kb == MAX_SECTORS_KB_UNDEF) + return 0; +- /* on reload, re-apply the user tuning on all the path devices */ ++ max_sectors_kb = mpp->max_sectors_kb; + if (is_reload) { + if (!has_dm_info(mpp) && + dm_get_info(mpp->alias, &mpp->dmi) != 0) { diff --git a/0026-libmultipath-Only-set-max_sectors_kb-on-map-creation.patch b/0026-libmultipath-Only-set-max_sectors_kb-on-map-creation.patch new file mode 100644 index 0000000..c82cfe7 --- /dev/null +++ b/0026-libmultipath-Only-set-max_sectors_kb-on-map-creation.patch @@ -0,0 +1,122 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Tue, 16 Apr 2024 22:20:46 +0200 +Subject: [PATCH] libmultipath: Only set max_sectors_kb on map creation + +Changing max_sectors_kb on a live map is dangerous. When I/O occurs while the +max_sectors_kb value of a map is larger than that of any of its paths, I/O +errors like this may result: + + blk_insert_cloned_request: over max size limit. (127 > 126) + +This situation must be strictly avoided. The kernel makes sure that the +map's limits match those of the paths when the map is created. But setting +max_sectors_kb on path devices before reloading is dangerous, even if we +read the value from the map's max_sectors_kb beforehand. The reason for +this is that the sysfs value max_sectors_kb is the kernel's max_sectors +divided by 2, and user space has no way to figure out if the kernel-internal +value is odd or even. Thus by writing back the value just read to +max_sectors_kb, one might actually decrease the kernel value by one. + +The only safe way to set max_sectors_kb on a live map would be to suspend +it, flushing all outstanding IO, then the path max_sectors_kb, reload, +and resume. + +Since commit 8fd4868 ("libmultipath: don't set max_sectors_kb on reloads"), +we don't set the configured max_sectors_kb any more. But as shown above, +this is not safe. So really only set max_sectors_kb when creating a map. + +Users who have stacked block devices on top of multipath, as described in the +commit message of 8fd4868 must make sure that the max_sectors_kb setting is +correct when the multipath map is first created. Decreasing the map's +max_sectors_kb value (without touching the paths) should actually be possible +in this situation, because stacked block devices are usually bio-based, and +bio-based IO (in contrast to request-based) can be split if the lower-level +device has can't handle the size of the I/O. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmultipath/configure.c | 38 ++++---------------------------------- + 1 file changed, 4 insertions(+), 34 deletions(-) + +diff --git a/libmultipath/configure.c b/libmultipath/configure.c +index 13602f3f..8cbb2a88 100644 +--- a/libmultipath/configure.c ++++ b/libmultipath/configure.c +@@ -566,46 +566,18 @@ trigger_paths_udev_change(struct multipath *mpp, bool is_mpath) + mpp->needs_paths_uevent = 0; + } + +-static int +-sysfs_set_max_sectors_kb(struct multipath *mpp, int is_reload) ++static int sysfs_set_max_sectors_kb(struct multipath *mpp) + { + struct pathgroup * pgp; + struct path *pp; + char buff[11]; + ssize_t len; + int i, j, ret, err = 0; +- struct udev_device *udd; +- int max_sectors_kb; + + if (mpp->max_sectors_kb == MAX_SECTORS_KB_UNDEF) + return 0; +- max_sectors_kb = mpp->max_sectors_kb; +- if (is_reload) { +- if (!has_dm_info(mpp) && +- dm_get_info(mpp->alias, &mpp->dmi) != 0) { +- condlog(1, "failed to get dm info for %s", mpp->alias); +- return 1; +- } +- udd = get_udev_for_mpp(mpp); +- if (!udd) { +- condlog(1, "failed to get udev device to set max_sectors_kb for %s", mpp->alias); +- return 1; +- } +- ret = sysfs_attr_get_value(udd, "queue/max_sectors_kb", buff, +- sizeof(buff)); +- udev_device_unref(udd); +- if (!sysfs_attr_value_ok(ret, sizeof(buff))) { +- condlog(1, "failed to get current max_sectors_kb from %s", mpp->alias); +- return 1; +- } +- if (sscanf(buff, "%u\n", &max_sectors_kb) != 1) { +- condlog(1, "can't parse current max_sectors_kb from %s", +- mpp->alias); +- return 1; +- } +- } +- snprintf(buff, 11, "%d", max_sectors_kb); +- len = strlen(buff); ++ ++ len = snprintf(buff, sizeof(buff), "%d", mpp->max_sectors_kb); + + vector_foreach_slot (mpp->pg, pgp, i) { + vector_foreach_slot(pgp->paths, pp, j) { +@@ -923,7 +895,7 @@ int domap(struct multipath *mpp, char *params, int is_daemon) + return DOMAP_RETRY; + } + +- sysfs_set_max_sectors_kb(mpp, 0); ++ sysfs_set_max_sectors_kb(mpp); + if (is_daemon && mpp->ghost_delay > 0 && count_active_paths(mpp) && + pathcount(mpp, PATH_UP) == 0) + mpp->ghost_delay_tick = mpp->ghost_delay; +@@ -934,7 +906,6 @@ int domap(struct multipath *mpp, char *params, int is_daemon) + + case ACT_RELOAD: + case ACT_RELOAD_RENAME: +- sysfs_set_max_sectors_kb(mpp, 1); + if (mpp->ghost_delay_tick > 0 && pathcount(mpp, PATH_UP)) + mpp->ghost_delay_tick = 0; + r = dm_addmap_reload(mpp, params, 0); +@@ -942,7 +913,6 @@ int domap(struct multipath *mpp, char *params, int is_daemon) + + case ACT_RESIZE: + case ACT_RESIZE_RENAME: +- sysfs_set_max_sectors_kb(mpp, 1); + if (mpp->ghost_delay_tick > 0 && pathcount(mpp, PATH_UP)) + mpp->ghost_delay_tick = 0; + r = dm_addmap_reload(mpp, params, 1); diff --git a/0027-libmultipath-set-max_sectors_kb-in-adopt_paths.patch b/0027-libmultipath-set-max_sectors_kb-in-adopt_paths.patch new file mode 100644 index 0000000..a4389df --- /dev/null +++ b/0027-libmultipath-set-max_sectors_kb-in-adopt_paths.patch @@ -0,0 +1,233 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Tue, 16 Apr 2024 23:59:03 +0200 +Subject: [PATCH] libmultipath: set max_sectors_kb in adopt_paths() + +As explained in the previous commit, setting max_sectors_kb for +paths that are members of a live map is dangerous. But as long as +a path is not a member of a map, setting max_sectors_kb poses no risk. +Set the parameter in adopt_paths(), for paths that aren't members +of the map yet. In order to determine whether or not a path is currently +member of the map, adopt_paths() needs to passed the current member list. If +(and only if) it's called from coalesce_paths(), the passed struct multipath +doesn not represent the current state of the map; adopt_paths() must therefore +get a new argument current_mpp that represents the kernel state. + +We must still call sysfs_set_max_sectors_kb() from domap() in the ACT_CREATE +case, because when adopt_paths is called from coalesce_paths() for a map that +doesn't exist yet, mpp->max_sectors_kb is not set. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmultipath/configure.c | 2 +- + libmultipath/structs_vec.c | 62 ++++++++++++++++++++++++++++++++++---- + libmultipath/structs_vec.h | 6 ++-- + multipathd/main.c | 6 ++-- + tests/Makefile | 2 +- + tests/test-lib.c | 9 +++++- + 6 files changed, 73 insertions(+), 14 deletions(-) + +diff --git a/libmultipath/configure.c b/libmultipath/configure.c +index 8cbb2a88..b5c701fa 100644 +--- a/libmultipath/configure.c ++++ b/libmultipath/configure.c +@@ -1105,7 +1105,7 @@ int coalesce_paths (struct vectors *vecs, vector mpvec, char *refwwid, + /* + * at this point, we know we really got a new mp + */ +- mpp = add_map_with_path(vecs, pp1, 0); ++ mpp = add_map_with_path(vecs, pp1, 0, cmpp); + if (!mpp) { + orphan_path(pp1, "failed to create multipath device"); + continue; +diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c +index 0fc608c2..c0c5cc90 100644 +--- a/libmultipath/structs_vec.c ++++ b/libmultipath/structs_vec.c +@@ -242,7 +242,38 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, + return must_reload; + } + +-int adopt_paths(vector pathvec, struct multipath *mpp) ++static bool set_path_max_sectors_kb(const struct path *pp, int max_sectors_kb) ++{ ++ char buf[11]; ++ ssize_t len; ++ int ret, current; ++ bool rc = false; ++ ++ if (max_sectors_kb == MAX_SECTORS_KB_UNDEF) ++ return rc; ++ ++ if (sysfs_attr_get_value(pp->udev, "queue/max_sectors_kb", buf, sizeof(buf)) <= 0 ++ || sscanf(buf, "%d\n", ¤t) != 1) ++ current = MAX_SECTORS_KB_UNDEF; ++ if (current == max_sectors_kb) ++ return rc; ++ ++ len = snprintf(buf, sizeof(buf), "%d", max_sectors_kb); ++ ret = sysfs_attr_set_value(pp->udev, "queue/max_sectors_kb", buf, len); ++ if (ret != len) ++ log_sysfs_attr_set_value(3, ret, ++ "failed setting max_sectors_kb on %s", ++ pp->dev); ++ else { ++ condlog(3, "%s: set max_sectors_kb to %d for %s", __func__, ++ max_sectors_kb, pp->dev); ++ rc = true; ++ } ++ return rc; ++} ++ ++int adopt_paths(vector pathvec, struct multipath *mpp, ++ const struct multipath *current_mpp) + { + int i, ret; + struct path * pp; +@@ -285,9 +316,28 @@ int adopt_paths(vector pathvec, struct multipath *mpp) + continue; + } + +- if (!find_path_by_devt(mpp->paths, pp->dev_t) && +- store_path(mpp->paths, pp)) +- goto err; ++ if (!find_path_by_devt(mpp->paths, pp->dev_t)) { ++ ++ if (store_path(mpp->paths, pp)) ++ goto err; ++ /* ++ * Setting max_sectors_kb on live paths is dangerous. ++ * But we can do it here on a path that isn't yet part ++ * of the map. If this value is lower than the current ++ * max_sectors_kb and the map is reloaded, the map's ++ * max_sectors_kb will be safely adjusted by the kernel. ++ * ++ * We must make sure that the path is not part of the ++ * map yet. Normally we can check this in mpp->paths. ++ * But if adopt_paths is called from coalesce_paths, ++ * we need to check the separate struct multipath that ++ * has been obtained from map_discovery(). ++ */ ++ if (!current_mpp || ++ !mp_find_path_by_devt(current_mpp, pp->dev_t)) ++ mpp->need_reload = mpp->need_reload || ++ set_path_max_sectors_kb(pp, mpp->max_sectors_kb); ++ } + + pp->mpp = mpp; + condlog(3, "%s: ownership set to %s", +@@ -693,7 +743,7 @@ find_existing_alias (struct multipath * mpp, + } + + struct multipath *add_map_with_path(struct vectors *vecs, struct path *pp, +- int add_vec) ++ int add_vec, const struct multipath *current_mpp) + { + struct multipath * mpp; + struct config *conf = NULL; +@@ -721,7 +771,7 @@ struct multipath *add_map_with_path(struct vectors *vecs, struct path *pp, + goto out; + mpp->size = pp->size; + +- if (adopt_paths(vecs->pathvec, mpp) || pp->mpp != mpp || ++ if (adopt_paths(vecs->pathvec, mpp, current_mpp) || pp->mpp != mpp || + find_slot(mpp->paths, pp) == -1) + goto out; + +diff --git a/libmultipath/structs_vec.h b/libmultipath/structs_vec.h +index 3253f1bb..dbc43058 100644 +--- a/libmultipath/structs_vec.h ++++ b/libmultipath/structs_vec.h +@@ -13,7 +13,8 @@ struct vectors { + + void set_no_path_retry(struct multipath *mpp); + +-int adopt_paths (vector pathvec, struct multipath * mpp); ++int adopt_paths (vector pathvec, struct multipath *mpp, ++ const struct multipath *current_mpp); + void orphan_path (struct path * pp, const char *reason); + void set_path_removed(struct path *pp); + +@@ -28,7 +29,8 @@ void remove_maps (struct vectors * vecs); + + void sync_map_state (struct multipath *); + struct multipath * add_map_with_path (struct vectors * vecs, +- struct path * pp, int add_vec); ++ struct path * pp, int add_vec, ++ const struct multipath *current_mpp); + void update_queue_mode_del_path(struct multipath *mpp); + void update_queue_mode_add_path(struct multipath *mpp); + int update_multipath_table (struct multipath *mpp, vector pathvec, int flags); +diff --git a/multipathd/main.c b/multipathd/main.c +index dd17d5c3..d8518a92 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -636,7 +636,7 @@ update_map (struct multipath *mpp, struct vectors *vecs, int new_map) + + retry: + condlog(4, "%s: updating new map", mpp->alias); +- if (adopt_paths(vecs->pathvec, mpp)) { ++ if (adopt_paths(vecs->pathvec, mpp, NULL)) { + condlog(0, "%s: failed to adopt paths for new map update", + mpp->alias); + retries = -1; +@@ -1231,7 +1231,7 @@ rescan: + if (mpp) { + condlog(4,"%s: adopting all paths for path %s", + mpp->alias, pp->dev); +- if (adopt_paths(vecs->pathvec, mpp) || pp->mpp != mpp || ++ if (adopt_paths(vecs->pathvec, mpp, NULL) || pp->mpp != mpp || + find_slot(mpp->paths, pp) == -1) + goto fail; /* leave path added to pathvec */ + +@@ -1245,7 +1245,7 @@ rescan: + return 0; + } + condlog(4,"%s: creating new map", pp->dev); +- if ((mpp = add_map_with_path(vecs, pp, 1))) { ++ if ((mpp = add_map_with_path(vecs, pp, 1, NULL))) { + mpp->action = ACT_CREATE; + /* + * We don't depend on ACT_CREATE, as domap will +diff --git a/tests/Makefile b/tests/Makefile +index d1d52dde..4005204a 100644 +--- a/tests/Makefile ++++ b/tests/Makefile +@@ -45,7 +45,7 @@ dmevents-test_OBJDEPS = $(multipathdir)/devmapper.o + dmevents-test_LIBDEPS = -lpthread -ldevmapper -lurcu + hwtable-test_TESTDEPS := test-lib.o + hwtable-test_OBJDEPS := $(multipathdir)/discovery.o $(multipathdir)/blacklist.o \ +- $(multipathdir)/structs.o $(multipathdir)/propsel.o ++ $(multipathdir)/structs_vec.o $(multipathdir)/structs.o $(multipathdir)/propsel.o + hwtable-test_LIBDEPS := -ludev -lpthread -ldl + blacklist-test_TESTDEPS := test-log.o + blacklist-test_LIBDEPS := -ludev +diff --git a/tests/test-lib.c b/tests/test-lib.c +index cdb2780d..88f35e94 100644 +--- a/tests/test-lib.c ++++ b/tests/test-lib.c +@@ -152,6 +152,13 @@ int __wrap_sysfs_get_size(struct path *pp, unsigned long long *sz) + return 0; + } + ++int __wrap_sysfs_attr_set_value(struct udev_device *dev, const char *attr_name, ++ const char * value, size_t value_len) ++{ ++ condlog(5, "%s: %s", __func__, value); ++ return value_len; ++} ++ + void *__wrap_udev_device_get_parent_with_subsystem_devtype( + struct udev_device *ud, const char *subsys, char *type) + { +@@ -400,7 +407,7 @@ struct multipath *__mock_multipath(struct vectors *vecs, struct path *pp) + /* pathinfo() call in adopt_paths */ + mock_pathinfo(DI_CHECKER|DI_PRIO, &mop); + +- mp = add_map_with_path(vecs, pp, 1); ++ mp = add_map_with_path(vecs, pp, 1, NULL); + assert_ptr_not_equal(mp, NULL); + + /* TBD: mock setup_map() ... */ diff --git a/0028-libmultipath-add-wildcard-k-for-printing-max_sectors.patch b/0028-libmultipath-add-wildcard-k-for-printing-max_sectors.patch new file mode 100644 index 0000000..9b66bbb --- /dev/null +++ b/0028-libmultipath-add-wildcard-k-for-printing-max_sectors.patch @@ -0,0 +1,89 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 17 Apr 2024 17:19:43 +0200 +Subject: [PATCH] libmultipath: add wildcard %k for printing max_sectors_kb + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmultipath/print.c | 38 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 38 insertions(+) + +diff --git a/libmultipath/print.c b/libmultipath/print.c +index 360308d2..efd5a16a 100644 +--- a/libmultipath/print.c ++++ b/libmultipath/print.c +@@ -32,6 +32,7 @@ + #include "util.h" + #include "foreign.h" + #include "strbuf.h" ++#include "sysfs.h" + + #define PRINT_PATH_LONG "%w %i %d %D %p %t %T %s %o" + #define PRINT_PATH_INDENT "%i %d %D %t %T %o" +@@ -431,6 +432,27 @@ snprint_multipath_vpd_data(struct strbuf *buff, + return append_strbuf_str(buff, "[undef]"); + } + ++static void cleanup_udev_device(struct udev_device **udd) ++{ ++ if (*udd) ++ udev_device_unref(*udd); ++} ++ ++static int ++snprint_multipath_max_sectors_kb(struct strbuf *buff, const struct multipath *mpp) ++{ ++ char buf[11]; ++ int max_sectors_kb; ++ struct udev_device *udd __attribute__((cleanup(cleanup_udev_device))) ++ = get_udev_for_mpp(mpp); ++ ++ if (!udd || ++ sysfs_attr_get_value(udd, "queue/max_sectors_kb", buf, sizeof(buf)) <= 0 || ++ sscanf(buf, "%d\n", &max_sectors_kb) != 1) ++ return print_strbuf(buff, "n/a"); ++ return print_strbuf(buff, "%d", max_sectors_kb); ++} ++ + /* + * path info printing functions + */ +@@ -790,6 +812,20 @@ snprint_alua_tpg(struct strbuf *buff, const struct path * pp) + return print_strbuf(buff, "0x%04x", pp->tpg_id); + } + ++static int ++snprint_path_max_sectors_kb(struct strbuf *buff, const struct path *pp) ++{ ++ char buf[11]; ++ int max_sectors_kb; ++ ++ if (!pp->udev || ++ sysfs_attr_get_value(pp->udev, "queue/max_sectors_kb", ++ buf, sizeof(buf)) <= 0 || ++ sscanf(buf, "%d\n", &max_sectors_kb) != 1) ++ return print_strbuf(buff, "n/a"); ++ return print_strbuf(buff, "%d", max_sectors_kb); ++} ++ + static const struct multipath_data mpd[] = { + {'n', "name", snprint_name}, + {'w', "uuid", snprint_multipath_uuid}, +@@ -815,6 +851,7 @@ static const struct multipath_data mpd[] = { + {'e', "rev", snprint_multipath_rev}, + {'G', "foreign", snprint_multipath_foreign}, + {'g', "vpd page data", snprint_multipath_vpd_data}, ++ {'k', "max_sectors_kb",snprint_multipath_max_sectors_kb}, + }; + + static const struct path_data pd[] = { +@@ -845,6 +882,7 @@ static const struct path_data pd[] = { + {'I', "init_st", snprint_initialized}, + {'L', "LUN hex", snprint_path_lunhex}, + {'A', "TPG", snprint_alua_tpg}, ++ {'k', "max_sectors_kb",snprint_path_max_sectors_kb}, + }; + + static const struct pathgroup_data pgd[] = { diff --git a/0029-multipath.conf-5-update-documentation-for-max_sector.patch b/0029-multipath.conf-5-update-documentation-for-max_sector.patch new file mode 100644 index 0000000..dcdf164 --- /dev/null +++ b/0029-multipath.conf-5-update-documentation-for-max_sector.patch @@ -0,0 +1,57 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 17 Apr 2024 18:59:04 +0200 +Subject: [PATCH] multipath.conf(5): update documentation for max_sectors_kb + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/multipath.conf.5.in | 33 +++++++++++++++++++++++++++++---- + 1 file changed, 29 insertions(+), 4 deletions(-) + +diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in +index c788c180..b29a75fe 100644 +--- a/multipath/multipath.conf.5.in ++++ b/multipath/multipath.conf.5.in +@@ -1311,11 +1311,36 @@ The default is: \fB0\fR + . + .TP + .B max_sectors_kb +-Sets the max_sectors_kb device parameter on all path devices and the multipath +-device to the specified value. ++Sets the \fImax_sectors_kb\fR device parameter on some path devices and the multipath ++device to the specified value. \fImax_sectors_kb\fR is the largest I/O size, in units ++of 1024 bytes, that the kernel allows for a single I/O request. For hardware devices ++like SCSI disks, this value is limited by the capabilities of the hardware. ++It is crucial that the value of a multipath map is never higher than the minimum value of ++of all its path devices. This is ensured by the kernel when a multipath map ++is loaded, but manipulating the values of a map or either of its paths while the ++map is live can cause race conditions and I/O errors. Therefore this value is only ++enforced by multipathd when a multipath map is first created, or when a path device ++is added to a map. In both cases, race conditions are avoided by the kernel. + .RS +-.TP +-The default is: in \fB/sys/block//queue/max_sectors_kb\fR ++.PP ++Setting \fImax_sectors_kb\fR does not guarantee that all path devices will have this ++value set. It is not an error if the value of a path device is higher than that of ++the containing multipath map. It is also not an error if the actual limit of a map is ++lower than the value in \fI@CONFIGFILE@\fR. This can happen if the hardware limits of one ++or more path devices are lower than the configured value. ++.PP ++Normally the kernel and its device drivers take care of the maximum ++I/O size, and administrators do not need to bother about \fImax_sectors_kb\fR. ++But some hardware devices may report incorrect I/O size limits, or other components ++in the environment (e.g. the fabric) may impose constraints that the kernel cannot ++detect. In such cases setting \fImax_sectors_kb\fR makes sense. It should be set when ++maps are first created, and not be changed thereafter. ++If the setting \fBmust\fR be changed for a live map, set the ++value in \fI@CONFIGFILE@\fR, run \fBmultipathd reconfigure\fR, and use ++\fBmultipathd del path \fR and \fBmultipathd add path \fR to ++delete and re-add the same path device. ++.LP ++The default is: \fBundefined\fR. + .RE + . + . diff --git a/0030-multipath-tools-simplify-comment-in-hwtable.patch b/0030-multipath-tools-simplify-comment-in-hwtable.patch new file mode 100644 index 0000000..59090a7 --- /dev/null +++ b/0030-multipath-tools-simplify-comment-in-hwtable.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Xose Vazquez Perez +Date: Sun, 28 Apr 2024 01:45:35 +0200 +Subject: [PATCH] multipath-tools: simplify comment in hwtable + +Instead of adding the new 5300 model, replace them with wildcards. + +Cc: Martin Wilck +Cc: Benjamin Marzinski +Cc: Christophe Varoqui +Cc: DM-DEVEL ML +Signed-off-by: Xose Vazquez Perez +Reviewed-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + libmultipath/hwtable.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c +index 640bf347..7aac3f37 100644 +--- a/libmultipath/hwtable.c ++++ b/libmultipath/hwtable.c +@@ -683,8 +683,8 @@ static struct hwentry default_hw[] = { + .pgfailback = -FAILBACK_IMMEDIATE, + }, + { +- // Storwize V5000/V7000 lines / SAN Volume Controller (SVC) / Flex System V7000 +- // FlashSystem V840/V9000/5000/5100/5200/7200/7300/9100/9200/9200R/9500 ++ // Storwize V5000/V7000 lines / SAN Volume Controller (SVC) ++ // Flex System V7000 / FlashSystem V840/V9000 and 5x00/7x00/9x00 + .vendor = "IBM", + .product = "^2145", + .no_path_retry = NO_PATH_RETRY_QUEUE, diff --git a/0031-multipath-tools-unify-text-in-multipath.conf.5.patch b/0031-multipath-tools-unify-text-in-multipath.conf.5.patch new file mode 100644 index 0000000..b6d9af3 --- /dev/null +++ b/0031-multipath-tools-unify-text-in-multipath.conf.5.patch @@ -0,0 +1,75 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Xose Vazquez Perez +Date: Sun, 28 Apr 2024 01:45:36 +0200 +Subject: [PATCH] multipath-tools: unify text in multipath.conf.5 + +Cc: Martin Wilck +Cc: Benjamin Marzinski +Cc: Christophe Varoqui +Cc: DM-DEVEL ML +Signed-off-by: Xose Vazquez Perez +Reviewed-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + multipath/multipath.conf.5.in | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in +index b29a75fe..c1a19ebb 100644 +--- a/multipath/multipath.conf.5.in ++++ b/multipath/multipath.conf.5.in +@@ -187,7 +187,7 @@ The default is: \fBno\fR + . + .TP + .B multipath_dir +-(Deprecated) This option is not supported anymore, and the value is ignored. ++(Deprecated) This option is not supported anymore, and will be ignored. + . + . + .TP +@@ -277,7 +277,7 @@ The default is: \fBno\fR + . + .TP + .B pg_timeout +-(Deprecated) This option is not supported anymore, and the value is ignored. ++(Deprecated) This option is not supported anymore, and will be ignored. + . + . + .TP +@@ -322,7 +322,7 @@ The default is: \fBID_WWN\fR, for NVMe devices + . + .TP + .B getuid_callout +-(Deprecated) This option is not supported anymore, and the value is ignored. ++(Deprecated) This option is not supported anymore, and will be ignored. + . + . + .TP +@@ -995,7 +995,7 @@ The default is: \fB\fR + . + .TP + .B config_dir +-(Deprecated) This option is not supported anymore, and the value is ignored. ++(Deprecated) This option is not supported anymore, and will be ignored. + .RS + .TP + The compiled-in value is: \fB@CONFIGDIR@\fR +@@ -1295,7 +1295,7 @@ The default is: \fBno\fR + . + .TP + .B disable_changed_wwids +-(Deprecated) This option is not supported anymore, and the value is ignored. ++(Deprecated) This option is not supported anymore, and will be ignored. + .RE + . + . +@@ -1340,7 +1340,7 @@ value in \fI@CONFIGFILE@\fR, run \fBmultipathd reconfigure\fR, and use + \fBmultipathd del path \fR and \fBmultipathd add path \fR to + delete and re-add the same path device. + .LP +-The default is: \fBundefined\fR. ++The default is: \fB\fR + .RE + . + . diff --git a/0032-multipath-tools-update-man-pages-dates.patch b/0032-multipath-tools-update-man-pages-dates.patch new file mode 100644 index 0000000..c011eac --- /dev/null +++ b/0032-multipath-tools-update-man-pages-dates.patch @@ -0,0 +1,86 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Xose Vazquez Perez +Date: Sun, 28 Apr 2024 01:45:37 +0200 +Subject: [PATCH] multipath-tools: update man pages dates + +Cc: Martin Wilck +Cc: Benjamin Marzinski +Cc: Christophe Varoqui +Cc: DM-DEVEL ML +Signed-off-by: Xose Vazquez Perez +Reviewed-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + libmpathpersist/mpath_persistent_reserve_in.3 | 2 +- + libmpathpersist/mpath_persistent_reserve_out.3 | 2 +- + multipath/multipath.8.in | 2 +- + multipath/multipath.conf.5.in | 2 +- + multipathd/multipathd.8.in | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/libmpathpersist/mpath_persistent_reserve_in.3 b/libmpathpersist/mpath_persistent_reserve_in.3 +index 6cc35349..4ac43fa3 100644 +--- a/libmpathpersist/mpath_persistent_reserve_in.3 ++++ b/libmpathpersist/mpath_persistent_reserve_in.3 +@@ -6,7 +6,7 @@ + .\" Update the date below if you make any significant change. + .\" ---------------------------------------------------------------------------- + . +-.TH MPATH_PERSISTENT_RESERVE_IN 3 2018-06-15 Linux ++.TH MPATH_PERSISTENT_RESERVE_IN 3 2024-02-09 Linux + . + . + .\" ---------------------------------------------------------------------------- +diff --git a/libmpathpersist/mpath_persistent_reserve_out.3 b/libmpathpersist/mpath_persistent_reserve_out.3 +index 70e26028..3dbeae1f 100644 +--- a/libmpathpersist/mpath_persistent_reserve_out.3 ++++ b/libmpathpersist/mpath_persistent_reserve_out.3 +@@ -6,7 +6,7 @@ + .\" Update the date below if you make any significant change. + .\" ---------------------------------------------------------------------------- + . +-.TH MPATH_PERSISTENT_RESERVE_OUT 3 2018-06-15 Linux ++.TH MPATH_PERSISTENT_RESERVE_OUT 3 2024-02-09 Linux + . + . + .\" ---------------------------------------------------------------------------- +diff --git a/multipath/multipath.8.in b/multipath/multipath.8.in +index 348eb220..b88e9a4c 100644 +--- a/multipath/multipath.8.in ++++ b/multipath/multipath.8.in +@@ -6,7 +6,7 @@ + .\" Update the date below if you make any significant change. + .\" ---------------------------------------------------------------------------- + . +-.TH MULTIPATH 8 2021-11-12 Linux ++.TH MULTIPATH 8 2023-09-08 Linux + . + . + .\" ---------------------------------------------------------------------------- +diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in +index c1a19ebb..46d3685a 100644 +--- a/multipath/multipath.conf.5.in ++++ b/multipath/multipath.conf.5.in +@@ -6,7 +6,7 @@ + .\" Update the date below if you make any significant change. + .\" ---------------------------------------------------------------------------- + . +-.TH MULTIPATH.CONF 5 2023-06-15 Linux ++.TH MULTIPATH.CONF 5 2024-04-17 Linux + . + . + .\" ---------------------------------------------------------------------------- +diff --git a/multipathd/multipathd.8.in b/multipathd/multipathd.8.in +index f1cab3ff..12b77156 100644 +--- a/multipathd/multipathd.8.in ++++ b/multipathd/multipathd.8.in +@@ -6,7 +6,7 @@ + .\" Update the date below if you make any significant change. + .\" ---------------------------------------------------------------------------- + . +-.TH MULTIPATHD 8 2022-09-03 Linux ++.TH MULTIPATHD 8 2023-12-19 Linux + . + . + .\" ---------------------------------------------------------------------------- diff --git a/0033-libmultipath-export-partmap_in_use.patch b/0033-libmultipath-export-partmap_in_use.patch new file mode 100644 index 0000000..47a6772 --- /dev/null +++ b/0033-libmultipath-export-partmap_in_use.patch @@ -0,0 +1,53 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 25 Apr 2024 19:35:13 -0400 +Subject: [PATCH] libmultipath: export partmap_in_use + +A future commit will make use of this function + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +--- + libmultipath/devmapper.c | 2 +- + libmultipath/devmapper.h | 1 + + libmultipath/libmultipath.version | 1 + + 3 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c +index 4ce7e82f..a87abf7e 100644 +--- a/libmultipath/devmapper.c ++++ b/libmultipath/devmapper.c +@@ -1043,7 +1043,7 @@ has_partmap(const char *name __attribute__((unused)), + return 1; + } + +-static int ++int + partmap_in_use(const char *name, void *data) + { + int part_count, *ret_count = (int *)data; +diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h +index a7d66604..93caa2aa 100644 +--- a/libmultipath/devmapper.h ++++ b/libmultipath/devmapper.h +@@ -57,6 +57,7 @@ enum { + DM_FLUSH_BUSY, + }; + ++int partmap_in_use(const char *name, void *data); + int _dm_flush_map (const char *, int, int, int, int); + int dm_flush_map_nopaths(const char * mapname, int deferred_remove); + #define dm_flush_map(mapname) _dm_flush_map(mapname, 1, 0, 0, 0) +diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version +index 724786d5..e070f296 100644 +--- a/libmultipath/libmultipath.version ++++ b/libmultipath/libmultipath.version +@@ -141,6 +141,7 @@ global: + need_io_err_check; + orphan_path; + parse_prkey_flags; ++ partmap_in_use; + pathcount; + path_discovery; + path_get_tpgs; diff --git a/0034-libmultipath-change-flush_on_last_del-to-fix-a-multi.patch b/0034-libmultipath-change-flush_on_last_del-to-fix-a-multi.patch new file mode 100644 index 0000000..7c36521 --- /dev/null +++ b/0034-libmultipath-change-flush_on_last_del-to-fix-a-multi.patch @@ -0,0 +1,346 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 25 Apr 2024 19:35:14 -0400 +Subject: [PATCH] libmultipath: change flush_on_last_del to fix a multipathd + hang + +Commit 9bd3482e ("multipathd: make flush_map() delete maps like the +multipath command") fixed an issue where deleting a queueing multipath +device through multipathd could hang because the multipath device had +outstanding IO, even though the only openers of it at the time of +deletion were the kpartx partition devices. However it is still possible +to hang multipathd, because autoremoving the device when all paths have +been deleted doesn't disable queueing. To reproduce this hang: + +1. create a multipath device with a kpartx partition on top of it and +no_path_retry set to either "queue" or something long enough to run all +the commands in the reproducer before it disables queueing. +2. disable all the paths to the device with something like: + # echo offline > /sys/block//device/state +3. Write directly to the multipath device with something like: + # dd if=/dev/zero of=/dev/mapper/ bs=4K count=1 +4. delete all the paths to the device with something like: + # echo 1 > /sys/block//device/delete + +Multipathd will hang trying to delete the kpartx device because, as the +last opener, it must flush the multipath device before closing it. +Because it hangs holding the vecs_lock, multipathd will never disable +queueing on the device, so it will hang forever, even if no_path_retry +is set to a number. + +This hang can occur, even if deferred_remove is set. Since nothing has +the kpartx device opened, device-mapper does an immediate remove, which +will still hang. This means that even if deferred_remove is set, +multipathd still cannot delete a map while queueing is enabled. It must +either disable queueing or skip the autoremove. + +Mulitpath can currently be configured to avoid this hang by setting + +flush_on_last_del yes + +However there are good reasons why users wouldn't want to set that. They +may need to be able to survive having all paths getting temporarily +deleted. I should note that this is a pretty rare corner case, since +multipath automatically sets dev_loss_tmo so that it should not trigger +before queueing is disabled. + +This commit avoids the hang by changing the possible values for +flush_on_last_del to "never", "unused", and "always", and sets the +default to "unused". "always" works like "yes" did, "never" will not +disable queueing, and "unused" will only disable queueing if nothing has +the kpartx devices or the multipath device open. In order to be safe, if +the device has queue_if_no_paths set (and in case of "unused", the +device is in-use) the autoremove will be skipped. Also, instead of just +trusting the lack of "queue_if_no_paths" in the current mpp->features, +multipathd will tell the kernel to disable queueing, just to be sure it +actually is. + +I chose "unused" as the default because this should generally only cause +multipathd to work differently from the users perspective when nothing +has the multipath device open but it is queueing and there is +outstanding IO. Without this change, it would have hung instead of +failing the outstanding IO. However, I do understand that an argument +could be made that "never" makes more sense as default, even though it +will cause multipathd to skip autoremoves in cases where it wouldn't +before. The change to the behavior of deffered_remove will be +noticeable, but skipping an autoremove is much better than hanging. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +--- + libmultipath/defaults.h | 2 +- + libmultipath/dict.c | 72 +++++++++++++++++++++++++++++++---- + libmultipath/dict.h | 1 + + libmultipath/hwtable.c | 6 +-- + libmultipath/propsel.c | 4 +- + libmultipath/structs.h | 7 ++-- + multipath/multipath.conf.5.in | 20 +++++++--- + multipathd/main.c | 39 +++++++++++++++---- + 8 files changed, 122 insertions(+), 29 deletions(-) + +diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h +index 64b633f2..ed08c251 100644 +--- a/libmultipath/defaults.h ++++ b/libmultipath/defaults.h +@@ -43,7 +43,7 @@ + #define DEFAULT_PRIO PRIO_CONST + #define DEFAULT_PRIO_ARGS "" + #define DEFAULT_CHECKER TUR +-#define DEFAULT_FLUSH FLUSH_DISABLED ++#define DEFAULT_FLUSH FLUSH_UNUSED + #define DEFAULT_USER_FRIENDLY_NAMES USER_FRIENDLY_NAMES_OFF + #define DEFAULT_FORCE_SYNC 0 + #define UNSET_PARTITION_DELIM "/UNSET/" +diff --git a/libmultipath/dict.c b/libmultipath/dict.c +index 5af036b7..546103f2 100644 +--- a/libmultipath/dict.c ++++ b/libmultipath/dict.c +@@ -791,14 +791,70 @@ declare_def_snprint(checker_timeout, print_nonzero) + declare_def_handler(allow_usb_devices, set_yes_no) + declare_def_snprint(allow_usb_devices, print_yes_no) + +-declare_def_handler(flush_on_last_del, set_yes_no_undef) +-declare_def_snprint_defint(flush_on_last_del, print_yes_no_undef, DEFAULT_FLUSH) +-declare_ovr_handler(flush_on_last_del, set_yes_no_undef) +-declare_ovr_snprint(flush_on_last_del, print_yes_no_undef) +-declare_hw_handler(flush_on_last_del, set_yes_no_undef) +-declare_hw_snprint(flush_on_last_del, print_yes_no_undef) +-declare_mp_handler(flush_on_last_del, set_yes_no_undef) +-declare_mp_snprint(flush_on_last_del, print_yes_no_undef) ++ ++static const char * const flush_on_last_del_optvals[] = { ++ [FLUSH_NEVER] = "never", ++ [FLUSH_ALWAYS] = "always", ++ [FLUSH_UNUSED] = "unused", ++}; ++ ++static int ++set_flush_on_last_del(vector strvec, void *ptr, const char *file, int line_nr) ++{ ++ int i; ++ int *flush_val_ptr = (int *)ptr; ++ char *buff; ++ ++ buff = set_value(strvec); ++ if (!buff) ++ return 1; ++ ++ for (i = FLUSH_NEVER; i <= FLUSH_UNUSED; i++) { ++ if (flush_on_last_del_optvals[i] != NULL && ++ !strcmp(buff, flush_on_last_del_optvals[i])) { ++ *flush_val_ptr = i; ++ break; ++ } ++ } ++ ++ if (i > FLUSH_UNUSED) { ++ bool deprecated = true; ++ if (strcmp(buff, "no") == 0 || strcmp(buff, "0") == 0) ++ *flush_val_ptr = FLUSH_UNUSED; ++ else if (strcmp(buff, "yes") == 0 || strcmp(buff, "1") == 0) ++ *flush_val_ptr = FLUSH_ALWAYS; ++ else { ++ deprecated = false; ++ condlog(1, "%s line %d, invalid value for flush_on_last_del: \"%s\"", ++ file, line_nr, buff); ++ } ++ if (deprecated) ++ condlog(2, "%s line %d, \"%s\" is a deprecated value for flush_on_last_del and is treated as \"%s\"", ++ file, line_nr, buff, ++ flush_on_last_del_optvals[*flush_val_ptr]); ++ } ++ ++ free(buff); ++ return 0; ++} ++ ++int ++print_flush_on_last_del(struct strbuf *buff, long v) ++{ ++ if (v == FLUSH_UNDEF) ++ return 0; ++ return append_strbuf_quoted(buff, flush_on_last_del_optvals[(int)v]); ++} ++ ++declare_def_handler(flush_on_last_del, set_flush_on_last_del) ++declare_def_snprint_defint(flush_on_last_del, print_flush_on_last_del, ++ DEFAULT_FLUSH) ++declare_ovr_handler(flush_on_last_del, set_flush_on_last_del) ++declare_ovr_snprint(flush_on_last_del, print_flush_on_last_del) ++declare_hw_handler(flush_on_last_del, set_flush_on_last_del) ++declare_hw_snprint(flush_on_last_del, print_flush_on_last_del) ++declare_mp_handler(flush_on_last_del, set_flush_on_last_del) ++declare_mp_snprint(flush_on_last_del, print_flush_on_last_del) + + declare_def_handler(user_friendly_names, set_yes_no_undef) + declare_def_snprint_defint(user_friendly_names, print_yes_no_undef, +diff --git a/libmultipath/dict.h b/libmultipath/dict.h +index 7e2dfbe0..e1794537 100644 +--- a/libmultipath/dict.h ++++ b/libmultipath/dict.h +@@ -18,4 +18,5 @@ int print_undef_off_zero(struct strbuf *buff, long v); + int print_dev_loss(struct strbuf *buff, unsigned long v); + int print_off_int_undef(struct strbuf *buff, long v); + int print_auto_resize(struct strbuf *buff, long v); ++int print_flush_on_last_del(struct strbuf *buff, long v); + #endif /* _DICT_H */ +diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c +index 7aac3f37..d1148de7 100644 +--- a/libmultipath/hwtable.c ++++ b/libmultipath/hwtable.c +@@ -60,7 +60,7 @@ + .no_path_retry = NO_PATH_RETRY_UNDEF, + .minio = 1000, + .minio_rq = 1, +- .flush_on_last_del = FLUSH_DISABLED, ++ .flush_on_last_del = FLUSH_UNUSED, + .user_friendly_names = USER_FRIENDLY_NAMES_OFF, + .fast_io_fail = 5, + .dev_loss = 600, +@@ -829,7 +829,7 @@ static struct hwentry default_hw[] = { + .no_path_retry = NO_PATH_RETRY_QUEUE, + .pgpolicy = GROUP_BY_PRIO, + .pgfailback = -FAILBACK_IMMEDIATE, +- .flush_on_last_del = FLUSH_ENABLED, ++ .flush_on_last_del = FLUSH_ALWAYS, + .dev_loss = MAX_DEV_LOSS_TMO, + .prio_name = PRIO_ONTAP, + .user_friendly_names = USER_FRIENDLY_NAMES_OFF, +@@ -1160,7 +1160,7 @@ static struct hwentry default_hw[] = { + .no_path_retry = NO_PATH_RETRY_FAIL, + .minio = 1, + .minio_rq = 1, +- .flush_on_last_del = FLUSH_ENABLED, ++ .flush_on_last_del = FLUSH_ALWAYS, + .fast_io_fail = 15, + }, + /* +diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c +index 44241e2a..e2dcb316 100644 +--- a/libmultipath/propsel.c ++++ b/libmultipath/propsel.c +@@ -963,6 +963,7 @@ out: + int select_flush_on_last_del(struct config *conf, struct multipath *mp) + { + const char *origin; ++ STRBUF_ON_STACK(buff); + + mp_set_mpe(flush_on_last_del); + mp_set_ovr(flush_on_last_del); +@@ -970,8 +971,9 @@ int select_flush_on_last_del(struct config *conf, struct multipath *mp) + mp_set_conf(flush_on_last_del); + mp_set_default(flush_on_last_del, DEFAULT_FLUSH); + out: ++ print_flush_on_last_del(&buff, mp->flush_on_last_del); + condlog(3, "%s: flush_on_last_del = %s %s", mp->alias, +- (mp->flush_on_last_del == FLUSH_ENABLED)? "yes" : "no", origin); ++ get_strbuf_str(&buff), origin); + return 0; + } + +diff --git a/libmultipath/structs.h b/libmultipath/structs.h +index a25eb9d5..dbaf4d43 100644 +--- a/libmultipath/structs.h ++++ b/libmultipath/structs.h +@@ -109,9 +109,10 @@ enum marginal_pathgroups_mode { + }; + + enum flush_states { +- FLUSH_UNDEF = YNU_UNDEF, +- FLUSH_DISABLED = YNU_NO, +- FLUSH_ENABLED = YNU_YES, ++ FLUSH_UNDEF, ++ FLUSH_NEVER, ++ FLUSH_ALWAYS, ++ FLUSH_UNUSED, + }; + + enum log_checker_err_states { +diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in +index 46d3685a..1d3d53bb 100644 +--- a/multipath/multipath.conf.5.in ++++ b/multipath/multipath.conf.5.in +@@ -707,12 +707,22 @@ The default is: \fBno\fR + .TP + .B flush_on_last_del + If set to +-.I yes ++.I always + , multipathd will disable queueing when the last path to a device has been +-deleted. +-.RS +-.TP +-The default is: \fBno\fR ++deleted. If set to ++.I never ++, multipathd will not disable queueing when the last path to a device has ++been deleted. Since multipath cannot safely remove a device while queueing ++is enabled, setting this to \fInever\fR means that multipathd will not ++automatically remove an unused multipath device whose paths are all deleted if ++it is currently set to queue_if_no_path. If set to ++.I unused ++, multipathd will only disable queueing when the last path is removed if ++nothing currently has the multipath device or any of the kpartx partition ++devices on top of it open. ++.RS ++.TP ++The default is: \fBunused\fR + .RE + . + . +diff --git a/multipathd/main.c b/multipathd/main.c +index d8518a92..09286dd0 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -584,19 +584,42 @@ int update_multipath (struct vectors *vecs, char *mapname) + static bool + flush_map_nopaths(struct multipath *mpp, struct vectors *vecs) { + int r; ++ bool is_queueing = true; + ++ if (mpp->features) ++ is_queueing = strstr(mpp->features, "queue_if_no_path"); ++ ++ /* It's not safe to do a remove of a map that has "queue_if_no_path" ++ * set, since there could be outstanding IO which will cause ++ * multipathd to hang while attempting the remove */ ++ if (mpp->flush_on_last_del == FLUSH_NEVER && is_queueing) { ++ condlog(2, "%s: map is queueing, can't remove", mpp->alias); ++ return false; ++ } ++ if (mpp->flush_on_last_del == FLUSH_UNUSED && ++ partmap_in_use(mpp->alias, NULL) && is_queueing) { ++ condlog(2, "%s: map in use and queueing, can't remove", ++ mpp->alias); ++ return false; ++ } + /* +- * flush_map will fail if the device is open ++ * This will flush FLUSH_NEVER devices and FLUSH_UNUSED devices ++ * that are in use, but only if they are already marked as not ++ * queueing. That is just to make absolutely certain that they ++ * really are not queueing, like they claim. + */ +- if (mpp->flush_on_last_del == FLUSH_ENABLED) { +- condlog(2, "%s Last path deleted, disabling queueing", ++ condlog(is_queueing ? 2 : 3, "%s Last path deleted, disabling queueing", ++ mpp->alias); ++ mpp->retry_tick = 0; ++ mpp->no_path_retry = NO_PATH_RETRY_FAIL; ++ mpp->disable_queueing = 1; ++ mpp->stat_map_failures++; ++ if (dm_queue_if_no_path(mpp, 0) != 0) { ++ condlog(0, "%s: failed to disable queueing. Not removing", + mpp->alias); +- mpp->retry_tick = 0; +- mpp->no_path_retry = NO_PATH_RETRY_FAIL; +- mpp->disable_queueing = 1; +- mpp->stat_map_failures++; +- dm_queue_if_no_path(mpp, 0); ++ return false; + } ++ + r = dm_flush_map_nopaths(mpp->alias, mpp->deferred_remove); + if (r != DM_FLUSH_OK) { + if (r == DM_FLUSH_DEFERRED) { diff --git a/0035-libmultipath-remove-redundant-config-option-from-Inf.patch b/0035-libmultipath-remove-redundant-config-option-from-Inf.patch new file mode 100644 index 0000000..8de5639 --- /dev/null +++ b/0035-libmultipath-remove-redundant-config-option-from-Inf.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 25 Apr 2024 19:35:15 -0400 +Subject: [PATCH] libmultipath: remove redundant config option from InfiniBox + config + +The InfiniBox config already sets no_path_retry to "fail", so it won't +ever queue IO. That means setting flush_on_last_del to "always" is +redundant, since queueing is always disabled. Remove the +flush_on_last_del parameter, to make it easier for users to override the +default behavior if desired. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +--- + libmultipath/hwtable.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c +index d1148de7..9e008df6 100644 +--- a/libmultipath/hwtable.c ++++ b/libmultipath/hwtable.c +@@ -1160,7 +1160,6 @@ static struct hwentry default_hw[] = { + .no_path_retry = NO_PATH_RETRY_FAIL, + .minio = 1, + .minio_rq = 1, +- .flush_on_last_del = FLUSH_ALWAYS, + .fast_io_fail = 15, + }, + /* diff --git a/0036-libmultipath-pad-dev_loss_tmo-to-avoid-race-with-no_.patch b/0036-libmultipath-pad-dev_loss_tmo-to-avoid-race-with-no_.patch new file mode 100644 index 0000000..f61f658 --- /dev/null +++ b/0036-libmultipath-pad-dev_loss_tmo-to-avoid-race-with-no_.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 25 Apr 2024 19:35:16 -0400 +Subject: [PATCH] libmultipath: pad dev_loss_tmo to avoid race with + no_path_retry + +Currently multipath makes sure that dev_loss_tmo is at least as long as +the configured no path queueing time. The goal is to make sure that path +devices aren't removed while the multipath device is still queueing in +hopes that they will become usable again. + +This is racy. Multipathd may take longer to check the paths than +configured. If strict_timing isn't set, it will definitely take longer. +To account for this, pad the minimum dev_loss_tmo value by five seconds +(one default checker interval) plus one second per minute of no path +queueing time. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +--- + libmultipath/discovery.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c +index 6fd4dabb..e2052422 100644 +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -901,6 +901,11 @@ sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp) + uint64_t no_path_retry_tmo = + (uint64_t)mpp->no_path_retry * conf->checkint; + ++ /* pad no_path_retry_tmo by one standard check interval ++ * plus one second per minute to account for timing ++ * issues with the rechecks */ ++ no_path_retry_tmo += no_path_retry_tmo / 60 + DEFAULT_CHECKINT; ++ + if (no_path_retry_tmo > MAX_DEV_LOSS_TMO) + min_dev_loss = MAX_DEV_LOSS_TMO; + else diff --git a/0037-libmultipath-fix-deferred_remove-function-arguments.patch b/0037-libmultipath-fix-deferred_remove-function-arguments.patch new file mode 100644 index 0000000..507a056 --- /dev/null +++ b/0037-libmultipath-fix-deferred_remove-function-arguments.patch @@ -0,0 +1,107 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 25 Apr 2024 19:35:17 -0400 +Subject: [PATCH] libmultipath: fix deferred_remove function arguments + +Aside from one version of dm_flush_map_nopaths(), all the callers of +_dm_flush_map() and dm_simplecmd() set deferred_remove to 0. But these +functions, as well as some helper functions they called, all treated the +deferred_remove argument as an enum deferred_remove_states, and called +do_deferred() to see if the remove should be deferred. To simplify the +code, make these functions treat deferred_remove as a boolean value +signifying whether a remove is deferred, and make dm_flush_map_nopaths() +do the work of checking if the remove should be deferred. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +--- + libmultipath/devmapper.c | 19 +++++++++---------- + libmultipath/libmultipath.version | 2 +- + 2 files changed, 10 insertions(+), 11 deletions(-) + +diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c +index a87abf7e..2e7b2c64 100644 +--- a/libmultipath/devmapper.c ++++ b/libmultipath/devmapper.c +@@ -386,8 +386,6 @@ libmp_dm_task_create(int task) + return dm_task_create(task); + } + +-#define do_deferred(x) ((x) == DEFERRED_REMOVE_ON || (x) == DEFERRED_REMOVE_IN_PROGRESS) +- + static int + dm_simplecmd (int task, const char *name, int no_flush, int need_sync, + uint16_t udev_flags, int deferred_remove __DR_UNUSED__) { +@@ -411,7 +409,7 @@ dm_simplecmd (int task, const char *name, int no_flush, int need_sync, + dm_task_no_flush(dmt); /* for DM_DEVICE_SUSPEND/RESUME */ + #endif + #ifdef LIBDM_API_DEFERRED +- if (do_deferred(deferred_remove)) ++ if (deferred_remove) + dm_task_deferred_remove(dmt); + #endif + if (udev_wait_flag && +@@ -1082,7 +1080,7 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, + + /* If you aren't doing a deferred remove, make sure that no + * devices are in use */ +- if (!do_deferred(deferred_remove) && partmap_in_use(mapname, NULL)) ++ if (!deferred_remove && partmap_in_use(mapname, NULL)) + return DM_FLUSH_BUSY; + + if (need_suspend && +@@ -1100,7 +1098,7 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, + if ((r = dm_remove_partmaps(mapname, need_sync, deferred_remove))) + return r; + +- if (!do_deferred(deferred_remove) && dm_get_opencount(mapname)) { ++ if (!deferred_remove && dm_get_opencount(mapname)) { + condlog(2, "%s: map in use", mapname); + return DM_FLUSH_BUSY; + } +@@ -1112,8 +1110,7 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, + r = dm_device_remove(mapname, need_sync, deferred_remove); + + if (r) { +- if (do_deferred(deferred_remove) +- && dm_map_present(mapname)) { ++ if (deferred_remove && dm_map_present(mapname)) { + condlog(4, "multipath map %s remove deferred", + mapname); + return DM_FLUSH_DEFERRED; +@@ -1147,7 +1144,10 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, + int + dm_flush_map_nopaths(const char * mapname, int deferred_remove) + { +- return _dm_flush_map(mapname, 1, deferred_remove, 0, 0); ++ return _dm_flush_map(mapname, 1, ++ (deferred_remove == DEFERRED_REMOVE_ON || ++ deferred_remove == DEFERRED_REMOVE_IN_PROGRESS), ++ 0, 0); + } + + #else +@@ -1539,8 +1539,7 @@ remove_partmap(const char *name, void *data) + + if (dm_get_opencount(name)) { + dm_remove_partmaps(name, rd->need_sync, rd->deferred_remove); +- if (!do_deferred(rd->deferred_remove) && +- dm_get_opencount(name)) { ++ if (rd->deferred_remove && dm_get_opencount(name)) { + condlog(2, "%s: map in use", name); + return DM_FLUSH_BUSY; + } +diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version +index e070f296..eb511749 100644 +--- a/libmultipath/libmultipath.version ++++ b/libmultipath/libmultipath.version +@@ -43,7 +43,7 @@ LIBMPATHCOMMON_1.0.0 { + put_multipath_config; + }; + +-LIBMULTIPATH_23.0.0 { ++LIBMULTIPATH_24.0.0 { + global: + /* symbols referenced by multipath and multipathd */ + add_foreign; diff --git a/0038-libmultipath-use-bitwise-flags-for-map-flushing-API.patch b/0038-libmultipath-use-bitwise-flags-for-map-flushing-API.patch new file mode 100644 index 0000000..ef922ec --- /dev/null +++ b/0038-libmultipath-use-bitwise-flags-for-map-flushing-API.patch @@ -0,0 +1,212 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 2 May 2024 18:38:24 +0200 +Subject: [PATCH] libmultipath: use bitwise flags for map flushing API + +Rather than passing 3 separate bool variables to _dm_flush_map(), +define bitwise flags to modify the function's behavior, and pass +these flags to called functions accordingly. + +This improves the readability of the code, function calls are +more expressive. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmultipath/devmapper.c | 68 +++++++++++++++++----------------------- + libmultipath/devmapper.h | 18 ++++++++--- + 2 files changed, 41 insertions(+), 45 deletions(-) + +diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c +index 2e7b2c64..a6a9c2b7 100644 +--- a/libmultipath/devmapper.c ++++ b/libmultipath/devmapper.c +@@ -53,9 +53,8 @@ static int dm_cancel_remove_partmaps(const char * mapname); + #define __DR_UNUSED__ __attribute__((unused)) + #endif + +-static int dm_remove_partmaps (const char * mapname, int need_sync, +- int deferred_remove); +-static int do_foreach_partmaps(const char * mapname, ++static int dm_remove_partmaps (const char *mapname, int flags); ++static int do_foreach_partmaps(const char *mapname, + int (*partmap_func)(const char *, void *), + void *data); + static int _dm_queue_if_no_path(const char *mapname, int enable); +@@ -439,9 +438,9 @@ int dm_simplecmd_noflush (int task, const char *name, uint16_t udev_flags) + } + + static int +-dm_device_remove (const char *name, int needsync, int deferred_remove) { +- return dm_simplecmd(DM_DEVICE_REMOVE, name, 0, needsync, 0, +- deferred_remove); ++dm_device_remove (const char *name, int flags) { ++ return dm_simplecmd(DM_DEVICE_REMOVE, name, 0, flags & DMFL_NEED_SYNC, 0, ++ flags & DMFL_DEFERRED); + } + + static int +@@ -1061,8 +1060,7 @@ partmap_in_use(const char *name, void *data) + return 0; + } + +-int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, +- int need_suspend, int retries) ++int _dm_flush_map (const char *mapname, int flags, int retries) + { + int r; + int queue_if_no_path = 0; +@@ -1080,10 +1078,10 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, + + /* If you aren't doing a deferred remove, make sure that no + * devices are in use */ +- if (!deferred_remove && partmap_in_use(mapname, NULL)) ++ if (!(flags & DMFL_DEFERRED) && partmap_in_use(mapname, NULL)) + return DM_FLUSH_BUSY; + +- if (need_suspend && ++ if ((flags & DMFL_SUSPEND) && + dm_get_map(mapname, &mapsize, ¶ms) == DMP_OK && + strstr(params, "queue_if_no_path")) { + if (!_dm_queue_if_no_path(mapname, 0)) +@@ -1095,22 +1093,22 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, + free(params); + params = NULL; + +- if ((r = dm_remove_partmaps(mapname, need_sync, deferred_remove))) ++ if ((r = dm_remove_partmaps(mapname, flags))) + return r; + +- if (!deferred_remove && dm_get_opencount(mapname)) { ++ if (!(flags & DMFL_DEFERRED) && dm_get_opencount(mapname)) { + condlog(2, "%s: map in use", mapname); + return DM_FLUSH_BUSY; + } + + do { +- if (need_suspend && queue_if_no_path != -1) ++ if ((flags & DMFL_SUSPEND) && queue_if_no_path != -1) + dm_simplecmd_flush(DM_DEVICE_SUSPEND, mapname, 0); + +- r = dm_device_remove(mapname, need_sync, deferred_remove); ++ r = dm_device_remove(mapname, flags); + + if (r) { +- if (deferred_remove && dm_map_present(mapname)) { ++ if ((flags & DMFL_DEFERRED) && dm_map_present(mapname)) { + condlog(4, "multipath map %s remove deferred", + mapname); + return DM_FLUSH_DEFERRED; +@@ -1124,7 +1122,7 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, + } else { + condlog(2, "failed to remove multipath map %s", + mapname); +- if (need_suspend && queue_if_no_path != -1) { ++ if ((flags & DMFL_SUSPEND) && queue_if_no_path != -1) { + dm_simplecmd_noflush(DM_DEVICE_RESUME, + mapname, udev_flags); + } +@@ -1139,27 +1137,18 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, + return DM_FLUSH_FAIL; + } + +-#ifdef LIBDM_API_DEFERRED +- + int +-dm_flush_map_nopaths(const char * mapname, int deferred_remove) ++dm_flush_map_nopaths(const char *mapname, int deferred_remove __DR_UNUSED__) + { +- return _dm_flush_map(mapname, 1, +- (deferred_remove == DEFERRED_REMOVE_ON || +- deferred_remove == DEFERRED_REMOVE_IN_PROGRESS), +- 0, 0); +-} +- +-#else +- +-int +-dm_flush_map_nopaths(const char * mapname, +- int deferred_remove __attribute__((unused))) +-{ +- return _dm_flush_map(mapname, 1, 0, 0, 0); +-} ++ int flags = DMFL_NEED_SYNC; + ++#ifdef LIBDM_API_DEFERRED ++ flags |= ((deferred_remove == DEFERRED_REMOVE_ON || ++ deferred_remove == DEFERRED_REMOVE_IN_PROGRESS) ? ++ DMFL_DEFERRED : 0); + #endif ++ return _dm_flush_map(mapname, flags, 0); ++} + + int dm_flush_maps (int retries) + { +@@ -1528,8 +1517,7 @@ out: + } + + struct remove_data { +- int need_sync; +- int deferred_remove; ++ int flags; + }; + + static int +@@ -1538,21 +1526,21 @@ remove_partmap(const char *name, void *data) + struct remove_data *rd = (struct remove_data *)data; + + if (dm_get_opencount(name)) { +- dm_remove_partmaps(name, rd->need_sync, rd->deferred_remove); +- if (rd->deferred_remove && dm_get_opencount(name)) { ++ dm_remove_partmaps(name, rd->flags); ++ if ((rd->flags & DMFL_DEFERRED) && dm_get_opencount(name)) { + condlog(2, "%s: map in use", name); + return DM_FLUSH_BUSY; + } + } + condlog(4, "partition map %s removed", name); +- dm_device_remove(name, rd->need_sync, rd->deferred_remove); ++ dm_device_remove(name, rd->flags); + return DM_FLUSH_OK; + } + + static int +-dm_remove_partmaps (const char * mapname, int need_sync, int deferred_remove) ++dm_remove_partmaps (const char * mapname, int flags) + { +- struct remove_data rd = { need_sync, deferred_remove }; ++ struct remove_data rd = { flags }; + return do_foreach_partmaps(mapname, remove_partmap, &rd); + } + +diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h +index 93caa2aa..bb4a55a6 100644 +--- a/libmultipath/devmapper.h ++++ b/libmultipath/devmapper.h +@@ -58,12 +58,20 @@ enum { + }; + + int partmap_in_use(const char *name, void *data); +-int _dm_flush_map (const char *, int, int, int, int); +-int dm_flush_map_nopaths(const char * mapname, int deferred_remove); +-#define dm_flush_map(mapname) _dm_flush_map(mapname, 1, 0, 0, 0) +-#define dm_flush_map_nosync(mapname) _dm_flush_map(mapname, 0, 0, 0, 0) ++ ++enum { ++ DMFL_NONE = 0, ++ DMFL_NEED_SYNC = 1 << 0, ++ DMFL_DEFERRED = 1 << 1, ++ DMFL_SUSPEND = 1 << 2, ++}; ++ ++int _dm_flush_map (const char *mapname, int flags, int retries); ++#define dm_flush_map(mapname) _dm_flush_map(mapname, DMFL_NEED_SYNC, 0) ++#define dm_flush_map_nosync(mapname) _dm_flush_map(mapname, DMFL_NONE, 0) + #define dm_suspend_and_flush_map(mapname, retries) \ +- _dm_flush_map(mapname, 1, 0, 1, retries) ++ _dm_flush_map(mapname, DMFL_NEED_SYNC|DMFL_SUSPEND, retries) ++int dm_flush_map_nopaths(const char * mapname, int deferred_remove); + int dm_cancel_deferred_remove(struct multipath *mpp); + int dm_flush_maps (int retries); + int dm_fail_path(const char * mapname, char * path); diff --git a/0039-libmultipath-use-bitwise-flags-for-dm_simplecmd-API.patch b/0039-libmultipath-use-bitwise-flags-for-dm_simplecmd-API.patch new file mode 100644 index 0000000..1aee878 --- /dev/null +++ b/0039-libmultipath-use-bitwise-flags-for-dm_simplecmd-API.patch @@ -0,0 +1,117 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 2 May 2024 18:45:17 +0200 +Subject: [PATCH] libmultipath: use bitwise flags for dm_simplecmd API + +Also use bitwise flags for dm_simplecmd() and its relatives. Again, +this makes the code more expressive and more readable, while +simplifying the function calls. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmultipath/devmapper.c | 26 +++++++++++++------------- + libmultipath/devmapper.h | 5 +++-- + 2 files changed, 16 insertions(+), 15 deletions(-) + +diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c +index a6a9c2b7..08bb3c51 100644 +--- a/libmultipath/devmapper.c ++++ b/libmultipath/devmapper.c +@@ -386,10 +386,9 @@ libmp_dm_task_create(int task) + } + + static int +-dm_simplecmd (int task, const char *name, int no_flush, int need_sync, +- uint16_t udev_flags, int deferred_remove __DR_UNUSED__) { ++dm_simplecmd (int task, const char *name, int flags, uint16_t udev_flags) { + int r = 0; +- int udev_wait_flag = ((need_sync || udev_flags) && ++ int udev_wait_flag = (((flags & DMFL_NEED_SYNC) || udev_flags) && + (task == DM_DEVICE_RESUME || + task == DM_DEVICE_REMOVE)); + uint32_t cookie = 0; +@@ -404,11 +403,11 @@ dm_simplecmd (int task, const char *name, int no_flush, int need_sync, + dm_task_no_open_count(dmt); + dm_task_skip_lockfs(dmt); /* for DM_DEVICE_RESUME */ + #ifdef LIBDM_API_FLUSH +- if (no_flush) ++ if (flags & DMFL_NO_FLUSH) + dm_task_no_flush(dmt); /* for DM_DEVICE_SUSPEND/RESUME */ + #endif + #ifdef LIBDM_API_DEFERRED +- if (deferred_remove) ++ if (flags & DMFL_DEFERRED) + dm_task_deferred_remove(dmt); + #endif + if (udev_wait_flag && +@@ -429,18 +428,17 @@ out: + + int dm_simplecmd_flush (int task, const char *name, uint16_t udev_flags) + { +- return dm_simplecmd(task, name, 0, 1, udev_flags, 0); ++ return dm_simplecmd(task, name, DMFL_NEED_SYNC, udev_flags); + } + + int dm_simplecmd_noflush (int task, const char *name, uint16_t udev_flags) + { +- return dm_simplecmd(task, name, 1, 1, udev_flags, 0); ++ return dm_simplecmd(task, name, DMFL_NO_FLUSH|DMFL_NEED_SYNC, udev_flags); + } + + static int + dm_device_remove (const char *name, int flags) { +- return dm_simplecmd(DM_DEVICE_REMOVE, name, 0, flags & DMFL_NEED_SYNC, 0, +- flags & DMFL_DEFERRED); ++ return dm_simplecmd(DM_DEVICE_REMOVE, name, flags, 0); + } + + static int +@@ -594,8 +592,9 @@ int dm_addmap_reload(struct multipath *mpp, char *params, int flush) + params, ADDMAP_RO, 0); + } + if (r) +- r = dm_simplecmd(DM_DEVICE_RESUME, mpp->alias, !flush, +- 1, udev_flags, 0); ++ r = dm_simplecmd(DM_DEVICE_RESUME, mpp->alias, ++ DMFL_NEED_SYNC | (flush ? 0 : DMFL_NO_FLUSH), ++ udev_flags); + if (r) + return r; + +@@ -603,8 +602,9 @@ int dm_addmap_reload(struct multipath *mpp, char *params, int flush) + * drop the new table, so doing a second resume will try using + * the original table */ + if (dm_is_suspended(mpp->alias)) +- dm_simplecmd(DM_DEVICE_RESUME, mpp->alias, !flush, 1, +- udev_flags, 0); ++ dm_simplecmd(DM_DEVICE_RESUME, mpp->alias, ++ DMFL_NEED_SYNC | (flush ? 0 : DMFL_NO_FLUSH), ++ udev_flags); + return 0; + } + +diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h +index bb4a55a6..a242381e 100644 +--- a/libmultipath/devmapper.h ++++ b/libmultipath/devmapper.h +@@ -38,8 +38,8 @@ void skip_libmp_dm_init(void); + void libmp_dm_exit(void); + void libmp_udev_set_sync_support(int on); + struct dm_task *libmp_dm_task_create(int task); +-int dm_simplecmd_flush (int, const char *, uint16_t); +-int dm_simplecmd_noflush (int, const char *, uint16_t); ++int dm_simplecmd_flush (int task, const char *name, uint16_t udev_flags); ++int dm_simplecmd_noflush (int task, const char *name, uint16_t udev_flags); + int dm_addmap_create (struct multipath *mpp, char *params); + int dm_addmap_reload (struct multipath *mpp, char *params, int flush); + int dm_map_present (const char *); +@@ -64,6 +64,7 @@ enum { + DMFL_NEED_SYNC = 1 << 0, + DMFL_DEFERRED = 1 << 1, + DMFL_SUSPEND = 1 << 2, ++ DMFL_NO_FLUSH = 1 << 3, + }; + + int _dm_flush_map (const char *mapname, int flags, int retries); diff --git a/0040-libmultipath-add-argument-names-to-some-prototypes.patch b/0040-libmultipath-add-argument-names-to-some-prototypes.patch new file mode 100644 index 0000000..3244d55 --- /dev/null +++ b/0040-libmultipath-add-argument-names-to-some-prototypes.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 2 May 2024 18:46:42 +0200 +Subject: [PATCH] libmultipath: add argument names to some prototypes + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmultipath/devmapper.h | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h +index a242381e..19b79c5b 100644 +--- a/libmultipath/devmapper.h ++++ b/libmultipath/devmapper.h +@@ -42,12 +42,12 @@ int dm_simplecmd_flush (int task, const char *name, uint16_t udev_flags); + int dm_simplecmd_noflush (int task, const char *name, uint16_t udev_flags); + int dm_addmap_create (struct multipath *mpp, char *params); + int dm_addmap_reload (struct multipath *mpp, char *params, int flush); +-int dm_map_present (const char *); ++int dm_map_present (const char *name); + int dm_map_present_by_uuid(const char *uuid); +-int dm_get_map(const char *, unsigned long long *, char **); +-int dm_get_status(const char *, char **); +-int dm_type(const char *, char *); +-int dm_is_mpath(const char *); ++int dm_get_map(const char *name, unsigned long long *size, char **outparams); ++int dm_get_status(const char *name, char **outstatus); ++int dm_type(const char *name, char *type); ++int dm_is_mpath(const char *name); + + enum { + DM_FLUSH_OK = 0, diff --git a/0041-libmultipath-bump-version-to-0.9.9.patch b/0041-libmultipath-bump-version-to-0.9.9.patch new file mode 100644 index 0000000..890b047 --- /dev/null +++ b/0041-libmultipath-bump-version-to-0.9.9.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 3 May 2024 22:09:10 +0200 +Subject: [PATCH] libmultipath: bump version to 0.9.9 + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + libmultipath/version.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libmultipath/version.h b/libmultipath/version.h +index e102975f..271d8e74 100644 +--- a/libmultipath/version.h ++++ b/libmultipath/version.h +@@ -20,9 +20,9 @@ + #ifndef _VERSION_H + #define _VERSION_H + +-#define VERSION_CODE 0x000908 ++#define VERSION_CODE 0x000909 + /* MMDDYY, in hex */ +-#define DATE_CODE 0x020F18 ++#define DATE_CODE 0x050318 + + #define PROG "multipath-tools" + diff --git a/0042-GitHub-Workflows-native.yaml-run-for-Fedora-40.patch b/0042-GitHub-Workflows-native.yaml-run-for-Fedora-40.patch new file mode 100644 index 0000000..47c3949 --- /dev/null +++ b/0042-GitHub-Workflows-native.yaml-run-for-Fedora-40.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 3 May 2024 22:28:34 +0200 +Subject: [PATCH] GitHub Workflows: native.yaml: run for Fedora 40 + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/workflows/native.yaml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml +index 0ef9df94..a062845e 100644 +--- a/.github/workflows/native.yaml ++++ b/.github/workflows/native.yaml +@@ -33,7 +33,7 @@ jobs: + - debian-buster + - debian-bullseye + - debian-bookworm +- - fedora-39 ++ - fedora-40 + - opensuse-leap + container: ghcr.io/mwilck/multipath-build-${{ matrix.os }} + steps: diff --git a/0043-update-NEWS.md.patch b/0043-update-NEWS.md.patch new file mode 100644 index 0000000..4edc69d --- /dev/null +++ b/0043-update-NEWS.md.patch @@ -0,0 +1,134 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 3 May 2024 23:11:48 +0200 +Subject: [PATCH] update NEWS.md + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/actions/spelling/expect.txt | 3 ++ + .github/actions/spelling/patterns.txt | 3 +- + NEWS.md | 62 +++++++++++++++++++++++++++ + 3 files changed, 67 insertions(+), 1 deletion(-) + +diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt +index fc9f22f8..bdfce83a 100644 +--- a/.github/actions/spelling/expect.txt ++++ b/.github/actions/spelling/expect.txt +@@ -17,6 +17,7 @@ blkid + bmarzins + cciss + CFLAGS ++cgroups + christophe + clangd + clariion +@@ -67,6 +68,7 @@ fulldescr + gcc + getprkey + getprstatus ++getrlimit + getuid + github + GPT +@@ -170,6 +172,7 @@ rootprefixdir + rpmbuild + rport + rtpi ++rtprio + sas + sbp + scsi +diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt +index 858faee6..aa361654 100644 +--- a/.github/actions/spelling/patterns.txt ++++ b/.github/actions/spelling/patterns.txt +@@ -22,7 +22,7 @@ + \bdmmp_pgs\b + \bdmmp_mpath_kdev_name_get\b + \bfast_io_fail_tmo\b +-\bLimitRTPRIO\b ++\bLimitRTPRIO=?\b + \bmax_fds\b + \bmissing_uev_wait_timeout\b + \bMPATH_MAX_PARAM_LEN\b +@@ -87,6 +87,7 @@ + \bprin_resvdescr\b + \bprout_param_descriptor\b + \brq_servact\b ++\bRLIMIT_RTPRIO\b + \bSCHED_RT_PRIO\b + \bssize_t\b + \btrnptid_list\b +diff --git a/NEWS.md b/NEWS.md +index 0b094b98..4c54afa0 100644 +--- a/NEWS.md ++++ b/NEWS.md +@@ -1,5 +1,67 @@ + # multipath-tools Release Notes + ++## multipath-tools 0.9.9, 2024/05 ++ ++### User-Visible Changes ++ ++* *Changed realtime scheduling:* multipathd used to run at the highest possible ++ realtime priority, 99. This has always been excessive, and on some ++ distributions (e.g. RHEL 8), it hasn't worked at all. It is now possible to ++ set multipathd's real time scheduling by setting the hard limit for ++ `RLIMIT_RTPRIO` (see getrlimit(2)), which corresponds to the `rtprio` ++ setting in limits.conf and to `LimitRTPRIO=` in the systemd unit file. The ++ default in the systemd unit file has been set to 10. If the limit is set to ++ 0, multipathd doesn't attempt to enable real-time scheduling. ++ Otherwise, it will try to set the scheduling priority to the given value. ++ Fixes [#82](https://github.com/opensvc/multipath-tools/issues/82). ++* *Changed normal scheduling:* In order to make sure that multipathd has ++ sufficient priority even if real time scheduling is switched off, the ++ `CPUWeight=` setting in the unit file is set to 1000. This is necessary ++ because regular nice(2) values have no effect in systems with cgroups enabled. ++* *Changed handling of `max_sectors_kb` configuration:* multipathd applies ++ the `max_sectors_kb` setting only during map creation, or when a new path is ++ added to an existing map. The kernel makes sure that the multipath device ++ never has a larger `max_sectors_kb` value than any of its configured path ++ devices. The reason for this change is that applying `max_sectors_kb` on ++ live maps can cause IO errors and data loss in rare situations. ++ It can now happen that some path devices have a higher `max_sectors_kb` ++ value than the map; this is not an error. It is not possible any more to ++ decrease `max_sectors_kb` in `multipath.conf` and run `multipathd ++ reconfigure` to "apply" this setting to the map and its paths. If decreasing ++ the IO size is necessary, either destroy and recreate the map, or remove one ++ path with `multipathd del path $PATH`, run `multipathd reconfigure`, and ++ re-add the path with `multipathd add path $PATH`. ++* *New wildcard %k:* The wildcard `%k` for `max_sectors_kb` has been added to ++ the `multipathd show paths format` and `multipathd show maps format` ++ commands. ++* *Changed semantics of flush_on_last_del:* The `flush_on_last_del` option ++ now takes the values `always` , `unused`, or `never`. `yes` and `no` ++ are still accepted as aliases for `always` and `unused`, respectively. ++ `always` means that when all paths for a multipath map have been removed, ++ *outstanding IO will be failed* and the map will be deleted. `unused` means ++ that this will only happen when the map is not mounted or otherwise opened. ++ `never` means the map will only be removed if the `queue_if_no_path` ++ feature is off. ++ This fixes a problem where multipathd could hang when the last path of ++ a queueing map was deleted. ++ ++### Other major changes ++ ++* Adapted the dm-mpath udev rules such that they will work with the modified ++ device mapper udev rules (`DM_UDEV_RULES_VSN==3`, lvm2 > 2.03.22). They are ++ still compatible with older versions of the device-mapper udev rules. ++ ++### Bug fixes ++ ++* Fixed misspelled DM_UDEV_DISABLE_OTHER_RULES_FLAG in 11-dm-mpath.rules ++* Always use `glibc_basename()` to avoid some issues with MUSL libc. ++ Fixes [#84](https://github.com/opensvc/multipath-tools/pull/84). ++ ++### Other ++ ++* Build: added `TGTDIR` option to simplify building for a different target ++ host (see README.md). ++ + ## multipath-tools 0.9.8, 2024/02 + + ### User-Visible Changes diff --git a/0044-multipath.conf.5.in-fix-man-page-date.patch b/0044-multipath.conf.5.in-fix-man-page-date.patch new file mode 100644 index 0000000..c9f2d5d --- /dev/null +++ b/0044-multipath.conf.5.in-fix-man-page-date.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 3 May 2024 23:22:50 +0200 +Subject: [PATCH] multipath.conf.5.in: fix man page date + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + multipath/multipath.conf.5.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in +index 1d3d53bb..dacb9b0e 100644 +--- a/multipath/multipath.conf.5.in ++++ b/multipath/multipath.conf.5.in +@@ -6,7 +6,7 @@ + .\" Update the date below if you make any significant change. + .\" ---------------------------------------------------------------------------- + . +-.TH MULTIPATH.CONF 5 2024-04-17 Linux ++.TH MULTIPATH.CONF 5 2024-04-25 Linux + . + . + .\" ---------------------------------------------------------------------------- diff --git a/0001-RH-fixup-udev-rules-for-redhat.patch b/0045-RH-fixup-udev-rules-for-redhat.patch similarity index 86% rename from 0001-RH-fixup-udev-rules-for-redhat.patch rename to 0045-RH-fixup-udev-rules-for-redhat.patch index 02efadd..d78919e 100644 --- a/0001-RH-fixup-udev-rules-for-redhat.patch +++ b/0045-RH-fixup-udev-rules-for-redhat.patch @@ -15,7 +15,7 @@ Signed-off-by: Benjamin Marzinski 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.inc b/Makefile.inc -index 6b454303..0b0e3ad2 100644 +index 81b86cd8..33dbb99c 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -34,7 +34,7 @@ endif @@ -26,9 +26,9 @@ 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) + # Prefix for configuration files (multipath.conf) diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules -index 1969dee0..d2b28233 100644 +index 8dd3369c..7c3c7524 100644 --- a/kpartx/kpartx.rules +++ b/kpartx/kpartx.rules @@ -39,6 +39,6 @@ LABEL="mpath_kpartx_end" @@ -40,20 +40,20 @@ index 1969dee0..d2b28233 100644 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 diff --git a/0002-RH-Remove-the-property-blacklist-exception-builtin.patch b/0046-RH-Remove-the-property-blacklist-exception-builtin.patch similarity index 96% rename from 0002-RH-Remove-the-property-blacklist-exception-builtin.patch rename to 0046-RH-Remove-the-property-blacklist-exception-builtin.patch index bc259d4..b039539 100644 --- a/0002-RH-Remove-the-property-blacklist-exception-builtin.patch +++ b/0046-RH-Remove-the-property-blacklist-exception-builtin.patch @@ -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 dacb9b0e..645e8f88 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 +@@ -1468,9 +1468,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 +@@ -1481,10 +1486,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. diff --git a/0003-RH-don-t-start-without-a-config-file.patch b/0047-RH-don-t-start-without-a-config-file.patch similarity index 92% rename from 0003-RH-don-t-start-without-a-config-file.patch rename to 0047-RH-don-t-start-without-a-config-file.patch index fa304dc..ad7962a 100644 --- a/0003-RH-don-t-start-without-a-config-file.patch +++ b/0047-RH-don-t-start-without-a-config-file.patch @@ -22,10 +22,10 @@ Signed-off-by: Benjamin Marzinski 7 files changed, 25 insertions(+) diff --git a/libmultipath/config.c b/libmultipath/config.c -index b7dbc6f5..3a374b3d 100644 +index 83fa7369..002027a7 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c -@@ -958,6 +958,19 @@ int _init_config (const char *file, struct config *conf) +@@ -959,6 +959,19 @@ int _init_config (const char *file, struct config *conf) } factorize_hwtable(conf->hwtable, builtin_hwtable_size, file); validate_pctable(conf->overrides, 0, file); @@ -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 ce702e7f..c21e3e0b 100644 --- a/multipath/main.c +++ b/multipath/main.c -@@ -829,11 +829,14 @@ main (int argc, char *argv[]) +@@ -842,11 +842,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[]) +@@ -1097,6 +1100,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 780bf852..2c518378 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 12b77156..499557a0 100644 --- a/multipathd/multipathd.8.in +++ b/multipathd/multipathd.8.in @@ -49,6 +49,8 @@ map regains its maximum performance and redundancy. @@ -112,7 +112,7 @@ index e98c27fd..fd2061e5 100644 . .\" ---------------------------------------------------------------------------- diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in -index 6d03ff71..0965d6f9 100644 +index a63ddd9a..01ceff7d 100644 --- a/multipathd/multipathd.service.in +++ b/multipathd/multipathd.service.in @@ -6,6 +6,7 @@ Wants=systemd-udevd-kernel.socket @MODPROBE_UNIT@ @@ -124,7 +124,7 @@ index 6d03ff71..0965d6f9 100644 Conflicts=shutdown.target Conflicts=initrd-cleanup.service diff --git a/multipathd/multipathd.socket b/multipathd/multipathd.socket -index c777e5e3..3c20a2ff 100644 +index 6a62f5fd..263b6b0c 100644 --- a/multipathd/multipathd.socket +++ b/multipathd/multipathd.socket @@ -1,6 +1,7 @@ diff --git a/0004-RH-Fix-nvme-function-missing-argument.patch b/0048-RH-Fix-nvme-function-missing-argument.patch similarity index 100% rename from 0004-RH-Fix-nvme-function-missing-argument.patch rename to 0048-RH-Fix-nvme-function-missing-argument.patch diff --git a/0005-RH-use-rpm-optflags-if-present.patch b/0049-RH-use-rpm-optflags-if-present.patch similarity index 87% rename from 0005-RH-use-rpm-optflags-if-present.patch rename to 0049-RH-use-rpm-optflags-if-present.patch index 6352c23..0f354e7 100644 --- a/0005-RH-use-rpm-optflags-if-present.patch +++ b/0049-RH-use-rpm-optflags-if-present.patch @@ -13,7 +13,7 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Makefile.inc b/Makefile.inc -index 0b0e3ad2..3d80d224 100644 +index 33dbb99c..94e0ec85 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -95,11 +95,23 @@ SYSTEMD_LIBDEPS := $(if $(SYSTEMD),$(if $(shell test $(SYSTEMD) -gt 209 && echo @@ -41,10 +41,10 @@ index 0b0e3ad2..3d80d224 100644 -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)\" \ +@@ -109,7 +121,7 @@ CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe BIN_CFLAGS := -fPIE -DPIE LIB_CFLAGS := -fPIC SHARED_FLAGS := -shared diff --git a/0006-RH-add-mpathconf.patch b/0050-RH-add-mpathconf.patch similarity index 98% rename from 0006-RH-add-mpathconf.patch rename to 0050-RH-add-mpathconf.patch index fd47a6c..fd65e34 100644 --- a/0006-RH-add-mpathconf.patch +++ b/0050-RH-add-mpathconf.patch @@ -22,10 +22,10 @@ Signed-off-by: Benjamin Marzinski create mode 100644 multipath/mpathconf.8 diff --git a/libmultipath/config.c b/libmultipath/config.c -index 3a374b3d..4544f484 100644 +index 002027a7..3d5943d3 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c -@@ -960,6 +960,8 @@ int _init_config (const char *file, struct config *conf) +@@ -961,6 +961,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 +35,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 +45,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 +54,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 diff --git a/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch b/0051-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch similarity index 96% rename from 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch rename to 0051-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch index a3c4e9d..9884258 100644 --- a/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +++ b/0051-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch @@ -20,7 +20,7 @@ Signed-off-by: Benjamin Marzinski 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/multipath/main.c b/multipath/main.c -index 46944589..47f89a0a 100644 +index c21e3e0b..3f3ac9fb 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -120,7 +120,7 @@ usage (char * progname) @@ -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[]) +@@ -861,7 +907,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[]) +@@ -932,6 +978,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,7 +138,7 @@ 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 01ceff7d..e0c2011b 100644 --- a/multipathd/multipathd.service.in +++ b/multipathd/multipathd.service.in @@ -17,6 +17,7 @@ ConditionVirtualization=!container diff --git a/0008-RH-reset-default-find_mutipaths-value-to-off.patch b/0052-RH-reset-default-find_mutipaths-value-to-off.patch similarity index 91% rename from 0008-RH-reset-default-find_mutipaths-value-to-off.patch rename to 0052-RH-reset-default-find_mutipaths-value-to-off.patch index cf7317e..04ad52c 100644 --- a/0008-RH-reset-default-find_mutipaths-value-to-off.patch +++ b/0052-RH-reset-default-find_mutipaths-value-to-off.patch @@ -14,7 +14,7 @@ Signed-off-by: Benjamin Marzinski 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h -index 64b633f2..5bda9f93 100644 +index ed08c251..4b033ff9 100644 --- a/libmultipath/defaults.h +++ b/libmultipath/defaults.h @@ -23,7 +23,7 @@ @@ -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 645e8f88..a7543939 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. +@@ -1225,7 +1225,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 diff --git a/0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch b/0053-RH-attempt-to-get-ANA-info-via-sysfs-first.patch similarity index 100% rename from 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch rename to 0053-RH-attempt-to-get-ANA-info-via-sysfs-first.patch diff --git a/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch b/0054-RH-make-parse_vpd_pg83-match-scsi_id-output.patch similarity index 84% rename from 0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch rename to 0054-RH-make-parse_vpd_pg83-match-scsi_id-output.patch index aa49d69..c090da0 100644 --- a/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch +++ b/0054-RH-make-parse_vpd_pg83-match-scsi_id-output.patch @@ -14,10 +14,10 @@ Signed-off-by: Benjamin Marzinski 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c -index 6fd4dabb..19692b1e 100644 +index e2052422..3bcd94ce 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c -@@ -1216,13 +1216,9 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, +@@ -1221,13 +1221,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, +@@ -1245,10 +1241,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), diff --git a/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch b/0055-RH-add-scsi-device-handlers-to-modules-load.d.patch similarity index 96% rename from 0011-RH-add-scsi-device-handlers-to-modules-load.d.patch rename to 0055-RH-add-scsi-device-handlers-to-modules-load.d.patch index 0059895..7624c5b 100644 --- a/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch +++ b/0055-RH-add-scsi-device-handlers-to-modules-load.d.patch @@ -11,7 +11,7 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc -index 3d80d224..15e3bd3a 100644 +index 94e0ec85..49514b06 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -16,7 +16,7 @@ READLINE := diff --git a/0012-RH-compile-with-libreadline-support.patch b/0056-RH-compile-with-libreadline-support.patch similarity index 96% rename from 0012-RH-compile-with-libreadline-support.patch rename to 0056-RH-compile-with-libreadline-support.patch index b0c8749..eb0ab13 100644 --- a/0012-RH-compile-with-libreadline-support.patch +++ b/0056-RH-compile-with-libreadline-support.patch @@ -12,7 +12,7 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc -index 15e3bd3a..64384a72 100644 +index 49514b06..a3ed9f28 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -12,7 +12,7 @@ diff --git a/0013-RH-Add-mpathcleanup.patch b/0057-RH-Add-mpathcleanup.patch similarity index 96% rename from 0013-RH-Add-mpathcleanup.patch rename to 0057-RH-Add-mpathcleanup.patch index c15fb6d..bd2dcd6 100644 --- a/0013-RH-Add-mpathcleanup.patch +++ b/0057-RH-Add-mpathcleanup.patch @@ -14,7 +14,7 @@ Signed-off-by: Benjamin Marzinski 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 diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 78bef5a..22e6ad7 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,30 +1,72 @@ Name: device-mapper-multipath -Version: 0.9.7 -Release: 7%{?dist} +Version: 0.9.8 +Release: 1%{?dist} Summary: Tools to manage multipath devices using device-mapper License: GPLv2 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.9.8.tar.gz -o multipath-tools-0.9.8.tgz +Source0: multipath-tools-0.9.8.tgz Source1: multipath.conf -Patch0001: 0001-RH-fixup-udev-rules-for-redhat.patch -Patch0002: 0002-RH-Remove-the-property-blacklist-exception-builtin.patch -Patch0003: 0003-RH-don-t-start-without-a-config-file.patch -Patch0004: 0004-RH-Fix-nvme-function-missing-argument.patch -Patch0005: 0005-RH-use-rpm-optflags-if-present.patch -Patch0006: 0006-RH-add-mpathconf.patch -Patch0007: 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch -Patch0008: 0008-RH-reset-default-find_mutipaths-value-to-off.patch -Patch0009: 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch -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 +Patch0001: 0001-11-dm-mpath.rules-fix-misspelled-DM_UDEV_DISABLE_OTH.patch +Patch0002: 0002-multipathd-use-condlog-level-for-setscheduler-error-.patch +Patch0003: 0003-multipathd-make-multipathd-scheduling-configurable.patch +Patch0004: 0004-libmpathutil-really-always-use-glibc-basename.patch +Patch0005: 0005-multipathd-make-multipathd-set-priority-to-RLIMIT_RT.patch +Patch0006: 0006-multipathd-Set-CPUWeight-to-1000-and-LimitRTPRIO-to-.patch +Patch0007: 0007-11-dm-mpath.rules-explain-logic-for-device-becoming-.patch +Patch0008: 0008-11-dm-mpath.rules-don-t-import-DM_NOSCAN-from-udev-d.patch +Patch0009: 0009-11-dm-mpath.rules-don-t-import-ID_FS_VERSION-from-ud.patch +Patch0010: 0010-11-dm-mpath.rules-adapt-MPATH_DEVICE_READY-0-logic-t.patch +Patch0011: 0011-11-dm-mpath.rules-adapt-coldplug-event-handling-ro-1.patch +Patch0012: 0012-11-dm-mpath.rules-don-t-import-properties-with-new-1.patch +Patch0013: 0013-11-dm-mpath.rules-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch +Patch0014: 0014-11-dm-mpath.rules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch +Patch0015: 0015-11-dm-mpath.rules-simplify-PATH_FAILED-case.patch +Patch0016: 0016-11-dm-mpath.rules-make-label-names-more-intuitive.patch +Patch0017: 0017-kpartx.rules-ignore-DM_SUSPENDED.patch +Patch0018: 0018-multipath-tools-tests-fix-CI-failures-on-arm-v7-with.patch +Patch0019: 0019-multipath-tools-tests-fix-CI-failures-with-clang-on-.patch +Patch0020: 0020-GitHub-actions-fixes-for-spelling-CI.patch +Patch0021: 0021-GitHub-workflows-run-workflows-if-workflow-file-has-.patch +Patch0022: 0022-multipath-tools-add-TGTDIR-option.patch +Patch0023: 0023-libmultipath-move-get_udev_for_mpp-to-sysfs.c.patch +Patch0024: 0024-libmultipath-add-mp_find_path_by_devt.patch +Patch0025: 0025-Revert-libmultipath-fix-max_sectors_kb-on-adding-pat.patch +Patch0026: 0026-libmultipath-Only-set-max_sectors_kb-on-map-creation.patch +Patch0027: 0027-libmultipath-set-max_sectors_kb-in-adopt_paths.patch +Patch0028: 0028-libmultipath-add-wildcard-k-for-printing-max_sectors.patch +Patch0029: 0029-multipath.conf-5-update-documentation-for-max_sector.patch +Patch0030: 0030-multipath-tools-simplify-comment-in-hwtable.patch +Patch0031: 0031-multipath-tools-unify-text-in-multipath.conf.5.patch +Patch0032: 0032-multipath-tools-update-man-pages-dates.patch +Patch0033: 0033-libmultipath-export-partmap_in_use.patch +Patch0034: 0034-libmultipath-change-flush_on_last_del-to-fix-a-multi.patch +Patch0035: 0035-libmultipath-remove-redundant-config-option-from-Inf.patch +Patch0036: 0036-libmultipath-pad-dev_loss_tmo-to-avoid-race-with-no_.patch +Patch0037: 0037-libmultipath-fix-deferred_remove-function-arguments.patch +Patch0038: 0038-libmultipath-use-bitwise-flags-for-map-flushing-API.patch +Patch0039: 0039-libmultipath-use-bitwise-flags-for-dm_simplecmd-API.patch +Patch0040: 0040-libmultipath-add-argument-names-to-some-prototypes.patch +Patch0041: 0041-libmultipath-bump-version-to-0.9.9.patch +Patch0042: 0042-GitHub-Workflows-native.yaml-run-for-Fedora-40.patch +Patch0043: 0043-update-NEWS.md.patch +Patch0044: 0044-multipath.conf.5.in-fix-man-page-date.patch +Patch0045: 0045-RH-fixup-udev-rules-for-redhat.patch +Patch0046: 0046-RH-Remove-the-property-blacklist-exception-builtin.patch +Patch0047: 0047-RH-don-t-start-without-a-config-file.patch +Patch0048: 0048-RH-Fix-nvme-function-missing-argument.patch +Patch0049: 0049-RH-use-rpm-optflags-if-present.patch +Patch0050: 0050-RH-add-mpathconf.patch +Patch0051: 0051-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +Patch0052: 0052-RH-reset-default-find_mutipaths-value-to-off.patch +Patch0053: 0053-RH-attempt-to-get-ANA-info-via-sysfs-first.patch +Patch0054: 0054-RH-make-parse_vpd_pg83-match-scsi_id-output.patch +Patch0055: 0055-RH-add-scsi-device-handlers-to-modules-load.d.patch +Patch0056: 0056-RH-compile-with-libreadline-support.patch +Patch0057: 0057-RH-Add-mpathcleanup.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -111,7 +153,7 @@ 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.9.8 -p1 cp %{SOURCE1} . %build @@ -172,6 +214,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 @@ -232,6 +275,14 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Mon May 20 2024 Benjamin Marzinski - 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 - 0.9.7-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index 89f8f37..b0337e2 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (multipath-tools-0.9.7.tgz) = 0f4c97179a3de5a0c77893fec229eb183293fed8e5e01a9945b261845ccf5d13f8ef2c2ff0c17c9345217d236275caed4765422ec95aed80821f11658bf96e26 +SHA512 (multipath-tools-0.9.8.tgz) = 4d73bcf6bce769a829c306c609b206ddba65a708620f458106e406dd18d12f9a9d97f400662daa8e6a75c9fdf7decb6dcbda92cb807b6c53522c7b4b2795b627 SHA512 (multipath.conf) = 71953dce5a68adcf60a942305f5a66023e6f4c4baf53b1bfdb4edf65ed5b8e03db804363c36d1dcfd85591f4766f52b515269904c53b84d7b076da0b80b09942 From 59945a7f7ef24b659a0e3895f78f84a15384454a Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Thu, 13 Jun 2024 14:29:22 -0400 Subject: [PATCH 03/19] device-mapper-multipath-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 --- .gitignore | 1 + ...s-fix-misspelled-DM_UDEV_DISABLE_OTH.patch | 27 -- ... 0001-RH-fixup-udev-rules-for-redhat.patch | 0 ...property-blacklist-exception-builtin.patch | 0 ...ondlog-level-for-setscheduler-error-.patch | 27 -- ...RH-don-t-start-without-a-config-file.patch | 2 +- ...e-multipathd-scheduling-configurable.patch | 87 ----- ...H-Fix-nvme-function-missing-argument.patch | 0 ...til-really-always-use-glibc-basename.patch | 144 -------- ... 0005-RH-use-rpm-optflags-if-present.patch | 0 ...multipathd-set-priority-to-RLIMIT_RT.patch | 134 ------- ...hconf.patch => 0006-RH-add-mpathconf.patch | 0 ...PUWeight-to-1000-and-LimitRTPRIO-to-.patch | 33 -- ...s-explain-logic-for-device-becoming-.patch | 30 -- ...om-kernel-cmdline-mpath.wwids-with-A.patch | 0 ...s-don-t-import-DM_NOSCAN-from-udev-d.patch | 37 -- ...-default-find_mutipaths-value-to-off.patch | 0 ...s-don-t-import-ID_FS_VERSION-from-ud.patch | 27 -- ...empt-to-get-ANA-info-via-sysfs-first.patch | 0 ...s-adapt-MPATH_DEVICE_READY-0-logic-t.patch | 67 ---- ...-parse_vpd_pg83-match-scsi_id-output.patch | 0 ...s-adapt-coldplug-event-handling-ro-1.patch | 43 --- ...si-device-handlers-to-modules-load.d.patch | 0 ...s-don-t-import-properties-with-new-1.patch | 36 -- ...-RH-compile-with-libreadline-support.patch | 0 ...s-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch | 75 ---- ...up.patch => 0013-RH-Add-mpathcleanup.patch | 0 ...ules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch | 55 --- ...path.rules-simplify-PATH_FAILED-case.patch | 38 -- ...ules-make-label-names-more-intuitive.patch | 109 ------ 0017-kpartx.rules-ignore-DM_SUSPENDED.patch | 29 -- ...tests-fix-CI-failures-on-arm-v7-with.patch | 270 -------------- ...tests-fix-CI-failures-with-clang-on-.patch | 246 ------------- ...GitHub-actions-fixes-for-spelling-CI.patch | 31 -- ...-run-workflows-if-workflow-file-has-.patch | 146 -------- 0022-multipath-tools-add-TGTDIR-option.patch | 106 ------ ...ath-move-get_udev_for_mpp-to-sysfs.c.patch | 87 ----- ...ibmultipath-add-mp_find_path_by_devt.patch | 60 --- ...ath-fix-max_sectors_kb-on-adding-pat.patch | 33 -- ...y-set-max_sectors_kb-on-map-creation.patch | 122 ------ ...th-set-max_sectors_kb-in-adopt_paths.patch | 233 ------------ ...-wildcard-k-for-printing-max_sectors.patch | 89 ----- ...-update-documentation-for-max_sector.patch | 57 --- ...th-tools-simplify-comment-in-hwtable.patch | 34 -- ...tools-unify-text-in-multipath.conf.5.patch | 75 ---- ...ltipath-tools-update-man-pages-dates.patch | 86 ----- 0033-libmultipath-export-partmap_in_use.patch | 53 --- ...nge-flush_on_last_del-to-fix-a-multi.patch | 346 ------------------ ...ove-redundant-config-option-from-Inf.patch | 31 -- ...-dev_loss_tmo-to-avoid-race-with-no_.patch | 40 -- ...x-deferred_remove-function-arguments.patch | 107 ------ ...e-bitwise-flags-for-map-flushing-API.patch | 212 ----------- ...e-bitwise-flags-for-dm_simplecmd-API.patch | 117 ------ ...dd-argument-names-to-some-prototypes.patch | 34 -- 0041-libmultipath-bump-version-to-0.9.9.patch | 27 -- ...kflows-native.yaml-run-for-Fedora-40.patch | 24 -- 0043-update-NEWS.md.patch | 134 ------- ...ultipath.conf.5.in-fix-man-page-date.patch | 24 -- device-mapper-multipath.spec | 84 ++--- sources | 2 +- 60 files changed, 26 insertions(+), 3885 deletions(-) delete mode 100644 0001-11-dm-mpath.rules-fix-misspelled-DM_UDEV_DISABLE_OTH.patch rename 0045-RH-fixup-udev-rules-for-redhat.patch => 0001-RH-fixup-udev-rules-for-redhat.patch (100%) rename 0046-RH-Remove-the-property-blacklist-exception-builtin.patch => 0002-RH-Remove-the-property-blacklist-exception-builtin.patch (100%) delete mode 100644 0002-multipathd-use-condlog-level-for-setscheduler-error-.patch rename 0047-RH-don-t-start-without-a-config-file.patch => 0003-RH-don-t-start-without-a-config-file.patch (99%) delete mode 100644 0003-multipathd-make-multipathd-scheduling-configurable.patch rename 0048-RH-Fix-nvme-function-missing-argument.patch => 0004-RH-Fix-nvme-function-missing-argument.patch (100%) delete mode 100644 0004-libmpathutil-really-always-use-glibc-basename.patch rename 0049-RH-use-rpm-optflags-if-present.patch => 0005-RH-use-rpm-optflags-if-present.patch (100%) delete mode 100644 0005-multipathd-make-multipathd-set-priority-to-RLIMIT_RT.patch rename 0050-RH-add-mpathconf.patch => 0006-RH-add-mpathconf.patch (100%) delete mode 100644 0006-multipathd-Set-CPUWeight-to-1000-and-LimitRTPRIO-to-.patch delete mode 100644 0007-11-dm-mpath.rules-explain-logic-for-device-becoming-.patch rename 0051-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch => 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch (100%) delete mode 100644 0008-11-dm-mpath.rules-don-t-import-DM_NOSCAN-from-udev-d.patch rename 0052-RH-reset-default-find_mutipaths-value-to-off.patch => 0008-RH-reset-default-find_mutipaths-value-to-off.patch (100%) delete mode 100644 0009-11-dm-mpath.rules-don-t-import-ID_FS_VERSION-from-ud.patch rename 0053-RH-attempt-to-get-ANA-info-via-sysfs-first.patch => 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch (100%) delete mode 100644 0010-11-dm-mpath.rules-adapt-MPATH_DEVICE_READY-0-logic-t.patch rename 0054-RH-make-parse_vpd_pg83-match-scsi_id-output.patch => 0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch (100%) delete mode 100644 0011-11-dm-mpath.rules-adapt-coldplug-event-handling-ro-1.patch rename 0055-RH-add-scsi-device-handlers-to-modules-load.d.patch => 0011-RH-add-scsi-device-handlers-to-modules-load.d.patch (100%) delete mode 100644 0012-11-dm-mpath.rules-don-t-import-properties-with-new-1.patch rename 0056-RH-compile-with-libreadline-support.patch => 0012-RH-compile-with-libreadline-support.patch (100%) delete mode 100644 0013-11-dm-mpath.rules-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch rename 0057-RH-Add-mpathcleanup.patch => 0013-RH-Add-mpathcleanup.patch (100%) delete mode 100644 0014-11-dm-mpath.rules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch delete mode 100644 0015-11-dm-mpath.rules-simplify-PATH_FAILED-case.patch delete mode 100644 0016-11-dm-mpath.rules-make-label-names-more-intuitive.patch delete mode 100644 0017-kpartx.rules-ignore-DM_SUSPENDED.patch delete mode 100644 0018-multipath-tools-tests-fix-CI-failures-on-arm-v7-with.patch delete mode 100644 0019-multipath-tools-tests-fix-CI-failures-with-clang-on-.patch delete mode 100644 0020-GitHub-actions-fixes-for-spelling-CI.patch delete mode 100644 0021-GitHub-workflows-run-workflows-if-workflow-file-has-.patch delete mode 100644 0022-multipath-tools-add-TGTDIR-option.patch delete mode 100644 0023-libmultipath-move-get_udev_for_mpp-to-sysfs.c.patch delete mode 100644 0024-libmultipath-add-mp_find_path_by_devt.patch delete mode 100644 0025-Revert-libmultipath-fix-max_sectors_kb-on-adding-pat.patch delete mode 100644 0026-libmultipath-Only-set-max_sectors_kb-on-map-creation.patch delete mode 100644 0027-libmultipath-set-max_sectors_kb-in-adopt_paths.patch delete mode 100644 0028-libmultipath-add-wildcard-k-for-printing-max_sectors.patch delete mode 100644 0029-multipath.conf-5-update-documentation-for-max_sector.patch delete mode 100644 0030-multipath-tools-simplify-comment-in-hwtable.patch delete mode 100644 0031-multipath-tools-unify-text-in-multipath.conf.5.patch delete mode 100644 0032-multipath-tools-update-man-pages-dates.patch delete mode 100644 0033-libmultipath-export-partmap_in_use.patch delete mode 100644 0034-libmultipath-change-flush_on_last_del-to-fix-a-multi.patch delete mode 100644 0035-libmultipath-remove-redundant-config-option-from-Inf.patch delete mode 100644 0036-libmultipath-pad-dev_loss_tmo-to-avoid-race-with-no_.patch delete mode 100644 0037-libmultipath-fix-deferred_remove-function-arguments.patch delete mode 100644 0038-libmultipath-use-bitwise-flags-for-map-flushing-API.patch delete mode 100644 0039-libmultipath-use-bitwise-flags-for-dm_simplecmd-API.patch delete mode 100644 0040-libmultipath-add-argument-names-to-some-prototypes.patch delete mode 100644 0041-libmultipath-bump-version-to-0.9.9.patch delete mode 100644 0042-GitHub-Workflows-native.yaml-run-for-Fedora-40.patch delete mode 100644 0043-update-NEWS.md.patch delete mode 100644 0044-multipath.conf.5.in-fix-man-page-date.patch diff --git a/.gitignore b/.gitignore index 80e9936..3bea72e 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ multipath-tools-091027.tar.gz /multipath-tools-0.9.6.tgz /multipath-tools-0.9.7.tgz /multipath-tools-0.9.8.tgz +/multipath-tools-0.9.9.tgz diff --git a/0001-11-dm-mpath.rules-fix-misspelled-DM_UDEV_DISABLE_OTH.patch b/0001-11-dm-mpath.rules-fix-misspelled-DM_UDEV_DISABLE_OTH.patch deleted file mode 100644 index 4b9d7fc..0000000 --- a/0001-11-dm-mpath.rules-fix-misspelled-DM_UDEV_DISABLE_OTH.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 1 Mar 2024 18:16:32 +0100 -Subject: [PATCH] 11-dm-mpath.rules: fix misspelled - DM_UDEV_DISABLE_OTHER_RULES_FLAG - -Fixes: b3582da ("11-dm-mpath.rules: use import logic like 13-dm-disk.rules") -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index d364f9bc..d9585abf 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -116,7 +116,7 @@ LABEL="scan_import" - ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="import_end" - - # Don't import the properties from db if we will run blkid later. --ENV{DM_NOSCAN}!="1", ENV{DM_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" -+ENV{DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" - - IMPORT{db}="ID_FS_TYPE" - IMPORT{db}="ID_FS_USAGE" diff --git a/0045-RH-fixup-udev-rules-for-redhat.patch b/0001-RH-fixup-udev-rules-for-redhat.patch similarity index 100% rename from 0045-RH-fixup-udev-rules-for-redhat.patch rename to 0001-RH-fixup-udev-rules-for-redhat.patch diff --git a/0046-RH-Remove-the-property-blacklist-exception-builtin.patch b/0002-RH-Remove-the-property-blacklist-exception-builtin.patch similarity index 100% rename from 0046-RH-Remove-the-property-blacklist-exception-builtin.patch rename to 0002-RH-Remove-the-property-blacklist-exception-builtin.patch diff --git a/0002-multipathd-use-condlog-level-for-setscheduler-error-.patch b/0002-multipathd-use-condlog-level-for-setscheduler-error-.patch deleted file mode 100644 index 8a6ff99..0000000 --- a/0002-multipathd-use-condlog-level-for-setscheduler-error-.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Fri, 1 Mar 2024 19:37:29 -0500 -Subject: [PATCH] multipathd: use condlog level for setscheduler error message - -condlog uses its own log levels, so LOG_WARNING makes no sense. It -actually translates to a message sent at the LOG_DEBUG level. - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck ---- - multipathd/main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/multipathd/main.c b/multipathd/main.c -index 6193e691..85ac540f 100644 ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -3178,7 +3178,7 @@ setscheduler (void) - res = sched_setscheduler (0, SCHED_RR, &sched_param); - - if (res == -1) -- condlog(LOG_WARNING, "Could not set SCHED_RR at priority 99"); -+ condlog(2, "Could not set SCHED_RR at priority 99"); - return; - } - diff --git a/0047-RH-don-t-start-without-a-config-file.patch b/0003-RH-don-t-start-without-a-config-file.patch similarity index 99% rename from 0047-RH-don-t-start-without-a-config-file.patch rename to 0003-RH-don-t-start-without-a-config-file.patch index ad7962a..267ffa7 100644 --- a/0047-RH-don-t-start-without-a-config-file.patch +++ b/0003-RH-don-t-start-without-a-config-file.patch @@ -99,7 +99,7 @@ index 780bf852..2c518378 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 12b77156..499557a0 100644 +index 7bc8806e..315884eb 100644 --- a/multipathd/multipathd.8.in +++ b/multipathd/multipathd.8.in @@ -49,6 +49,8 @@ map regains its maximum performance and redundancy. diff --git a/0003-multipathd-make-multipathd-scheduling-configurable.patch b/0003-multipathd-make-multipathd-scheduling-configurable.patch deleted file mode 100644 index 8529152..0000000 --- a/0003-multipathd-make-multipathd-scheduling-configurable.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Fri, 1 Mar 2024 19:37:30 -0500 -Subject: [PATCH] multipathd: make multipathd scheduling configurable - -Currently multipathd always tries to run as a realtime process with a -priority of 99. This is excessive. As a first step towards fixing this, -make it possible at compile time to lower the priority or keep -multipathd from making itself a realtime process. - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck ---- - Makefile.inc | 6 ++++++ - README.md | 3 +++ - multipathd/Makefile | 3 +++ - multipathd/main.c | 5 +++-- - 4 files changed, 15 insertions(+), 2 deletions(-) - -diff --git a/Makefile.inc b/Makefile.inc -index 5668e638..6d206281 100644 ---- a/Makefile.inc -+++ b/Makefile.inc -@@ -18,6 +18,12 @@ READLINE := - # SCSI_DH_MODULES_PRELOAD := scsi_dh_alua scsi_dh_rdac - SCSI_DH_MODULES_PRELOAD := - -+# Multipathd scheduling priority. Set value from 1 to 99 to make multipathd -+# change its scheduling policy to SCHED_RR and its priority to the specified -+# value. set to 0 to stop multipathd from changing the scheduling policy and -+# priority it was started with. -+SCHED_RT_PRIO := 99 -+ - EXTRAVERSION := $(shell rev=$$(git rev-parse --short=7 HEAD 2>/dev/null); echo $${rev:+-g$$rev}) - - # PKG_CONFIG must be read from the environment to enable compilation -diff --git a/README.md b/README.md -index d4f35f57..bb41bf0e 100644 ---- a/README.md -+++ b/README.md -@@ -98,6 +98,9 @@ The following variables can be passed to the `make` command line: - By default, command line editing is disabled. - Note that using libreadline may - [make binary indistributable due to license incompatibility](https://github.com/opensvc/multipath-tools/issues/36). -+ * `SCHED_RT_PRIO={0-99}`: for values {1-99} set the realtime priority -+ multipathd will attempt to run with. for value 0, disable multipathd -+ changing itself to a realtime process. - * `ENABLE_LIBDMMP=0`: disable building libdmmp - * `ENABLE_DMEVENTS_POLL=0`: disable support for the device-mapper event - polling API. For use with pre-5.0 kernels that don't support dmevent polling -diff --git a/multipathd/Makefile b/multipathd/Makefile -index 997b40cf..7300f07a 100644 ---- a/multipathd/Makefile -+++ b/multipathd/Makefile -@@ -57,6 +57,9 @@ $(CLI): $(CLI_OBJS) - cli_handlers.o: cli_handlers.c - $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused-parameter -c -o $@ $< - -+main.o: main.c -+ $(Q)$(CC) $(CPPFLAGS) -DSCHED_RT_PRIO=$(SCHED_RT_PRIO) $(CFLAGS) -c -o $@ $< -+ - install: - $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) - $(Q)$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir) -diff --git a/multipathd/main.c b/multipathd/main.c -index 85ac540f..9486a8a3 100644 ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -3172,7 +3172,7 @@ setscheduler (void) - { - int res; - static struct sched_param sched_param = { -- .sched_priority = 99 -+ .sched_priority = SCHED_RT_PRIO - }; - - res = sched_setscheduler (0, SCHED_RR, &sched_param); -@@ -3471,7 +3471,8 @@ child (__attribute__((unused)) void *param) - if (!vecs) - goto failed; - -- setscheduler(); -+ if (SCHED_RT_PRIO) -+ setscheduler(); - set_oom_adj(); - #ifdef FPIN_EVENT_HANDLER - if (conf->marginal_pathgroups == MARGINAL_PATHGROUP_FPIN) diff --git a/0048-RH-Fix-nvme-function-missing-argument.patch b/0004-RH-Fix-nvme-function-missing-argument.patch similarity index 100% rename from 0048-RH-Fix-nvme-function-missing-argument.patch rename to 0004-RH-Fix-nvme-function-missing-argument.patch diff --git a/0004-libmpathutil-really-always-use-glibc-basename.patch b/0004-libmpathutil-really-always-use-glibc-basename.patch deleted file mode 100644 index 78f8859..0000000 --- a/0004-libmpathutil-really-always-use-glibc-basename.patch +++ /dev/null @@ -1,144 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 3 Apr 2024 18:55:54 +0200 -Subject: [PATCH] libmpathutil: really always use glibc basename() - -Despite 03a5456 ("libmultipath: always use glibc basename()"), we -still call the system library's basename() from libmultipath. -musl libc until 1.24 provided a prototype for basename() in string.h, -which was not correct and was resolved to the destructive POSIX -basename(). musl libc 1.25 removed this prototype. - -While the remaining code path doesn't strictly depend on the non-destructive -behavior of glibc's basename(), it's cleaner and safer to use the same -implementation everywhere. - -Fixes: 03a5456 ("libmultipath: always use glibc basename()") -Fixes: https://github.com/opensvc/multipath-tools/pull/84 - -Signed-off-by: Martin Wilck -Reviewed-by: Khem Raj -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmpathutil/libmpathutil.version | 4 ++++ - libmpathutil/util.c | 5 +---- - libmpathutil/util.h | 5 +++++ - tests/util.c | 31 +++++++++++++++++++++++++++++++ - 4 files changed, 41 insertions(+), 4 deletions(-) - -diff --git a/libmpathutil/libmpathutil.version b/libmpathutil/libmpathutil.version -index 80d64a3e..fee74a32 100644 ---- a/libmpathutil/libmpathutil.version -+++ b/libmpathutil/libmpathutil.version -@@ -129,3 +129,7 @@ LIBMPATHUTIL_2.0 { - vector_move_up; - vector_sort; - }; -+ -+LIBMPATHUTIL_2.1 { -+ libmp_basename; -+}; -diff --git a/libmpathutil/util.c b/libmpathutil/util.c -index 9d147fca..23d303f9 100644 ---- a/libmpathutil/util.c -+++ b/libmpathutil/util.c -@@ -32,18 +32,15 @@ strchop(char *str) - return i; - } - --#ifndef __GLIBC__ - /* - * glibc's non-destructive version of basename() - * License: LGPL-2.1-or-later - */ --static const char *__basename(const char *filename) -+const char *libmp_basename(const char *filename) - { - char *p = strrchr(filename, '/'); - return p ? p + 1 : filename; - } --#define basename(x) __basename(x) --#endif - - int - basenamecpy (const char *src, char *dst, size_t size) -diff --git a/libmpathutil/util.h b/libmpathutil/util.h -index de9fcfdd..4997fed6 100644 ---- a/libmpathutil/util.h -+++ b/libmpathutil/util.h -@@ -12,6 +12,11 @@ - #include - - size_t strchop(char *); -+ -+const char *libmp_basename(const char *filename); -+#ifndef __GLIBC__ -+#define basename(x) libmp_basename(x) -+#endif - int basenamecpy (const char *src, char *dst, size_t size); - int filepresent (const char *run); - char *get_next_string(char **temp, const char *split_char); -diff --git a/tests/util.c b/tests/util.c -index d6083dce..4850ddcb 100644 ---- a/tests/util.c -+++ b/tests/util.c -@@ -16,6 +16,7 @@ - * - */ - -+#define _GNU_SOURCE - #include - #include - #include -@@ -23,6 +24,7 @@ - #include - #include - #include -+#include - #include "util.h" - - #include "globals.c" -@@ -163,6 +165,34 @@ static int test_basenamecpy(void) - return cmocka_run_group_tests(tests, NULL, NULL); - } - -+static void test_basename_01(void **state) -+{ -+ const char *path = "/foo/bar"; -+ const char *base; -+ -+ base = basename(path); -+ assert_string_equal(base, "bar"); -+ assert_string_equal(path, "/foo/bar"); -+} -+ -+static void test_basename_02(void **state) -+{ -+ const char *path = "/foo/bar/"; -+ const char *base; -+ -+ base = basename(path); -+ assert_string_equal(base, ""); -+ assert_string_equal(path, "/foo/bar/"); -+} -+ -+static int test_basename(void) { -+ const struct CMUnitTest tests[] = { -+ cmocka_unit_test(test_basename_01), -+ cmocka_unit_test(test_basename_02), -+ }; -+ return cmocka_run_group_tests(tests, NULL, NULL); -+} -+ - /* - * On big endian systems, if bitfield_t is 32bit, we need - * to swap the two 32 bit parts of a 64bit value to make -@@ -946,6 +976,7 @@ int main(void) - - init_test_verbosity(-1); - ret += test_basenamecpy(); -+ ret += test_basename(); - ret += test_bitmasks(); - ret += test_strlcpy(); - ret += test_strlcat(); diff --git a/0049-RH-use-rpm-optflags-if-present.patch b/0005-RH-use-rpm-optflags-if-present.patch similarity index 100% rename from 0049-RH-use-rpm-optflags-if-present.patch rename to 0005-RH-use-rpm-optflags-if-present.patch diff --git a/0005-multipathd-make-multipathd-set-priority-to-RLIMIT_RT.patch b/0005-multipathd-make-multipathd-set-priority-to-RLIMIT_RT.patch deleted file mode 100644 index fd12767..0000000 --- a/0005-multipathd-make-multipathd-set-priority-to-RLIMIT_RT.patch +++ /dev/null @@ -1,134 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Tue, 9 Apr 2024 18:56:12 -0400 -Subject: [PATCH] multipathd: make multipathd set priority to RLIMIT_RTPRIO - -With this change, if the SCHED_RT_PRIO compiler flag has been removed. -Instead multipathd will call getrlimit(RLIMIT_RTPRIO, ...) and look at -the hard limit. It it's 0, multipath will do nothing. Otherwise it will -change its scheduling policy to SCHED_RR and its priority to the hard -limit. - -This allows users to change the priority of that multipathd runs with by -adding - -LimitRTPRIO= - -to the [Service] section of the multipathd.service unit file. Setting -LimitRTPRIO=0 will make multipathd run as a normal process, while -setting LimitRTPRIO=infinity will make it use the maximum SCHED_RR prio, -which is 99. - -To keep the existing behavior, multipathd.service now sets -LimitRTPRIO=infinity - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck ---- - Makefile.inc | 6 ------ - README.md | 3 --- - multipathd/Makefile | 3 --- - multipathd/main.c | 22 +++++++++++++++------- - multipathd/multipathd.service.in | 1 + - 5 files changed, 16 insertions(+), 19 deletions(-) - -diff --git a/Makefile.inc b/Makefile.inc -index 6d206281..5668e638 100644 ---- a/Makefile.inc -+++ b/Makefile.inc -@@ -18,12 +18,6 @@ READLINE := - # SCSI_DH_MODULES_PRELOAD := scsi_dh_alua scsi_dh_rdac - SCSI_DH_MODULES_PRELOAD := - --# Multipathd scheduling priority. Set value from 1 to 99 to make multipathd --# change its scheduling policy to SCHED_RR and its priority to the specified --# value. set to 0 to stop multipathd from changing the scheduling policy and --# priority it was started with. --SCHED_RT_PRIO := 99 -- - EXTRAVERSION := $(shell rev=$$(git rev-parse --short=7 HEAD 2>/dev/null); echo $${rev:+-g$$rev}) - - # PKG_CONFIG must be read from the environment to enable compilation -diff --git a/README.md b/README.md -index bb41bf0e..d4f35f57 100644 ---- a/README.md -+++ b/README.md -@@ -98,9 +98,6 @@ The following variables can be passed to the `make` command line: - By default, command line editing is disabled. - Note that using libreadline may - [make binary indistributable due to license incompatibility](https://github.com/opensvc/multipath-tools/issues/36). -- * `SCHED_RT_PRIO={0-99}`: for values {1-99} set the realtime priority -- multipathd will attempt to run with. for value 0, disable multipathd -- changing itself to a realtime process. - * `ENABLE_LIBDMMP=0`: disable building libdmmp - * `ENABLE_DMEVENTS_POLL=0`: disable support for the device-mapper event - polling API. For use with pre-5.0 kernels that don't support dmevent polling -diff --git a/multipathd/Makefile b/multipathd/Makefile -index 7300f07a..997b40cf 100644 ---- a/multipathd/Makefile -+++ b/multipathd/Makefile -@@ -57,9 +57,6 @@ $(CLI): $(CLI_OBJS) - cli_handlers.o: cli_handlers.c - $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused-parameter -c -o $@ $< - --main.o: main.c -- $(Q)$(CC) $(CPPFLAGS) -DSCHED_RT_PRIO=$(SCHED_RT_PRIO) $(CFLAGS) -c -o $@ $< -- - install: - $(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) - $(Q)$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir) -diff --git a/multipathd/main.c b/multipathd/main.c -index 9486a8a3..dd17d5c3 100644 ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -3171,14 +3171,23 @@ static void - setscheduler (void) - { - int res; -- static struct sched_param sched_param = { -- .sched_priority = SCHED_RT_PRIO -- }; -+ static struct sched_param sched_param; -+ struct rlimit rlim; -+ -+ if (getrlimit(RLIMIT_RTPRIO, &rlim) < 0 || rlim.rlim_max == 0) -+ return; -+ -+ sched_param.sched_priority = rlim.rlim_max > INT_MAX ? INT_MAX : -+ rlim.rlim_max; -+ res = sched_get_priority_max(SCHED_RR); -+ if (res > 0 && res < sched_param.sched_priority) -+ sched_param.sched_priority = res; - -- res = sched_setscheduler (0, SCHED_RR, &sched_param); -+ res = sched_setscheduler(0, SCHED_RR, &sched_param); - - if (res == -1) -- condlog(2, "Could not set SCHED_RR at priority 99"); -+ condlog(2, "Could not set SCHED_RR at priority %d", -+ sched_param.sched_priority); - return; - } - -@@ -3471,8 +3480,7 @@ child (__attribute__((unused)) void *param) - if (!vecs) - goto failed; - -- if (SCHED_RT_PRIO) -- setscheduler(); -+ setscheduler(); - set_oom_adj(); - #ifdef FPIN_EVENT_HANDLER - if (conf->marginal_pathgroups == MARGINAL_PATHGROUP_FPIN) -diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in -index 6d03ff71..18bb367e 100644 ---- a/multipathd/multipathd.service.in -+++ b/multipathd/multipathd.service.in -@@ -19,6 +19,7 @@ NotifyAccess=main - ExecStart=/sbin/multipathd -d -s - ExecReload=/sbin/multipathd reconfigure - TasksMax=infinity -+LimitRTPRIO=infinity - - [Install] - WantedBy=sysinit.target diff --git a/0050-RH-add-mpathconf.patch b/0006-RH-add-mpathconf.patch similarity index 100% rename from 0050-RH-add-mpathconf.patch rename to 0006-RH-add-mpathconf.patch diff --git a/0006-multipathd-Set-CPUWeight-to-1000-and-LimitRTPRIO-to-.patch b/0006-multipathd-Set-CPUWeight-to-1000-and-LimitRTPRIO-to-.patch deleted file mode 100644 index 0cbe997..0000000 --- a/0006-multipathd-Set-CPUWeight-to-1000-and-LimitRTPRIO-to-.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Mon, 15 Apr 2024 19:43:06 -0400 -Subject: [PATCH] multipathd: Set CPUWeight to 1000 and LimitRTPRIO to 10 - -If multipathd doesn't become a real time process, it was scheduled as a -normal process, without any priority increase. Bump up the CPUWeight so -that even as a normal process, it will still run with increased -priority. - -If multipathd did become a real time process, it set itself to the -highest priority, which is excessive. A priority of 10 is plenty. - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck ---- - multipathd/multipathd.service.in | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in -index 18bb367e..a63ddd9a 100644 ---- a/multipathd/multipathd.service.in -+++ b/multipathd/multipathd.service.in -@@ -19,7 +19,8 @@ NotifyAccess=main - ExecStart=/sbin/multipathd -d -s - ExecReload=/sbin/multipathd reconfigure - TasksMax=infinity --LimitRTPRIO=infinity -+LimitRTPRIO=10 -+CPUWeight=1000 - - [Install] - WantedBy=sysinit.target diff --git a/0007-11-dm-mpath.rules-explain-logic-for-device-becoming-.patch b/0007-11-dm-mpath.rules-explain-logic-for-device-becoming-.patch deleted file mode 100644 index 6241459..0000000 --- a/0007-11-dm-mpath.rules-explain-logic-for-device-becoming-.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 1 Mar 2024 19:53:14 +0100 -Subject: [PATCH] 11-dm-mpath.rules: explain logic for device becoming ready - while suspended - -Add a comment to explain why we must set MPATH_DEVICE_READY=0 when -we see a device becoming ready (number of active paths 0 -> 1) while -the device is suspended. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index d9585abf..b8d19d01 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -98,6 +98,8 @@ ENV{MPATH_DEVICE_READY}=="0", \ - # If the device comes back online, set DM_ACTIVATION so that - # upper layers do a rescan. If the device is currently suspended, - # we have to postpone the activation until the next event. -+# In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the -+# MPATH_UNCHANGED logic will cause later rules to skipped in the next event. - ENV{MPATH_DEVICE_READY}=="0", GOTO="dont_activate" - ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="dont_activate" - ENV{DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="dont_activate" diff --git a/0051-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch b/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch similarity index 100% rename from 0051-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch rename to 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch diff --git a/0008-11-dm-mpath.rules-don-t-import-DM_NOSCAN-from-udev-d.patch b/0008-11-dm-mpath.rules-don-t-import-DM_NOSCAN-from-udev-d.patch deleted file mode 100644 index 3900b39..0000000 --- a/0008-11-dm-mpath.rules-don-t-import-DM_NOSCAN-from-udev-d.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 1 Mar 2024 19:57:59 +0100 -Subject: [PATCH] 11-dm-mpath.rules: don't import DM_NOSCAN from udev db - -DM_NOSCAN is our "output" flag for 13-dm-disk.rules, and it should -be treated the same way as DM_UDEV_DISABLE_OTHER_RULES_FLAG, which -isn't imported from the udev database. The state that we need to -remember is MPATH_DEVICE_READY, which we've already imported above, -and we will set the "output" flags accordingly in the "force_activation" -code path further down. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index b8d19d01..eb12b0c6 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -18,9 +18,11 @@ ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1 - - # If this uevent didn't come from dm, don't try to update the - # device state -+# Note that .MPATH_DEVICE_READY_OLD=="" here. Thus we won't activate the -+# device below at force_activation, which is correct. - ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \ -- IMPORT{db}="DM_NOSCAN", IMPORT{db}="DM_COLDPLUG_SUSPENDED", \ -- GOTO="scan_import" -+ IMPORT{db}="DM_COLDPLUG_SUSPENDED", \ -+ GOTO="force_activation" - - ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" - diff --git a/0052-RH-reset-default-find_mutipaths-value-to-off.patch b/0008-RH-reset-default-find_mutipaths-value-to-off.patch similarity index 100% rename from 0052-RH-reset-default-find_mutipaths-value-to-off.patch rename to 0008-RH-reset-default-find_mutipaths-value-to-off.patch diff --git a/0009-11-dm-mpath.rules-don-t-import-ID_FS_VERSION-from-ud.patch b/0009-11-dm-mpath.rules-don-t-import-ID_FS_VERSION-from-ud.patch deleted file mode 100644 index 933a43a..0000000 --- a/0009-11-dm-mpath.rules-don-t-import-ID_FS_VERSION-from-ud.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 1 Mar 2024 21:02:49 +0100 -Subject: [PATCH] 11-dm-mpath.rules: don't import ID_FS_VERSION from udev db - -Use the same set of properties to import as 13-dm-disk.rules. -ID_FS_VERSION isn't used in any udev rule I am aware of. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index eb12b0c6..4386b6ca 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -126,7 +126,6 @@ IMPORT{db}="ID_FS_TYPE" - IMPORT{db}="ID_FS_USAGE" - IMPORT{db}="ID_FS_UUID_ENC" - IMPORT{db}="ID_FS_LABEL_ENC" --IMPORT{db}="ID_FS_VERSION" - IMPORT{db}="ID_PART_ENTRY_NAME" - IMPORT{db}="ID_PART_ENTRY_UUID" - IMPORT{db}="ID_PART_ENTRY_SCHEME" diff --git a/0053-RH-attempt-to-get-ANA-info-via-sysfs-first.patch b/0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch similarity index 100% rename from 0053-RH-attempt-to-get-ANA-info-via-sysfs-first.patch rename to 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch diff --git a/0010-11-dm-mpath.rules-adapt-MPATH_DEVICE_READY-0-logic-t.patch b/0010-11-dm-mpath.rules-adapt-MPATH_DEVICE_READY-0-logic-t.patch deleted file mode 100644 index 97b3901..0000000 --- a/0010-11-dm-mpath.rules-adapt-MPATH_DEVICE_READY-0-logic-t.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 1 Mar 2024 20:53:50 +0100 -Subject: [PATCH] 11-dm-mpath.rules: adapt MPATH_DEVICE_READY=0 logic to - 10-dm.rules update - -With the late patches for 10-dm.rules, DM_UDEV_DISABLE_OTHER_RULES_FLAG isn't -restored from the udev database any more, so we don't need to restore -the flag to its original state before it is saved to the db. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 22 ++++++++++++---------- - 1 file changed, 12 insertions(+), 10 deletions(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index 4386b6ca..2f909c3a 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -19,7 +19,7 @@ ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1 - # If this uevent didn't come from dm, don't try to update the - # device state - # Note that .MPATH_DEVICE_READY_OLD=="" here. Thus we won't activate the --# device below at force_activation, which is correct. -+# device below at mpath_is_ready, which is correct. - ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \ - IMPORT{db}="DM_COLDPLUG_SUSPENDED", \ - GOTO="force_activation" -@@ -84,25 +84,27 @@ ENV{DM_ACTION}=="PATH_FAILED|PATH_REINSTATED", \ - - LABEL="force_activation" - -+ENV{MPATH_DEVICE_READY}!="0", GOTO="mpath_is_ready" - # Do not initiate scanning if no path is available, - # otherwise there would be a hang or IO error on access. - # We'd like to avoid this, especially within udev processing. --ENV{MPATH_DEVICE_READY}=="0", ENV{DM_NOSCAN}="1" -- --# Skip all foreign rules if no path is available. -+# This is communicated to later rules in DM_NOSCAN. -+# Likewise, skip all foreign rules if no path is available. - # Use DM_UDEV_DISABLE_OTHER_RULES_FLAG to communicate this --# to upper layers. The original value will be restored in a late --# udev rule. --ENV{MPATH_DEVICE_READY}=="0", \ -- ENV{.MPATH_SAVE_DISABLE_OTHER_RULES_FLAG}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}", \ -- ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" -+# to upper layers. With dm rules < v3, save the original value here; -+# it will be restored in a late udev rule. -+ENV{DM_UDEV_RULES_VSN}=="1|2", \ -+ ENV{.MPATH_SAVE_DISABLE_OTHER_RULES_FLAG}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}" -+ENV{DM_NOSCAN}="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" -+GOTO="dont_activate" -+ -+LABEL="mpath_is_ready" - - # If the device comes back online, set DM_ACTIVATION so that - # upper layers do a rescan. If the device is currently suspended, - # we have to postpone the activation until the next event. - # In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the - # MPATH_UNCHANGED logic will cause later rules to skipped in the next event. --ENV{MPATH_DEVICE_READY}=="0", GOTO="dont_activate" - ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="dont_activate" - ENV{DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="dont_activate" - diff --git a/0054-RH-make-parse_vpd_pg83-match-scsi_id-output.patch b/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch similarity index 100% rename from 0054-RH-make-parse_vpd_pg83-match-scsi_id-output.patch rename to 0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch diff --git a/0011-11-dm-mpath.rules-adapt-coldplug-event-handling-ro-1.patch b/0011-11-dm-mpath.rules-adapt-coldplug-event-handling-ro-1.patch deleted file mode 100644 index 938a07f..0000000 --- a/0011-11-dm-mpath.rules-adapt-coldplug-event-handling-ro-1.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 1 Mar 2024 20:55:40 +0100 -Subject: [PATCH] 11-dm-mpath.rules: adapt coldplug event handling ro - 10-dm.rules update - -With late late patches for 10-dm.rules, DM_UDEV_DISABLE_OTHER_RULES_FLAG is -never restored from the udev db. Thus we don't need to clear it here -any more for coldplug events. Also, we must use .DM_SUSPENDED instead of -DM_SUSPENDED as input flag with the v3 rule set (other occurences of -DM_SUSPENDED will be replaced in a follow-up patch). - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index 2f909c3a..5f547cab 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -9,12 +9,17 @@ ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}=="1", \ - PROGRAM="/bin/logger -t 11-dm-mpath.rules -p daemon.warning \"Coldplug event for suspended device\"", \ - ENV{DM_COLDPLUG_SUSPENDED}="1", GOTO="scan_import" - --# Coldplug event. DM_UDEV_DISABLE_OTHER_RULES_FLAG has been restored -+# Coldplug event. Import previously set properties. -+ACTION!="add", GOTO="mpath_coldplug_end" -+ENV{DM_ACTIVATION}!="1", GOTO="mpath_coldplug_end" -+ENV{DM_UDEV_RULES_VSN}!="1|2", ENV{.DM_SUSPENDED}!="1", GOTO="scan_import" -+# With DM rules < v3, DM_UDEV_DISABLE_OTHER_RULES_FLAG has been restored - # from DB in 10-dm.rules. If the device is not suspended, clear the flag. - # This is safe for multipath where DM_UDEV_DISABLE_OTHER_RULES_FLAG is basically - # equivalent to DM_SUSPENDED==1 || DISK_RO==1 --ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1", \ -+ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1", \ - ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="", GOTO="scan_import" -+LABEL="mpath_coldplug_end" - - # If this uevent didn't come from dm, don't try to update the - # device state diff --git a/0055-RH-add-scsi-device-handlers-to-modules-load.d.patch b/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch similarity index 100% rename from 0055-RH-add-scsi-device-handlers-to-modules-load.d.patch rename to 0011-RH-add-scsi-device-handlers-to-modules-load.d.patch diff --git a/0012-11-dm-mpath.rules-don-t-import-properties-with-new-1.patch b/0012-11-dm-mpath.rules-don-t-import-properties-with-new-1.patch deleted file mode 100644 index f4e69cf..0000000 --- a/0012-11-dm-mpath.rules-don-t-import-properties-with-new-1.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 1 Mar 2024 20:58:47 +0100 -Subject: [PATCH] 11-dm-mpath.rules: don't import properties with new - 13-dm-disk.rules - -With the late changes to 13-dm-disk.rules, we don't need to import any -blkid-generated properties from the udev database, because they will -be imported later. - -Except for ID_FS_TYPE, this actually holds since lvm2 commit 94f77a4 ("udev: -import previous results of blkid when in suspended state"), included in lvm2 -2.03.19, but we have no simple way to detect the version of the lvm2 rules. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index 5f547cab..95126bf2 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -126,6 +126,10 @@ LABEL="scan_import" - # have never been properly set. Don't import them. - ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="import_end" - -+# DM rules v3 will import missing properties on 13-dm-disk.rules. -+# No need to do it here. -+ENV{DM_UDEV_RULES_VSN}!="1|2", GOTO="import_end" -+ - # Don't import the properties from db if we will run blkid later. - ENV{DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" - diff --git a/0056-RH-compile-with-libreadline-support.patch b/0012-RH-compile-with-libreadline-support.patch similarity index 100% rename from 0056-RH-compile-with-libreadline-support.patch rename to 0012-RH-compile-with-libreadline-support.patch diff --git a/0013-11-dm-mpath.rules-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch b/0013-11-dm-mpath.rules-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch deleted file mode 100644 index e922427..0000000 --- a/0013-11-dm-mpath.rules-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 1 Mar 2024 22:33:59 +0100 -Subject: [PATCH] 11-dm-mpath.rules: replace DM_SUSPENDED by .DM_SUSPENDED - -With the late changes to the device mapper rules, DM_SUSPENDED -is not exported any more. Use .DM_SUSPENDED instead. - -Note that although 11-dm-mpath.rules is not a part of lvm2, it -can be considered as part of the device-mapper layer (everything -before 13-dm-disk.rules can), and is thus allowed to use -.DM_SUSPENDED. In practice .DM_SUSPENDED is equivalent to -DM_UDEV_DISABLE_OTHER_RULES_FLAG for multipath devices, but -using .DM_SUSPENDED here makes the intention more obvious. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index 95126bf2..efc6416f 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -4,8 +4,11 @@ ENV{DM_UUID}!="mpath-?*", GOTO="mpath_end" - - IMPORT{db}="MPATH_DEVICE_READY" - -+# device-mapper rules v2 compatibility -+ENV{.DM_SUSPENDED}!="?*", ENV{.DM_SUSPENDED}="$env{DM_SUSPENDED}" -+ - # Coldplug event while device is suspended (e.g. during a reload) --ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}=="1", \ -+ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{.DM_SUSPENDED}=="1", \ - PROGRAM="/bin/logger -t 11-dm-mpath.rules -p daemon.warning \"Coldplug event for suspended device\"", \ - ENV{DM_COLDPLUG_SUSPENDED}="1", GOTO="scan_import" - -@@ -17,7 +20,7 @@ ENV{DM_UDEV_RULES_VSN}!="1|2", ENV{.DM_SUSPENDED}!="1", GOTO="scan_import" - # from DB in 10-dm.rules. If the device is not suspended, clear the flag. - # This is safe for multipath where DM_UDEV_DISABLE_OTHER_RULES_FLAG is basically - # equivalent to DM_SUSPENDED==1 || DISK_RO==1 --ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1", \ -+ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{.DM_SUSPENDED}!="1", ENV{DISK_RO}!="1", \ - ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="", GOTO="scan_import" - LABEL="mpath_coldplug_end" - -@@ -68,7 +71,7 @@ LABEL="mpath_action" - # Activation might have been partially skipped. Activate the device now, - # i.e. disable the MPATH_UNCHANGED logic and set DM_ACTIVATION=1. - IMPORT{db}="DM_COLDPLUG_SUSPENDED" --ENV{DM_COLDPLUG_SUSPENDED}=="1", ENV{DM_SUSPENDED}!="1", \ -+ENV{DM_COLDPLUG_SUSPENDED}=="1", ENV{.DM_SUSPENDED}!="1", \ - ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0", \ - PROGRAM="/bin/logger -t 11-dm-mpath.rules -p daemon.notice \"Forcing activation of previously suspended device\"", \ - GOTO="force_activation" -@@ -111,7 +114,7 @@ LABEL="mpath_is_ready" - # In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the - # MPATH_UNCHANGED logic will cause later rules to skipped in the next event. - ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="dont_activate" --ENV{DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="dont_activate" -+ENV{.DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="dont_activate" - - ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" - LABEL="dont_activate" -@@ -145,7 +148,7 @@ IMPORT{db}="ID_PART_GPT_AUTO_ROOT" - LABEL="import_end" - - # Reset previous DM_COLDPLUG_SUSPENDED if activation happens now --ENV{DM_SUSPENDED}!="1", ENV{DM_ACTIVATION}=="1", ENV{DM_COLDPLUG_SUSPENDED}="" -+ENV{.DM_SUSPENDED}!="1", ENV{DM_ACTIVATION}=="1", ENV{DM_COLDPLUG_SUSPENDED}="" - - # Multipath maps should take precedence over their members. - ENV{DM_UDEV_LOW_PRIORITY_FLAG}!="1", OPTIONS+="link_priority=50" diff --git a/0057-RH-Add-mpathcleanup.patch b/0013-RH-Add-mpathcleanup.patch similarity index 100% rename from 0057-RH-Add-mpathcleanup.patch rename to 0013-RH-Add-mpathcleanup.patch diff --git a/0014-11-dm-mpath.rules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch b/0014-11-dm-mpath.rules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch deleted file mode 100644 index a5eecaf..0000000 --- a/0014-11-dm-mpath.rules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 1 Mar 2024 23:23:53 +0100 -Subject: [PATCH] 11-dm-mpath.rules: replace DM_NOSCAN by .DM_NOSCAN - -We don't need to restore DM_NOSCAN from the db anymore, so we can rename -it to .DM_NOSCAN, making it a temporary property. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index efc6416f..3ae3c054 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -96,14 +96,14 @@ ENV{MPATH_DEVICE_READY}!="0", GOTO="mpath_is_ready" - # Do not initiate scanning if no path is available, - # otherwise there would be a hang or IO error on access. - # We'd like to avoid this, especially within udev processing. --# This is communicated to later rules in DM_NOSCAN. -+# This is communicated to later rules in .DM_NOSCAN. - # Likewise, skip all foreign rules if no path is available. - # Use DM_UDEV_DISABLE_OTHER_RULES_FLAG to communicate this - # to upper layers. With dm rules < v3, save the original value here; - # it will be restored in a late udev rule. - ENV{DM_UDEV_RULES_VSN}=="1|2", \ - ENV{.MPATH_SAVE_DISABLE_OTHER_RULES_FLAG}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}" --ENV{DM_NOSCAN}="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" -+ENV{.DM_NOSCAN}="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" - GOTO="dont_activate" - - LABEL="mpath_is_ready" -@@ -134,7 +134,7 @@ ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="import_end" - ENV{DM_UDEV_RULES_VSN}!="1|2", GOTO="import_end" - - # Don't import the properties from db if we will run blkid later. --ENV{DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" -+ENV{.DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" - - IMPORT{db}="ID_FS_TYPE" - IMPORT{db}="ID_FS_USAGE" -@@ -150,6 +150,9 @@ LABEL="import_end" - # Reset previous DM_COLDPLUG_SUSPENDED if activation happens now - ENV{.DM_SUSPENDED}!="1", ENV{DM_ACTIVATION}=="1", ENV{DM_COLDPLUG_SUSPENDED}="" - -+# device-mapper rules v2 compatibility for 13-dm-disk.rules -+ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{DM_NOSCAN}="$env{.DM_NOSCAN}" -+ - # Multipath maps should take precedence over their members. - ENV{DM_UDEV_LOW_PRIORITY_FLAG}!="1", OPTIONS+="link_priority=50" - diff --git a/0015-11-dm-mpath.rules-simplify-PATH_FAILED-case.patch b/0015-11-dm-mpath.rules-simplify-PATH_FAILED-case.patch deleted file mode 100644 index ce393ae..0000000 --- a/0015-11-dm-mpath.rules-simplify-PATH_FAILED-case.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 6 Mar 2024 21:17:51 +0100 -Subject: [PATCH] 11-dm-mpath.rules: simplify PATH_FAILED case - -This combination of a GOTO and a simple rule can be combined -into a single rule. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index 3ae3c054..4777fbec 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -56,14 +56,10 @@ PROGRAM=="@BINDIR@/multipath -U -v1 %k", GOTO="paths_ok" - ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action" - LABEL="paths_ok" - --# Don't mark a device ready on a PATH_FAILED event. even if --# DM_NR_VALID_PATHS is greater than 0. Just keep the existing --# value --ENV{DM_ACTION}=="PATH_FAILED", GOTO="mpath_action" -- --# This event is either a PATH_REINSTATED or a table reload where --# there are active paths. Mark the device ready --ENV{MPATH_DEVICE_READY}="1" -+# For PATH_FAILED events, keep the existing value of MPATH_DEVICE_READY. -+# If it's not PATH_FAILED, this event is either a PATH_REINSTATED or a -+# table reload where there are active paths. Mark the device ready. -+ENV{DM_ACTION}!="PATH_FAILED", ENV{MPATH_DEVICE_READY}="1" - - LABEL="mpath_action" - diff --git a/0016-11-dm-mpath.rules-make-label-names-more-intuitive.patch b/0016-11-dm-mpath.rules-make-label-names-more-intuitive.patch deleted file mode 100644 index e81f04f..0000000 --- a/0016-11-dm-mpath.rules-make-label-names-more-intuitive.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 1 Mar 2024 21:54:26 +0100 -Subject: [PATCH] 11-dm-mpath.rules: make label names more intuitive - -The labels "dont_activate" and "scan_import" denote the same code line. -Remove "dont_activate". Improve two misleading label names. - -Substitutions: - dont_activate -> scan_import - force_activation -> check_mpath_ready - mpath_action -> check_mpath_unchanged - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 22 +++++++++++----------- - 1 file changed, 11 insertions(+), 11 deletions(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index 4777fbec..0562eddf 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -30,7 +30,7 @@ LABEL="mpath_coldplug_end" - # device below at mpath_is_ready, which is correct. - ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \ - IMPORT{db}="DM_COLDPLUG_SUSPENDED", \ -- GOTO="force_activation" -+ GOTO="check_mpath_ready" - - ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" - -@@ -38,13 +38,13 @@ ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" - # table with no active devices. If this happens, mark the - # device not ready - ENV{DM_SUBSYSTEM_UDEV_FLAG2}=="1", ENV{MPATH_DEVICE_READY}="0", \ -- GOTO="mpath_action" -+ GOTO="check_mpath_unchanged" - - # If the last path has failed mark the device not ready - # Note that DM_NR_VALID_PATHS is only set for PATH_FAILED|PATH_REINSTATED - # events. - # This may not be reliable, as events aren't necessarily received in order. --ENV{DM_NR_VALID_PATHS}=="0", ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action" -+ENV{DM_NR_VALID_PATHS}=="0", ENV{MPATH_DEVICE_READY}="0", GOTO="check_mpath_unchanged" - - # Don't run multipath -U during "coldplug" after switching root, - # because paths are just being added to the udev db. -@@ -53,7 +53,8 @@ ACTION=="add", ENV{.MPATH_DEVICE_READY_OLD}=="1", GOTO="paths_ok" - # Check the map state directly with multipath -U. - # This doesn't attempt I/O on the device. - PROGRAM=="@BINDIR@/multipath -U -v1 %k", GOTO="paths_ok" --ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action" -+ENV{MPATH_DEVICE_READY}="0", GOTO="check_mpath_unchanged" -+ - LABEL="paths_ok" - - # For PATH_FAILED events, keep the existing value of MPATH_DEVICE_READY. -@@ -61,7 +62,7 @@ LABEL="paths_ok" - # table reload where there are active paths. Mark the device ready. - ENV{DM_ACTION}!="PATH_FAILED", ENV{MPATH_DEVICE_READY}="1" - --LABEL="mpath_action" -+LABEL="check_mpath_unchanged" - - # A previous coldplug event occurred while the device was suspended. - # Activation might have been partially skipped. Activate the device now, -@@ -70,7 +71,7 @@ IMPORT{db}="DM_COLDPLUG_SUSPENDED" - ENV{DM_COLDPLUG_SUSPENDED}=="1", ENV{.DM_SUSPENDED}!="1", \ - ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0", \ - PROGRAM="/bin/logger -t 11-dm-mpath.rules -p daemon.notice \"Forcing activation of previously suspended device\"", \ -- GOTO="force_activation" -+ GOTO="check_mpath_ready" - - # DM_SUBSYSTEM_UDEV_FLAG0 is the "RELOAD" flag for multipath subsystem. - # Drop the DM_ACTIVATION flag here as mpath reloads tables if any of its -@@ -86,7 +87,7 @@ ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", \ - ENV{DM_ACTION}=="PATH_FAILED|PATH_REINSTATED", \ - ENV{DM_ACTIVATION}="0", ENV{MPATH_UNCHANGED}="1" - --LABEL="force_activation" -+LABEL="check_mpath_ready" - - ENV{MPATH_DEVICE_READY}!="0", GOTO="mpath_is_ready" - # Do not initiate scanning if no path is available, -@@ -100,7 +101,7 @@ ENV{MPATH_DEVICE_READY}!="0", GOTO="mpath_is_ready" - ENV{DM_UDEV_RULES_VSN}=="1|2", \ - ENV{.MPATH_SAVE_DISABLE_OTHER_RULES_FLAG}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}" - ENV{.DM_NOSCAN}="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" --GOTO="dont_activate" -+GOTO="scan_import" - - LABEL="mpath_is_ready" - -@@ -109,11 +110,10 @@ LABEL="mpath_is_ready" - # we have to postpone the activation until the next event. - # In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the - # MPATH_UNCHANGED logic will cause later rules to skipped in the next event. --ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="dont_activate" --ENV{.DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="dont_activate" -+ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="scan_import" -+ENV{.DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="scan_import" - - ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" --LABEL="dont_activate" - - # The code to check multipath state ends here. We need to set - # properties and symlinks regardless whether the map is usable or diff --git a/0017-kpartx.rules-ignore-DM_SUSPENDED.patch b/0017-kpartx.rules-ignore-DM_SUSPENDED.patch deleted file mode 100644 index 3b0ac76..0000000 --- a/0017-kpartx.rules-ignore-DM_SUSPENDED.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 1 Mar 2024 21:17:26 +0100 -Subject: [PATCH] kpartx.rules: ignore DM_SUSPENDED - -DM_SUSPENDED=1 implies DM_UDEV_DISABLE_OTHER_RULES_FLAG=1, no -need to check it again. The DM_NOSCAN check needs to remain in -order to keep compatibility with dm rules v2. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - kpartx/kpartx.rules | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules -index 1969dee0..8dd3369c 100644 ---- a/kpartx/kpartx.rules -+++ b/kpartx/kpartx.rules -@@ -27,7 +27,7 @@ ENV{DM_SUBSYSTEM_UDEV_FLAG1}=="1", GOTO="mpath_kpartx_end" - ENV{MPATH_UNCHANGED}=="1", GOTO="mpath_kpartx_end" - - # Don't run kpartx now if we know it will fail or hang. --ENV{DM_SUSPENDED}=="1", GOTO="mpath_kpartx_end" -+# This is required for device mapper rules v2 compatibility. - ENV{DM_NOSCAN}=="1", GOTO="mpath_kpartx_end" - - # Run kpartx diff --git a/0018-multipath-tools-tests-fix-CI-failures-on-arm-v7-with.patch b/0018-multipath-tools-tests-fix-CI-failures-on-arm-v7-with.patch deleted file mode 100644 index 2840cec..0000000 --- a/0018-multipath-tools-tests-fix-CI-failures-on-arm-v7-with.patch +++ /dev/null @@ -1,270 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 4 Apr 2024 23:23:28 +0200 -Subject: [PATCH] multipath-tools tests: fix CI failures on arm/v7 with glibc - 2.37 - -glibc 2.37 has added several new wrappers around the ioctl and -io_getevents system calls on 32 bit systems, to deal with 64bit -time_t. These aren't resolved with cmocka's wrapping technique. - -Fix this with C preprocessor trickery, similar to -7b217f8 ("multipath-tools: Makefile.inc: set _FILE_OFFSET_BITS=64"). - -Note: the directio test with DIO_TEST_DEV for fails under qemu-linux-user -with foreign-arch binfmt, because aio-related system calls are unsupported -by qemu-linux-user. See https://gitlab.com/qemu-project/qemu/-/issues/210. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - tests/directio.c | 28 ++++++++++++++-------------- - tests/vpd.c | 35 ++++++++++++++++++----------------- - tests/wrap64.h | 25 ++++++++++++++++++++++++- - 3 files changed, 56 insertions(+), 32 deletions(-) - -diff --git a/tests/directio.c b/tests/directio.c -index cbedcc9c..d5f84f10 100644 ---- a/tests/directio.c -+++ b/tests/directio.c -@@ -41,13 +41,13 @@ struct timespec full_timeout = { .tv_sec = -1 }; - #define ioctl_request_t int - #endif - --int __real_ioctl(int fd, ioctl_request_t request, void *argp); -+int REAL_IOCTL(int fd, ioctl_request_t request, void *argp); - --int __wrap_ioctl(int fd, ioctl_request_t request, void *argp) -+int WRAP_IOCTL(int fd, ioctl_request_t request, void *argp) - { - #ifdef DIO_TEST_DEV - mock_type(int); -- return __real_ioctl(fd, request, argp); -+ return REAL_IOCTL(fd, request, argp); - #else - int *blocksize = (int *)argp; - -@@ -148,10 +148,10 @@ int __wrap_io_cancel(io_context_t ctx, struct iocb *iocb, struct io_event *evt) - #endif - } - --int __real_io_getevents(io_context_t ctx, long min_nr, long nr, -+int REAL_IO_GETEVENTS(io_context_t ctx, long min_nr, long nr, - struct io_event *events, struct timespec *timeout); - --int __wrap_io_getevents(io_context_t ctx, long min_nr, long nr, -+int WRAP_IO_GETEVENTS(io_context_t ctx, long min_nr, long nr, - struct io_event *events, struct timespec *timeout) - { - int nr_evs; -@@ -169,8 +169,8 @@ int __wrap_io_getevents(io_context_t ctx, long min_nr, long nr, - #ifdef DIO_TEST_DEV - mock_ptr_type(struct timespec *); - mock_ptr_type(struct io_event *); -- assert_int_equal(nr_evs, __real_io_getevents(ctx, min_nr, nr_evs, -- events, timeout)); -+ assert_int_equal(nr_evs, REAL_IO_GETEVENTS(ctx, min_nr, nr_evs, -+ events, timeout)); - #else - sleep_tmo = mock_ptr_type(struct timespec *); - if (sleep_tmo) { -@@ -193,7 +193,7 @@ int __wrap_io_getevents(io_context_t ctx, long min_nr, long nr, - - static void return_io_getevents_none(void) - { -- will_return(__wrap_io_getevents, 0); -+ wrap_will_return(WRAP_IO_GETEVENTS, 0); - } - - static void return_io_getevents_nr(struct timespec *ts, int nr, -@@ -207,15 +207,15 @@ static void return_io_getevents_nr(struct timespec *ts, int nr, - mock_events[i + ev_off].res = reqs[i]->blksize; - } - while (nr > 0) { -- will_return(__wrap_io_getevents, (nr > 128)? 128 : nr); -- will_return(__wrap_io_getevents, ts); -- will_return(__wrap_io_getevents, &mock_events[off + ev_off]); -+ wrap_will_return(WRAP_IO_GETEVENTS, (nr > 128)? 128 : nr); -+ wrap_will_return(WRAP_IO_GETEVENTS, ts); -+ wrap_will_return(WRAP_IO_GETEVENTS, &mock_events[off + ev_off]); - ts = NULL; - off += 128; - nr -= 128; - } - if (nr == 0) -- will_return(__wrap_io_getevents, 0); -+ wrap_will_return(WRAP_IO_GETEVENTS, 0); - ev_off += i; - } - -@@ -251,7 +251,7 @@ static void do_libcheck_init(struct checker *c, int blocksize, - struct directio_context * ct; - - c->fd = test_fd; -- will_return(__wrap_ioctl, blocksize); -+ wrap_will_return(WRAP_IOCTL, blocksize); - assert_int_equal(libcheck_init(c), 0); - ct = (struct directio_context *)c->context; - assert_non_null(ct); -@@ -762,7 +762,7 @@ int main(void) - { - int ret = 0; - -- init_test_verbosity(2); -+ init_test_verbosity(5); - ret += test_directio(); - return ret; - } -diff --git a/tests/vpd.c b/tests/vpd.c -index 1b2d62d6..e3212e61 100644 ---- a/tests/vpd.c -+++ b/tests/vpd.c -@@ -20,6 +20,7 @@ - #include "vector.h" - #include "structs.h" - #include "discovery.h" -+#include "wrap64.h" - #include "globals.c" - - #define VPD_BUFSIZ 4096 -@@ -58,7 +59,7 @@ static const char vendor_id[] = "Linux"; - static const char test_id[] = - "A123456789AbcDefB123456789AbcDefC123456789AbcDefD123456789AbcDef"; - --int __wrap_ioctl(int fd, unsigned long request, void *param) -+int WRAP_IOCTL(int fd, unsigned long request, void *param) - { - int len; - struct sg_io_hdr *io_hdr; -@@ -428,8 +429,8 @@ static void test_vpd_vnd_ ## len ## _ ## wlen(void **state) \ - /* Replace spaces, like code under test */ \ - exp_subst = subst_spaces(exp_wwid); \ - free(exp_wwid); \ -- will_return(__wrap_ioctl, n); \ -- will_return(__wrap_ioctl, vt->vpdbuf); \ -+ wrap_will_return(WRAP_IOCTL, n); \ -+ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ - ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen); \ - assert_correct_wwid("test_vpd_vnd_" #len "_" #wlen, \ - exp_len, ret, '1', 0, false, \ -@@ -458,8 +459,8 @@ static void test_vpd_str_ ## typ ## _ ## len ## _ ## wlen(void **state) \ - exp_len--; \ - if (exp_len >= wlen) \ - exp_len = wlen - 1; \ -- will_return(__wrap_ioctl, n); \ -- will_return(__wrap_ioctl, vt->vpdbuf); \ -+ wrap_will_return(WRAP_IOCTL, n); \ -+ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ - ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen); \ - assert_correct_wwid("test_vpd_str_" #typ "_" #len "_" #wlen, \ - exp_len, ret, byte0[type], 0, \ -@@ -495,8 +496,8 @@ static void test_vpd_naa_ ## naa ## _ ## wlen(void **state) \ - \ - n = create_vpd83(vt->vpdbuf, sizeof(vt->vpdbuf), test_id, \ - 3, naa, 0); \ -- will_return(__wrap_ioctl, n); \ -- will_return(__wrap_ioctl, vt->vpdbuf); \ -+ wrap_will_return(WRAP_IOCTL, n); \ -+ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ - ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen); \ - assert_correct_wwid("test_vpd_naa_" #naa "_" #wlen, \ - exp_len, ret, '3', '0' + naa, true, \ -@@ -518,8 +519,8 @@ static void test_vpd_naa_##NAA##_badlen_##BAD(void **state) \ - n = create_vpd83(vt->vpdbuf, sizeof(vt->vpdbuf), test_id, 3, NAA, 0); \ - \ - vt->vpdbuf[7] = BAD; \ -- will_return(__wrap_ioctl, n); \ -- will_return(__wrap_ioctl, vt->vpdbuf); \ -+ wrap_will_return(WRAP_IOCTL, n); \ -+ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ - ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, 40); \ - assert_int_equal(-ret, -ERR); \ - } -@@ -545,11 +546,11 @@ static void test_vpd_eui_ ## len ## _ ## wlen ## _ ## sml(void **state) \ - /* overwrite the page size to DEFAULT_SGIO_LEN + 1 */ \ - put_unaligned_be16(255, vt->vpdbuf + 2); \ - /* this causes get_vpd_sgio to do a second ioctl */ \ -- will_return(__wrap_ioctl, n); \ -- will_return(__wrap_ioctl, vt->vpdbuf); \ -+ wrap_will_return(WRAP_IOCTL, n); \ -+ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ - } \ -- will_return(__wrap_ioctl, n); \ -- will_return(__wrap_ioctl, vt->vpdbuf); \ -+ wrap_will_return(WRAP_IOCTL, n); \ -+ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ - ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen); \ - assert_correct_wwid("test_vpd_eui_" #len "_" #wlen "_" #sml, \ - exp_len, ret, '2', 0, true, \ -@@ -571,8 +572,8 @@ static void test_vpd_eui_badlen_##LEN##_##BAD(void **state) \ - n = create_vpd83(vt->vpdbuf, sizeof(vt->vpdbuf), test_id, 2, 0, LEN); \ - \ - vt->vpdbuf[7] = BAD; \ -- will_return(__wrap_ioctl, n); \ -- will_return(__wrap_ioctl, vt->vpdbuf); \ -+ wrap_will_return(WRAP_IOCTL, n); \ -+ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ - ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, 40); \ - assert_int_equal(ret, ERR); \ - if (ERR >= 0) \ -@@ -600,8 +601,8 @@ static void test_vpd80_ ## size ## _ ## len ## _ ## wlen(void **state) \ - exp_len = wlen - 1; \ - n = create_vpd80(vt->vpdbuf, sizeof(vt->vpdbuf), input, \ - size, len); \ -- will_return(__wrap_ioctl, n); \ -- will_return(__wrap_ioctl, vt->vpdbuf); \ -+ wrap_will_return(WRAP_IOCTL, n); \ -+ wrap_will_return(WRAP_IOCTL, vt->vpdbuf); \ - ret = get_vpd_sgio(10, 0x80, 0, vt->wwid, wlen); \ - assert_correct_wwid("test_vpd80_" #size "_" #len "_" #wlen, \ - exp_len, ret, 0, 0, false, \ -diff --git a/tests/wrap64.h b/tests/wrap64.h -index 8c91d279..b0a4d831 100644 ---- a/tests/wrap64.h -+++ b/tests/wrap64.h -@@ -1,5 +1,7 @@ - #ifndef _WRAP64_H - #define _WRAP64_H 1 -+#include -+#include - #include "util.h" - - /* -@@ -31,7 +33,9 @@ - * fcntl() needs special treatment; fcntl64() has been introduced in 2.28. - * https://savannah.gnu.org/forum/forum.php?forum_id=9205 - */ --#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 28) -+#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 37) && defined(__arm__) && __ARM_ARCH == 7 -+#define WRAP_FCNTL_NAME __fcntl_time64 -+#elif defined(__GLIBC__) && __GLIBC_PREREQ(2, 28) - #define WRAP_FCNTL_NAME WRAP_NAME(fcntl) - #else - #define WRAP_FCNTL_NAME fcntl -@@ -39,6 +43,25 @@ - #define WRAP_FCNTL CONCAT2(__wrap_, WRAP_FCNTL_NAME) - #define REAL_FCNTL CONCAT2(__real_, WRAP_FCNTL_NAME) - -+/* -+ * glibc 2.37 uses __ioctl_time64 for ioctl -+ */ -+#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 37) && defined(__arm__) && __ARM_ARCH == 7 -+#define WRAP_IOCTL_NAME __ioctl_time64 -+#else -+#define WRAP_IOCTL_NAME ioctl -+#endif -+#define WRAP_IOCTL CONCAT2(__wrap_, WRAP_IOCTL_NAME) -+#define REAL_IOCTL CONCAT2(__real_, WRAP_IOCTL_NAME) -+ -+#if defined(__NR_io_pgetevents) && __BITS_PER_LONG == 32 && defined(_TIME_BITS) && _TIME_BITS == 64 -+#define WRAP_IO_GETEVENTS_NAME io_getevents_time64 -+#else -+#define WRAP_IO_GETEVENTS_NAME io_getevents -+#endif -+#define WRAP_IO_GETEVENTS CONCAT2(__wrap_, WRAP_IO_GETEVENTS_NAME) -+#define REAL_IO_GETEVENTS CONCAT2(__real_, WRAP_IO_GETEVENTS_NAME) -+ - /* - * will_return() is itself a macro that uses CPP "stringizing". We need a - * macro indirection to make sure the *value* of WRAP_FUNC() is stringized diff --git a/0019-multipath-tools-tests-fix-CI-failures-with-clang-on-.patch b/0019-multipath-tools-tests-fix-CI-failures-with-clang-on-.patch deleted file mode 100644 index d1dedac..0000000 --- a/0019-multipath-tools-tests-fix-CI-failures-with-clang-on-.patch +++ /dev/null @@ -1,246 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 5 Apr 2024 22:21:43 +0200 -Subject: [PATCH] multipath-tools tests: fix CI failures with clang on Fedora - Rawhide - -Fedora's glibc 2.39 includes the following patch: - -https://patches.linaro.org/project/libc-alpha/patch/20240208184622.332678-10-adhemerval.zanella@linaro.org/ - -It causes open("file", O_RDONLY) to resolve to __open64_2(), -whereas it resolves to open64() with gcc, causing CI failures because of -wrong wrapper substitutions. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - tests/dmevents.c | 6 ++--- - tests/sysfs.c | 58 ++++++++++++++++++++++++------------------------ - tests/test-lib.c | 6 ++--- - tests/wrap64.h | 14 ++++++++++++ - 4 files changed, 49 insertions(+), 35 deletions(-) - -diff --git a/tests/dmevents.c b/tests/dmevents.c -index 540bf0d3..395b16d7 100644 ---- a/tests/dmevents.c -+++ b/tests/dmevents.c -@@ -207,7 +207,7 @@ static int teardown(void **state) - return 0; - } - --int WRAP_FUNC(open)(const char *pathname, int flags) -+int WRAP_OPEN(const char *pathname, int flags) - { - assert_ptr_equal(pathname, "/dev/mapper/control"); - assert_int_equal(flags, O_RDWR); -@@ -389,7 +389,7 @@ static void test_init_waiter_bad1(void **state) - struct test_data *datap = (struct test_data *)(*state); - if (datap == NULL) - skip(); -- wrap_will_return(WRAP_FUNC(open), -1); -+ wrap_will_return(WRAP_OPEN, -1); - assert_int_equal(init_dmevent_waiter(&datap->vecs), -1); - assert_ptr_equal(waiter, NULL); - } -@@ -400,7 +400,7 @@ static void test_init_waiter_good0(void **state) - struct test_data *datap = (struct test_data *)(*state); - if (datap == NULL) - skip(); -- wrap_will_return(WRAP_FUNC(open), 2); -+ wrap_will_return(WRAP_OPEN, 2); - assert_int_equal(init_dmevent_waiter(&datap->vecs), 0); - assert_ptr_not_equal(waiter, NULL); - } -diff --git a/tests/sysfs.c b/tests/sysfs.c -index fc256d87..c623d1bb 100644 ---- a/tests/sysfs.c -+++ b/tests/sysfs.c -@@ -29,7 +29,7 @@ char *__wrap_udev_device_get_syspath(struct udev_device *ud) - return val; - } - --int WRAP_FUNC(open)(const char *pathname, int flags) -+int WRAP_OPEN(const char *pathname, int flags) - { - int ret; - -@@ -167,10 +167,10 @@ static void test_sagv_open_fail(void **state) - - will_return(__wrap_udev_device_get_syspath, "/foo"); - expect_condlog(4, "open '/foo/bar'"); -- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); -- expect_value(WRAP_FUNC(open), flags, O_RDONLY); -+ expect_string(WRAP_OPEN, pathname, "/foo/bar"); -+ expect_value(WRAP_OPEN, flags, O_RDONLY); - errno = ENOENT; -- wrap_will_return(WRAP_FUNC(open), -1); -+ wrap_will_return(WRAP_OPEN, -1); - expect_condlog(3, "__sysfs_attr_get_value: attribute '/foo/bar' cannot be opened"); - assert_int_equal(sysfs_attr_get_value((void *)state, "bar", - buf, sizeof(buf)), -ENOENT); -@@ -182,9 +182,9 @@ static void test_sagv_read_fail(void **state) - - will_return(__wrap_udev_device_get_syspath, "/foo"); - expect_condlog(4, "open '/foo/bar'"); -- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); -- expect_value(WRAP_FUNC(open), flags, O_RDONLY); -- wrap_will_return(WRAP_FUNC(open), TEST_FD); -+ expect_string(WRAP_OPEN, pathname, "/foo/bar"); -+ expect_value(WRAP_OPEN, flags, O_RDONLY); -+ wrap_will_return(WRAP_OPEN, TEST_FD); - expect_value(__wrap_read, fd, TEST_FD); - expect_value(__wrap_read, count, sizeof(buf)); - errno = EISDIR; -@@ -197,9 +197,9 @@ static void test_sagv_read_fail(void **state) - - will_return(__wrap_udev_device_get_syspath, "/foo"); - expect_condlog(4, "open '/foo/baz'"); -- expect_string(WRAP_FUNC(open), pathname, "/foo/baz"); -- expect_value(WRAP_FUNC(open), flags, O_RDONLY); -- wrap_will_return(WRAP_FUNC(open), TEST_FD); -+ expect_string(WRAP_OPEN, pathname, "/foo/baz"); -+ expect_value(WRAP_OPEN, flags, O_RDONLY); -+ wrap_will_return(WRAP_OPEN, TEST_FD); - expect_value(__wrap_read, fd, TEST_FD); - expect_value(__wrap_read, count, sizeof(buf)); - errno = EPERM; -@@ -223,9 +223,9 @@ static void _test_sagv_read(void **state, unsigned int bufsz) - memset(buf, '.', sizeof(buf)); - will_return(__wrap_udev_device_get_syspath, "/foo"); - expect_condlog(4, "open '/foo/bar'"); -- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); -- expect_value(WRAP_FUNC(open), flags, O_RDONLY); -- wrap_will_return(WRAP_FUNC(open), TEST_FD); -+ expect_string(WRAP_OPEN, pathname, "/foo/bar"); -+ expect_value(WRAP_OPEN, flags, O_RDONLY); -+ wrap_will_return(WRAP_OPEN, TEST_FD); - expect_value(__wrap_read, fd, TEST_FD); - expect_value(__wrap_read, count, bufsz); - will_return(__wrap_read, sizeof(input) - 1); -@@ -250,9 +250,9 @@ static void _test_sagv_read(void **state, unsigned int bufsz) - memset(buf, '.', sizeof(buf)); - will_return(__wrap_udev_device_get_syspath, "/foo"); - expect_condlog(4, "open '/foo/baz'"); -- expect_string(WRAP_FUNC(open), pathname, "/foo/baz"); -- expect_value(WRAP_FUNC(open), flags, O_RDONLY); -- wrap_will_return(WRAP_FUNC(open), TEST_FD); -+ expect_string(WRAP_OPEN, pathname, "/foo/baz"); -+ expect_value(WRAP_OPEN, flags, O_RDONLY); -+ wrap_will_return(WRAP_OPEN, TEST_FD); - expect_value(__wrap_read, fd, TEST_FD); - expect_value(__wrap_read, count, bufsz); - will_return(__wrap_read, sizeof(input) - 1); -@@ -301,9 +301,9 @@ static void _test_sagv_read_zeroes(void **state, unsigned int bufsz) - memset(buf, '.', sizeof(buf)); - will_return(__wrap_udev_device_get_syspath, "/foo"); - expect_condlog(4, "open '/foo/bar'"); -- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); -- expect_value(WRAP_FUNC(open), flags, O_RDONLY); -- wrap_will_return(WRAP_FUNC(open), TEST_FD); -+ expect_string(WRAP_OPEN, pathname, "/foo/bar"); -+ expect_value(WRAP_OPEN, flags, O_RDONLY); -+ wrap_will_return(WRAP_OPEN, TEST_FD); - expect_value(__wrap_read, fd, TEST_FD); - expect_value(__wrap_read, count, bufsz); - will_return(__wrap_read, sizeof(input) - 1); -@@ -386,10 +386,10 @@ static void test_sasv_open_fail(void **state) - - will_return(__wrap_udev_device_get_syspath, "/foo"); - expect_condlog(4, "open '/foo/bar'"); -- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); -- expect_value(WRAP_FUNC(open), flags, O_WRONLY); -+ expect_string(WRAP_OPEN, pathname, "/foo/bar"); -+ expect_value(WRAP_OPEN, flags, O_WRONLY); - errno = EPERM; -- wrap_will_return(WRAP_FUNC(open), -1); -+ wrap_will_return(WRAP_OPEN, -1); - expect_condlog(3, "sysfs_attr_set_value: attribute '/foo/bar' cannot be opened"); - assert_int_equal(sysfs_attr_set_value((void *)state, "bar", - buf, sizeof(buf)), -EPERM); -@@ -401,9 +401,9 @@ static void test_sasv_write_fail(void **state) - - will_return(__wrap_udev_device_get_syspath, "/foo"); - expect_condlog(4, "open '/foo/bar'"); -- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); -- expect_value(WRAP_FUNC(open), flags, O_WRONLY); -- wrap_will_return(WRAP_FUNC(open), TEST_FD); -+ expect_string(WRAP_OPEN, pathname, "/foo/bar"); -+ expect_value(WRAP_OPEN, flags, O_WRONLY); -+ wrap_will_return(WRAP_OPEN, TEST_FD); - expect_value(__wrap_write, fd, TEST_FD); - expect_value(__wrap_write, count, sizeof(buf)); - errno = EISDIR; -@@ -422,9 +422,9 @@ static void _test_sasv_write(void **state, unsigned int n_written) - assert_in_range(n_written, 0, sizeof(buf)); - will_return(__wrap_udev_device_get_syspath, "/foo"); - expect_condlog(4, "open '/foo/bar'"); -- expect_string(WRAP_FUNC(open), pathname, "/foo/bar"); -- expect_value(WRAP_FUNC(open), flags, O_WRONLY); -- wrap_will_return(WRAP_FUNC(open), TEST_FD); -+ expect_string(WRAP_OPEN, pathname, "/foo/bar"); -+ expect_value(WRAP_OPEN, flags, O_WRONLY); -+ wrap_will_return(WRAP_OPEN, TEST_FD); - expect_value(__wrap_write, fd, TEST_FD); - expect_value(__wrap_write, count, sizeof(buf)); - will_return(__wrap_write, n_written); -@@ -489,7 +489,7 @@ int main(void) - { - int ret = 0; - -- init_test_verbosity(4); -+ init_test_verbosity(5); - ret += test_sysfs(); - return ret; - } -diff --git a/tests/test-lib.c b/tests/test-lib.c -index 665d438e..cdb2780d 100644 ---- a/tests/test-lib.c -+++ b/tests/test-lib.c -@@ -40,17 +40,17 @@ const char default_wwid_1[] = "TEST-WWID-1"; - */ - - --int REAL_FUNC(open)(const char *path, int flags, int mode); -+int REAL_OPEN(const char *path, int flags, int mode); - - static const char _mocked_filename[] = "mocked_path"; - --int WRAP_FUNC(open)(const char *path, int flags, int mode) -+int WRAP_OPEN(const char *path, int flags, int mode) - { - condlog(4, "%s: %s", __func__, path); - - if (!strcmp(path, _mocked_filename)) - return 111; -- return REAL_FUNC(open)(path, flags, mode); -+ return REAL_OPEN(path, flags, mode); - } - - int __wrap_libmp_get_version(int which, unsigned int version[3]) -diff --git a/tests/wrap64.h b/tests/wrap64.h -index b0a4d831..7e434206 100644 ---- a/tests/wrap64.h -+++ b/tests/wrap64.h -@@ -29,6 +29,20 @@ - #define WRAP_FUNC(x) CONCAT2(__wrap_, WRAP_NAME(x)) - #define REAL_FUNC(x) CONCAT2(__real_, WRAP_NAME(x)) - -+/* -+ * With clang, glibc 2.39, and _FILE_OFFSET_BITS==64, -+ * open() resolves to __open64_2(). -+ */ -+#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 39) && \ -+ defined(__clang__) && __clang__ == 1 && \ -+ defined(__fortify_use_clang) && __fortify_use_clang == 1 -+#define WRAP_OPEN_NAME __open64_2 -+#else -+#define WRAP_OPEN_NAME WRAP_NAME(open) -+#endif -+#define WRAP_OPEN CONCAT2(__wrap_, WRAP_OPEN_NAME) -+#define REAL_OPEN CONCAT2(__real_, WRAP_OPEN_NAME) -+ - /* - * fcntl() needs special treatment; fcntl64() has been introduced in 2.28. - * https://savannah.gnu.org/forum/forum.php?forum_id=9205 diff --git a/0020-GitHub-actions-fixes-for-spelling-CI.patch b/0020-GitHub-actions-fixes-for-spelling-CI.patch deleted file mode 100644 index 21b74ff..0000000 --- a/0020-GitHub-actions-fixes-for-spelling-CI.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 8 Mar 2024 10:04:39 +0100 -Subject: [PATCH] GitHub actions: fixes for spelling CI - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/actions/spelling/patterns.txt | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt -index 57767ea1..858faee6 100644 ---- a/.github/actions/spelling/patterns.txt -+++ b/.github/actions/spelling/patterns.txt -@@ -22,6 +22,7 @@ - \bdmmp_pgs\b - \bdmmp_mpath_kdev_name_get\b - \bfast_io_fail_tmo\b -+\bLimitRTPRIO\b - \bmax_fds\b - \bmissing_uev_wait_timeout\b - \bMPATH_MAX_PARAM_LEN\b -@@ -86,6 +87,7 @@ - \bprin_resvdescr\b - \bprout_param_descriptor\b - \brq_servact\b -+\bSCHED_RT_PRIO\b - \bssize_t\b - \btrnptid_list\b - \buxsock_timeout\b diff --git a/0021-GitHub-workflows-run-workflows-if-workflow-file-has-.patch b/0021-GitHub-workflows-run-workflows-if-workflow-file-has-.patch deleted file mode 100644 index 59cdd0e..0000000 --- a/0021-GitHub-workflows-run-workflows-if-workflow-file-has-.patch +++ /dev/null @@ -1,146 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Tue, 27 Feb 2024 09:57:47 +0100 -Subject: [PATCH] GitHub workflows: run workflows if workflow file has changed - -We want to run workflows if the workflow file itself has changed. - -Fixes: 2cbe81a ("GitHub Workflows: run expensive workflows only on relevant changes") -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/workflows/abi.yaml | 1 + - .github/workflows/foreign.yaml | 2 ++ - .github/workflows/multiarch-stable.yaml | 2 ++ - .github/workflows/multiarch.yaml | 2 ++ - .github/workflows/native.yaml | 2 ++ - .github/workflows/rolling.yaml | 2 ++ - .github/workflows/spelling.yml | 2 ++ - 7 files changed, 13 insertions(+) - -diff --git a/.github/workflows/abi.yaml b/.github/workflows/abi.yaml -index 53382420..393322e5 100644 ---- a/.github/workflows/abi.yaml -+++ b/.github/workflows/abi.yaml -@@ -5,6 +5,7 @@ on: - - queue - - abi - paths: -+ - '.github/workflows/abi.yaml' - - '**.h' - - '**.c' - pull_request: -diff --git a/.github/workflows/foreign.yaml b/.github/workflows/foreign.yaml -index 92f6d17a..a62ae009 100644 ---- a/.github/workflows/foreign.yaml -+++ b/.github/workflows/foreign.yaml -@@ -6,6 +6,7 @@ on: - - queue - - tip - paths: -+ - '.github/workflows/foreign.yaml' - - '**.h' - - '**.c' - - '**Makefile*' -@@ -15,6 +16,7 @@ on: - - master - - queue - paths: -+ - '.github/workflows/foreign.yaml' - - '**.h' - - '**.c' - - '**Makefile*' -diff --git a/.github/workflows/multiarch-stable.yaml b/.github/workflows/multiarch-stable.yaml -index 45b74c51..e51d383c 100644 ---- a/.github/workflows/multiarch-stable.yaml -+++ b/.github/workflows/multiarch-stable.yaml -@@ -6,6 +6,7 @@ on: - - queue - - tip - paths: -+ - '.github/workflows/multiarch-stable.yaml' - - '**.h' - - '**.c' - - '**Makefile*' -@@ -15,6 +16,7 @@ on: - - master - - queue - paths: -+ - '.github/workflows/multiarch-stable.yaml' - - '**.h' - - '**.c' - - '**Makefile*' -diff --git a/.github/workflows/multiarch.yaml b/.github/workflows/multiarch.yaml -index b4dec9c7..7b762e5c 100644 ---- a/.github/workflows/multiarch.yaml -+++ b/.github/workflows/multiarch.yaml -@@ -6,6 +6,7 @@ on: - - queue - - tip - paths: -+ - '.github/workflows/multiarch.yaml' - - '**.h' - - '**.c' - - '**Makefile*' -@@ -15,6 +16,7 @@ on: - - master - - queue - paths: -+ - '.github/workflows/multiarch.yaml' - - '**.h' - - '**.c' - - '**Makefile*' -diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml -index 09133c1e..0ef9df94 100644 ---- a/.github/workflows/native.yaml -+++ b/.github/workflows/native.yaml -@@ -6,6 +6,7 @@ on: - - queue - - tip - paths: -+ - '.github/workflows/native.yaml' - - '**.h' - - '**.c' - - '**Makefile*' -@@ -15,6 +16,7 @@ on: - - master - - queue - paths: -+ - '.github/workflows/native.yaml' - - '**.h' - - '**.c' - - '**Makefile*' -diff --git a/.github/workflows/rolling.yaml b/.github/workflows/rolling.yaml -index 1f1507ee..3536b944 100644 ---- a/.github/workflows/rolling.yaml -+++ b/.github/workflows/rolling.yaml -@@ -6,6 +6,7 @@ on: - - queue - - tip - paths: -+ - '.github/workflows/rolling.yaml' - - '**.h' - - '**.c' - - '**Makefile*' -@@ -15,6 +16,7 @@ on: - - master - - queue - paths: -+ - '.github/workflows/rolling.yaml' - - '**.h' - - '**.c' - - '**Makefile*' -diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml -index 0416fa9e..7943ebb8 100644 ---- a/.github/workflows/spelling.yml -+++ b/.github/workflows/spelling.yml -@@ -63,7 +63,9 @@ on: - tags-ignore: - - "**" - paths: -+ - '.github/workflows/spelling.yml' - - 'README*' -+ - 'NEWS.md' - - '**.3' - - '**.5' - - '**.8' diff --git a/0022-multipath-tools-add-TGTDIR-option.patch b/0022-multipath-tools-add-TGTDIR-option.patch deleted file mode 100644 index d26fb18..0000000 --- a/0022-multipath-tools-add-TGTDIR-option.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 17 Apr 2024 14:44:45 +0200 -Subject: [PATCH] multipath-tools: add TGTDIR option - -TGTDIR is a convenience option for developers for building multipath-tools such -that compiled-in paths of the plugins, config files, etc. match an -installation under some optional path. See README.md for instructions and -examples. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - .github/actions/spelling/expect.txt | 2 ++ - Makefile.inc | 8 +++---- - README.md | 33 +++++++++++++++++++++++++++++ - 3 files changed, 39 insertions(+), 4 deletions(-) - -diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt -index 5906403d..fc9f22f8 100644 ---- a/.github/actions/spelling/expect.txt -+++ b/.github/actions/spelling/expect.txt -@@ -167,6 +167,7 @@ retrigger - rhabarber - rootprefix - rootprefixdir -+rpmbuild - rport - rtpi - sas -@@ -200,6 +201,7 @@ tcp - TESTDEPS - testname - tgill -+TGTDIR - TIDS - tmo - tpg -diff --git a/Makefile.inc b/Makefile.inc -index 5668e638..81b86cd8 100644 ---- a/Makefile.inc -+++ b/Makefile.inc -@@ -101,9 +101,9 @@ WARNFLAGS := -Werror -Wall -Wextra -Wformat=2 $(WFORMATOVERFLOW) -Werror=implici - $(WNOCLOBBERED) -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) $(W_URCU_TYPE_LIMITS) - CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) \ - -D_FILE_OFFSET_BITS=64 \ -- -DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(plugindir)\" \ -- -DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(configdir)\" \ -- -DDEFAULT_CONFIGFILE=\"$(configfile)\" -DSTATE_DIR=\"$(statedir)\" \ -+ -DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(TGTDIR)$(plugindir)\" \ -+ -DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \ -+ -DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" -DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \ - -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP - CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe - BIN_CFLAGS := -fPIE -DPIE -@@ -149,4 +149,4 @@ NV_VERSION_SCRIPT = $(DEVLIB:%.so=%-nv.version) - - %: %.in - @echo creating $@ -- $(Q)sed 's:@CONFIGFILE@:'$(configfile)':g;s:@CONFIGDIR@:'$(configdir)':g;s:@STATE_DIR@:'$(statedir)':g;s:@RUNTIME_DIR@:'$(runtimedir)':g;s/@MODPROBE_UNIT@/'$(MODPROBE_UNIT)'/g;s:@BINDIR@:'$(bindir)':g' $< >$@ -+ $(Q)sed 's:@CONFIGFILE@:'$(TGTDIR)$(configfile)':g;s:@CONFIGDIR@:'$(TGTDIR)$(configdir)':g;s:@STATE_DIR@:'$(TGTDIR)$(statedir)':g;s:@RUNTIME_DIR@:'$(runtimedir)':g;s/@MODPROBE_UNIT@/'$(MODPROBE_UNIT)'/g;s:@BINDIR@:'$(bindir)':g' $< >$@ -diff --git a/README.md b/README.md -index d4f35f57..7207b14c 100644 ---- a/README.md -+++ b/README.md -@@ -151,6 +151,39 @@ sufficient control. See `Makefile.inc` for even more fine-grained control. - On such distributions, override `unitdir` and `libudevdir` to use systemd's - `rootprefix`: `make libudevdir=/lib/udev unitdir=/lib/systemd/system` - -+### prefix, DESTDIR and TGTDIR -+ -+`prefix` and related variables are included in compiled-in paths like -+`plugindir` and are used by `make install`. Using `prefix` is useful if -+multipath-tools is built locally on the same host where it's supposed to be -+installed. -+ -+By convention, the `DESTDIR` variable is prepended to all paths by `make -+install`, but not to any compiled-in paths. -+It is useful if the software is built on one system (build host) but intended -+to be run on another system (installation host). This is typically used in build -+systems like *rpmbuild* to set a root directory for all the installed -+files. -+ -+On the contrary, the `TGTDIR` variable is used for compiled-in paths only, and -+ignored by `make install`. It is useful for running multipath-tools in a separate -+subdirectory in the installation host, mostly for testing / development -+purposes. -+ -+For example, -+ -+ make prefix=/opt DESTDIR=/build TGTDIR=/test install -+ -+will install plugins into `/build/opt/lib64/multipath` on the build -+host. On the installation host, the plugins will be expected to be found under -+`/test/opt/lib64/multipath`. If the developer runs -+ -+ rsync -a $BUILD_HOST:$DESTDIR/ $INSTALL_HOST:$TGTDIR/ -+ -+and adds `$TGTDIR/lib64` to `LD_LIBRARY_PATH` on the installation host, the -+multipath binaries installed under `$TGTDIR` will find their plugins and -+configuration files in the expected compiled-in paths. -+ - ### Compiler Options - - Use `OPTFLAGS` to change optimization-related compiler options; diff --git a/0023-libmultipath-move-get_udev_for_mpp-to-sysfs.c.patch b/0023-libmultipath-move-get_udev_for_mpp-to-sysfs.c.patch deleted file mode 100644 index b59f879..0000000 --- a/0023-libmultipath-move-get_udev_for_mpp-to-sysfs.c.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 17 Apr 2024 17:18:18 +0200 -Subject: [PATCH] libmultipath: move get_udev_for_mpp to sysfs.c - -No functional changes, just code movement. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmultipath/configure.c | 20 -------------------- - libmultipath/sysfs.c | 19 +++++++++++++++++++ - libmultipath/sysfs.h | 4 ++++ - 3 files changed, 23 insertions(+), 20 deletions(-) - -diff --git a/libmultipath/configure.c b/libmultipath/configure.c -index 4ecf6ba4..89ac03d5 100644 ---- a/libmultipath/configure.c -+++ b/libmultipath/configure.c -@@ -453,26 +453,6 @@ pgcmp (struct multipath * mpp, struct multipath * cmpp) - return r; - } - --static struct udev_device * --get_udev_for_mpp(const struct multipath *mpp) --{ -- dev_t devnum; -- struct udev_device *udd; -- -- if (!mpp || !has_dm_info(mpp)) { -- condlog(1, "%s called with empty mpp", __func__); -- return NULL; -- } -- -- devnum = makedev(mpp->dmi.major, mpp->dmi.minor); -- udd = udev_device_new_from_devnum(udev, 'b', devnum); -- if (!udd) { -- condlog(1, "failed to get udev device for %s", mpp->alias); -- return NULL; -- } -- return udd; --} -- - void trigger_partitions_udev_change(struct udev_device *dev, - const char *action, int len) - { -diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c -index 328951ed..afe9de91 100644 ---- a/libmultipath/sysfs.c -+++ b/libmultipath/sysfs.c -@@ -339,3 +339,22 @@ bool sysfs_is_multipathed(struct path *pp, bool set_wwid) - - return found; - } -+ -+struct udev_device *get_udev_for_mpp(const struct multipath *mpp) -+{ -+ dev_t devnum; -+ struct udev_device *udd; -+ -+ if (!mpp || !has_dm_info(mpp)) { -+ condlog(1, "%s called with empty mpp", __func__); -+ return NULL; -+ } -+ -+ devnum = makedev(mpp->dmi.major, mpp->dmi.minor); -+ udd = udev_device_new_from_devnum(udev, 'b', devnum); -+ if (!udd) { -+ condlog(1, "failed to get udev device for %s", mpp->alias); -+ return NULL; -+ } -+ return udd; -+} -diff --git a/libmultipath/sysfs.h b/libmultipath/sysfs.h -index 2db86bd6..3be3f665 100644 ---- a/libmultipath/sysfs.h -+++ b/libmultipath/sysfs.h -@@ -39,4 +39,8 @@ do { \ - int sysfs_get_size (struct path *pp, unsigned long long * size); - int sysfs_check_holders(char * check_devt, char * new_devt); - bool sysfs_is_multipathed(struct path *pp, bool set_wwid); -+ -+struct multipath; -+struct udev_device *get_udev_for_mpp(const struct multipath *mpp); -+ - #endif diff --git a/0024-libmultipath-add-mp_find_path_by_devt.patch b/0024-libmultipath-add-mp_find_path_by_devt.patch deleted file mode 100644 index 8a85be2..0000000 --- a/0024-libmultipath-add-mp_find_path_by_devt.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 17 Apr 2024 14:57:33 +0200 -Subject: [PATCH] libmultipath: add mp_find_path_by_devt() - -A helper function that searches a struct multipath by dev_t, and -works whether or not mpp->paths is currently available. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmultipath/structs.c | 19 +++++++++++++++++++ - libmultipath/structs.h | 3 +++ - 2 files changed, 22 insertions(+) - -diff --git a/libmultipath/structs.c b/libmultipath/structs.c -index 74e31a13..e248fb51 100644 ---- a/libmultipath/structs.c -+++ b/libmultipath/structs.c -@@ -526,6 +526,25 @@ find_path_by_devt (const struct _vector *pathvec, const char * dev_t) - return NULL; - } - -+struct path *mp_find_path_by_devt(const struct multipath *mpp, const char *devt) -+{ -+ struct path *pp; -+ struct pathgroup *pgp; -+ unsigned int i, j; -+ -+ pp = find_path_by_devt(mpp->paths, devt); -+ if (pp) -+ return pp; -+ -+ vector_foreach_slot (mpp->pg, pgp, i){ -+ vector_foreach_slot (pgp->paths, pp, j){ -+ if (!strcmp(pp->dev_t, devt)) -+ return pp; -+ } -+ } -+ return NULL; -+} -+ - static int do_pathcount(const struct multipath *mpp, const int *states, - unsigned int nr_states) - { -diff --git a/libmultipath/structs.h b/libmultipath/structs.h -index 734905e2..a25eb9d5 100644 ---- a/libmultipath/structs.h -+++ b/libmultipath/structs.h -@@ -568,6 +568,9 @@ struct path * find_path_by_devt (const struct _vector *pathvec, const char *devt - struct path * find_path_by_dev (const struct _vector *pathvec, const char *dev); - struct path * first_path (const struct multipath *mpp); - -+struct path *mp_find_path_by_devt(const struct multipath *mpp, const char *devt); -+ -+ - int pathcount (const struct multipath *, int); - int count_active_paths(const struct multipath *); - int count_active_pending_paths(const struct multipath *); diff --git a/0025-Revert-libmultipath-fix-max_sectors_kb-on-adding-pat.patch b/0025-Revert-libmultipath-fix-max_sectors_kb-on-adding-pat.patch deleted file mode 100644 index aaa0e9f..0000000 --- a/0025-Revert-libmultipath-fix-max_sectors_kb-on-adding-pat.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 11 Apr 2024 17:20:14 +0200 -Subject: [PATCH] Revert "libmultipath: fix max_sectors_kb on adding path" - -This reverts commit bbb77f318ee483292f50a7782aecaecc7e60f727. -Reviewed-by: Benjamin Marzinski - -Signed-off-by: Benjamin Marzinski ---- - libmultipath/configure.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/libmultipath/configure.c b/libmultipath/configure.c -index 89ac03d5..13602f3f 100644 ---- a/libmultipath/configure.c -+++ b/libmultipath/configure.c -@@ -575,12 +575,11 @@ sysfs_set_max_sectors_kb(struct multipath *mpp, int is_reload) - ssize_t len; - int i, j, ret, err = 0; - struct udev_device *udd; -- int max_sectors_kb = mpp->max_sectors_kb; -+ int max_sectors_kb; - -- /* by default, do not initialize max_sectors_kb on the device */ -- if (max_sectors_kb == MAX_SECTORS_KB_UNDEF && !is_reload) -+ if (mpp->max_sectors_kb == MAX_SECTORS_KB_UNDEF) - return 0; -- /* on reload, re-apply the user tuning on all the path devices */ -+ max_sectors_kb = mpp->max_sectors_kb; - if (is_reload) { - if (!has_dm_info(mpp) && - dm_get_info(mpp->alias, &mpp->dmi) != 0) { diff --git a/0026-libmultipath-Only-set-max_sectors_kb-on-map-creation.patch b/0026-libmultipath-Only-set-max_sectors_kb-on-map-creation.patch deleted file mode 100644 index c82cfe7..0000000 --- a/0026-libmultipath-Only-set-max_sectors_kb-on-map-creation.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Tue, 16 Apr 2024 22:20:46 +0200 -Subject: [PATCH] libmultipath: Only set max_sectors_kb on map creation - -Changing max_sectors_kb on a live map is dangerous. When I/O occurs while the -max_sectors_kb value of a map is larger than that of any of its paths, I/O -errors like this may result: - - blk_insert_cloned_request: over max size limit. (127 > 126) - -This situation must be strictly avoided. The kernel makes sure that the -map's limits match those of the paths when the map is created. But setting -max_sectors_kb on path devices before reloading is dangerous, even if we -read the value from the map's max_sectors_kb beforehand. The reason for -this is that the sysfs value max_sectors_kb is the kernel's max_sectors -divided by 2, and user space has no way to figure out if the kernel-internal -value is odd or even. Thus by writing back the value just read to -max_sectors_kb, one might actually decrease the kernel value by one. - -The only safe way to set max_sectors_kb on a live map would be to suspend -it, flushing all outstanding IO, then the path max_sectors_kb, reload, -and resume. - -Since commit 8fd4868 ("libmultipath: don't set max_sectors_kb on reloads"), -we don't set the configured max_sectors_kb any more. But as shown above, -this is not safe. So really only set max_sectors_kb when creating a map. - -Users who have stacked block devices on top of multipath, as described in the -commit message of 8fd4868 must make sure that the max_sectors_kb setting is -correct when the multipath map is first created. Decreasing the map's -max_sectors_kb value (without touching the paths) should actually be possible -in this situation, because stacked block devices are usually bio-based, and -bio-based IO (in contrast to request-based) can be split if the lower-level -device has can't handle the size of the I/O. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmultipath/configure.c | 38 ++++---------------------------------- - 1 file changed, 4 insertions(+), 34 deletions(-) - -diff --git a/libmultipath/configure.c b/libmultipath/configure.c -index 13602f3f..8cbb2a88 100644 ---- a/libmultipath/configure.c -+++ b/libmultipath/configure.c -@@ -566,46 +566,18 @@ trigger_paths_udev_change(struct multipath *mpp, bool is_mpath) - mpp->needs_paths_uevent = 0; - } - --static int --sysfs_set_max_sectors_kb(struct multipath *mpp, int is_reload) -+static int sysfs_set_max_sectors_kb(struct multipath *mpp) - { - struct pathgroup * pgp; - struct path *pp; - char buff[11]; - ssize_t len; - int i, j, ret, err = 0; -- struct udev_device *udd; -- int max_sectors_kb; - - if (mpp->max_sectors_kb == MAX_SECTORS_KB_UNDEF) - return 0; -- max_sectors_kb = mpp->max_sectors_kb; -- if (is_reload) { -- if (!has_dm_info(mpp) && -- dm_get_info(mpp->alias, &mpp->dmi) != 0) { -- condlog(1, "failed to get dm info for %s", mpp->alias); -- return 1; -- } -- udd = get_udev_for_mpp(mpp); -- if (!udd) { -- condlog(1, "failed to get udev device to set max_sectors_kb for %s", mpp->alias); -- return 1; -- } -- ret = sysfs_attr_get_value(udd, "queue/max_sectors_kb", buff, -- sizeof(buff)); -- udev_device_unref(udd); -- if (!sysfs_attr_value_ok(ret, sizeof(buff))) { -- condlog(1, "failed to get current max_sectors_kb from %s", mpp->alias); -- return 1; -- } -- if (sscanf(buff, "%u\n", &max_sectors_kb) != 1) { -- condlog(1, "can't parse current max_sectors_kb from %s", -- mpp->alias); -- return 1; -- } -- } -- snprintf(buff, 11, "%d", max_sectors_kb); -- len = strlen(buff); -+ -+ len = snprintf(buff, sizeof(buff), "%d", mpp->max_sectors_kb); - - vector_foreach_slot (mpp->pg, pgp, i) { - vector_foreach_slot(pgp->paths, pp, j) { -@@ -923,7 +895,7 @@ int domap(struct multipath *mpp, char *params, int is_daemon) - return DOMAP_RETRY; - } - -- sysfs_set_max_sectors_kb(mpp, 0); -+ sysfs_set_max_sectors_kb(mpp); - if (is_daemon && mpp->ghost_delay > 0 && count_active_paths(mpp) && - pathcount(mpp, PATH_UP) == 0) - mpp->ghost_delay_tick = mpp->ghost_delay; -@@ -934,7 +906,6 @@ int domap(struct multipath *mpp, char *params, int is_daemon) - - case ACT_RELOAD: - case ACT_RELOAD_RENAME: -- sysfs_set_max_sectors_kb(mpp, 1); - if (mpp->ghost_delay_tick > 0 && pathcount(mpp, PATH_UP)) - mpp->ghost_delay_tick = 0; - r = dm_addmap_reload(mpp, params, 0); -@@ -942,7 +913,6 @@ int domap(struct multipath *mpp, char *params, int is_daemon) - - case ACT_RESIZE: - case ACT_RESIZE_RENAME: -- sysfs_set_max_sectors_kb(mpp, 1); - if (mpp->ghost_delay_tick > 0 && pathcount(mpp, PATH_UP)) - mpp->ghost_delay_tick = 0; - r = dm_addmap_reload(mpp, params, 1); diff --git a/0027-libmultipath-set-max_sectors_kb-in-adopt_paths.patch b/0027-libmultipath-set-max_sectors_kb-in-adopt_paths.patch deleted file mode 100644 index a4389df..0000000 --- a/0027-libmultipath-set-max_sectors_kb-in-adopt_paths.patch +++ /dev/null @@ -1,233 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Tue, 16 Apr 2024 23:59:03 +0200 -Subject: [PATCH] libmultipath: set max_sectors_kb in adopt_paths() - -As explained in the previous commit, setting max_sectors_kb for -paths that are members of a live map is dangerous. But as long as -a path is not a member of a map, setting max_sectors_kb poses no risk. -Set the parameter in adopt_paths(), for paths that aren't members -of the map yet. In order to determine whether or not a path is currently -member of the map, adopt_paths() needs to passed the current member list. If -(and only if) it's called from coalesce_paths(), the passed struct multipath -doesn not represent the current state of the map; adopt_paths() must therefore -get a new argument current_mpp that represents the kernel state. - -We must still call sysfs_set_max_sectors_kb() from domap() in the ACT_CREATE -case, because when adopt_paths is called from coalesce_paths() for a map that -doesn't exist yet, mpp->max_sectors_kb is not set. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmultipath/configure.c | 2 +- - libmultipath/structs_vec.c | 62 ++++++++++++++++++++++++++++++++++---- - libmultipath/structs_vec.h | 6 ++-- - multipathd/main.c | 6 ++-- - tests/Makefile | 2 +- - tests/test-lib.c | 9 +++++- - 6 files changed, 73 insertions(+), 14 deletions(-) - -diff --git a/libmultipath/configure.c b/libmultipath/configure.c -index 8cbb2a88..b5c701fa 100644 ---- a/libmultipath/configure.c -+++ b/libmultipath/configure.c -@@ -1105,7 +1105,7 @@ int coalesce_paths (struct vectors *vecs, vector mpvec, char *refwwid, - /* - * at this point, we know we really got a new mp - */ -- mpp = add_map_with_path(vecs, pp1, 0); -+ mpp = add_map_with_path(vecs, pp1, 0, cmpp); - if (!mpp) { - orphan_path(pp1, "failed to create multipath device"); - continue; -diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index 0fc608c2..c0c5cc90 100644 ---- a/libmultipath/structs_vec.c -+++ b/libmultipath/structs_vec.c -@@ -242,7 +242,38 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, - return must_reload; - } - --int adopt_paths(vector pathvec, struct multipath *mpp) -+static bool set_path_max_sectors_kb(const struct path *pp, int max_sectors_kb) -+{ -+ char buf[11]; -+ ssize_t len; -+ int ret, current; -+ bool rc = false; -+ -+ if (max_sectors_kb == MAX_SECTORS_KB_UNDEF) -+ return rc; -+ -+ if (sysfs_attr_get_value(pp->udev, "queue/max_sectors_kb", buf, sizeof(buf)) <= 0 -+ || sscanf(buf, "%d\n", ¤t) != 1) -+ current = MAX_SECTORS_KB_UNDEF; -+ if (current == max_sectors_kb) -+ return rc; -+ -+ len = snprintf(buf, sizeof(buf), "%d", max_sectors_kb); -+ ret = sysfs_attr_set_value(pp->udev, "queue/max_sectors_kb", buf, len); -+ if (ret != len) -+ log_sysfs_attr_set_value(3, ret, -+ "failed setting max_sectors_kb on %s", -+ pp->dev); -+ else { -+ condlog(3, "%s: set max_sectors_kb to %d for %s", __func__, -+ max_sectors_kb, pp->dev); -+ rc = true; -+ } -+ return rc; -+} -+ -+int adopt_paths(vector pathvec, struct multipath *mpp, -+ const struct multipath *current_mpp) - { - int i, ret; - struct path * pp; -@@ -285,9 +316,28 @@ int adopt_paths(vector pathvec, struct multipath *mpp) - continue; - } - -- if (!find_path_by_devt(mpp->paths, pp->dev_t) && -- store_path(mpp->paths, pp)) -- goto err; -+ if (!find_path_by_devt(mpp->paths, pp->dev_t)) { -+ -+ if (store_path(mpp->paths, pp)) -+ goto err; -+ /* -+ * Setting max_sectors_kb on live paths is dangerous. -+ * But we can do it here on a path that isn't yet part -+ * of the map. If this value is lower than the current -+ * max_sectors_kb and the map is reloaded, the map's -+ * max_sectors_kb will be safely adjusted by the kernel. -+ * -+ * We must make sure that the path is not part of the -+ * map yet. Normally we can check this in mpp->paths. -+ * But if adopt_paths is called from coalesce_paths, -+ * we need to check the separate struct multipath that -+ * has been obtained from map_discovery(). -+ */ -+ if (!current_mpp || -+ !mp_find_path_by_devt(current_mpp, pp->dev_t)) -+ mpp->need_reload = mpp->need_reload || -+ set_path_max_sectors_kb(pp, mpp->max_sectors_kb); -+ } - - pp->mpp = mpp; - condlog(3, "%s: ownership set to %s", -@@ -693,7 +743,7 @@ find_existing_alias (struct multipath * mpp, - } - - struct multipath *add_map_with_path(struct vectors *vecs, struct path *pp, -- int add_vec) -+ int add_vec, const struct multipath *current_mpp) - { - struct multipath * mpp; - struct config *conf = NULL; -@@ -721,7 +771,7 @@ struct multipath *add_map_with_path(struct vectors *vecs, struct path *pp, - goto out; - mpp->size = pp->size; - -- if (adopt_paths(vecs->pathvec, mpp) || pp->mpp != mpp || -+ if (adopt_paths(vecs->pathvec, mpp, current_mpp) || pp->mpp != mpp || - find_slot(mpp->paths, pp) == -1) - goto out; - -diff --git a/libmultipath/structs_vec.h b/libmultipath/structs_vec.h -index 3253f1bb..dbc43058 100644 ---- a/libmultipath/structs_vec.h -+++ b/libmultipath/structs_vec.h -@@ -13,7 +13,8 @@ struct vectors { - - void set_no_path_retry(struct multipath *mpp); - --int adopt_paths (vector pathvec, struct multipath * mpp); -+int adopt_paths (vector pathvec, struct multipath *mpp, -+ const struct multipath *current_mpp); - void orphan_path (struct path * pp, const char *reason); - void set_path_removed(struct path *pp); - -@@ -28,7 +29,8 @@ void remove_maps (struct vectors * vecs); - - void sync_map_state (struct multipath *); - struct multipath * add_map_with_path (struct vectors * vecs, -- struct path * pp, int add_vec); -+ struct path * pp, int add_vec, -+ const struct multipath *current_mpp); - void update_queue_mode_del_path(struct multipath *mpp); - void update_queue_mode_add_path(struct multipath *mpp); - int update_multipath_table (struct multipath *mpp, vector pathvec, int flags); -diff --git a/multipathd/main.c b/multipathd/main.c -index dd17d5c3..d8518a92 100644 ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -636,7 +636,7 @@ update_map (struct multipath *mpp, struct vectors *vecs, int new_map) - - retry: - condlog(4, "%s: updating new map", mpp->alias); -- if (adopt_paths(vecs->pathvec, mpp)) { -+ if (adopt_paths(vecs->pathvec, mpp, NULL)) { - condlog(0, "%s: failed to adopt paths for new map update", - mpp->alias); - retries = -1; -@@ -1231,7 +1231,7 @@ rescan: - if (mpp) { - condlog(4,"%s: adopting all paths for path %s", - mpp->alias, pp->dev); -- if (adopt_paths(vecs->pathvec, mpp) || pp->mpp != mpp || -+ if (adopt_paths(vecs->pathvec, mpp, NULL) || pp->mpp != mpp || - find_slot(mpp->paths, pp) == -1) - goto fail; /* leave path added to pathvec */ - -@@ -1245,7 +1245,7 @@ rescan: - return 0; - } - condlog(4,"%s: creating new map", pp->dev); -- if ((mpp = add_map_with_path(vecs, pp, 1))) { -+ if ((mpp = add_map_with_path(vecs, pp, 1, NULL))) { - mpp->action = ACT_CREATE; - /* - * We don't depend on ACT_CREATE, as domap will -diff --git a/tests/Makefile b/tests/Makefile -index d1d52dde..4005204a 100644 ---- a/tests/Makefile -+++ b/tests/Makefile -@@ -45,7 +45,7 @@ dmevents-test_OBJDEPS = $(multipathdir)/devmapper.o - dmevents-test_LIBDEPS = -lpthread -ldevmapper -lurcu - hwtable-test_TESTDEPS := test-lib.o - hwtable-test_OBJDEPS := $(multipathdir)/discovery.o $(multipathdir)/blacklist.o \ -- $(multipathdir)/structs.o $(multipathdir)/propsel.o -+ $(multipathdir)/structs_vec.o $(multipathdir)/structs.o $(multipathdir)/propsel.o - hwtable-test_LIBDEPS := -ludev -lpthread -ldl - blacklist-test_TESTDEPS := test-log.o - blacklist-test_LIBDEPS := -ludev -diff --git a/tests/test-lib.c b/tests/test-lib.c -index cdb2780d..88f35e94 100644 ---- a/tests/test-lib.c -+++ b/tests/test-lib.c -@@ -152,6 +152,13 @@ int __wrap_sysfs_get_size(struct path *pp, unsigned long long *sz) - return 0; - } - -+int __wrap_sysfs_attr_set_value(struct udev_device *dev, const char *attr_name, -+ const char * value, size_t value_len) -+{ -+ condlog(5, "%s: %s", __func__, value); -+ return value_len; -+} -+ - void *__wrap_udev_device_get_parent_with_subsystem_devtype( - struct udev_device *ud, const char *subsys, char *type) - { -@@ -400,7 +407,7 @@ struct multipath *__mock_multipath(struct vectors *vecs, struct path *pp) - /* pathinfo() call in adopt_paths */ - mock_pathinfo(DI_CHECKER|DI_PRIO, &mop); - -- mp = add_map_with_path(vecs, pp, 1); -+ mp = add_map_with_path(vecs, pp, 1, NULL); - assert_ptr_not_equal(mp, NULL); - - /* TBD: mock setup_map() ... */ diff --git a/0028-libmultipath-add-wildcard-k-for-printing-max_sectors.patch b/0028-libmultipath-add-wildcard-k-for-printing-max_sectors.patch deleted file mode 100644 index 9b66bbb..0000000 --- a/0028-libmultipath-add-wildcard-k-for-printing-max_sectors.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 17 Apr 2024 17:19:43 +0200 -Subject: [PATCH] libmultipath: add wildcard %k for printing max_sectors_kb - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmultipath/print.c | 38 ++++++++++++++++++++++++++++++++++++++ - 1 file changed, 38 insertions(+) - -diff --git a/libmultipath/print.c b/libmultipath/print.c -index 360308d2..efd5a16a 100644 ---- a/libmultipath/print.c -+++ b/libmultipath/print.c -@@ -32,6 +32,7 @@ - #include "util.h" - #include "foreign.h" - #include "strbuf.h" -+#include "sysfs.h" - - #define PRINT_PATH_LONG "%w %i %d %D %p %t %T %s %o" - #define PRINT_PATH_INDENT "%i %d %D %t %T %o" -@@ -431,6 +432,27 @@ snprint_multipath_vpd_data(struct strbuf *buff, - return append_strbuf_str(buff, "[undef]"); - } - -+static void cleanup_udev_device(struct udev_device **udd) -+{ -+ if (*udd) -+ udev_device_unref(*udd); -+} -+ -+static int -+snprint_multipath_max_sectors_kb(struct strbuf *buff, const struct multipath *mpp) -+{ -+ char buf[11]; -+ int max_sectors_kb; -+ struct udev_device *udd __attribute__((cleanup(cleanup_udev_device))) -+ = get_udev_for_mpp(mpp); -+ -+ if (!udd || -+ sysfs_attr_get_value(udd, "queue/max_sectors_kb", buf, sizeof(buf)) <= 0 || -+ sscanf(buf, "%d\n", &max_sectors_kb) != 1) -+ return print_strbuf(buff, "n/a"); -+ return print_strbuf(buff, "%d", max_sectors_kb); -+} -+ - /* - * path info printing functions - */ -@@ -790,6 +812,20 @@ snprint_alua_tpg(struct strbuf *buff, const struct path * pp) - return print_strbuf(buff, "0x%04x", pp->tpg_id); - } - -+static int -+snprint_path_max_sectors_kb(struct strbuf *buff, const struct path *pp) -+{ -+ char buf[11]; -+ int max_sectors_kb; -+ -+ if (!pp->udev || -+ sysfs_attr_get_value(pp->udev, "queue/max_sectors_kb", -+ buf, sizeof(buf)) <= 0 || -+ sscanf(buf, "%d\n", &max_sectors_kb) != 1) -+ return print_strbuf(buff, "n/a"); -+ return print_strbuf(buff, "%d", max_sectors_kb); -+} -+ - static const struct multipath_data mpd[] = { - {'n', "name", snprint_name}, - {'w', "uuid", snprint_multipath_uuid}, -@@ -815,6 +851,7 @@ static const struct multipath_data mpd[] = { - {'e', "rev", snprint_multipath_rev}, - {'G', "foreign", snprint_multipath_foreign}, - {'g', "vpd page data", snprint_multipath_vpd_data}, -+ {'k', "max_sectors_kb",snprint_multipath_max_sectors_kb}, - }; - - static const struct path_data pd[] = { -@@ -845,6 +882,7 @@ static const struct path_data pd[] = { - {'I', "init_st", snprint_initialized}, - {'L', "LUN hex", snprint_path_lunhex}, - {'A', "TPG", snprint_alua_tpg}, -+ {'k', "max_sectors_kb",snprint_path_max_sectors_kb}, - }; - - static const struct pathgroup_data pgd[] = { diff --git a/0029-multipath.conf-5-update-documentation-for-max_sector.patch b/0029-multipath.conf-5-update-documentation-for-max_sector.patch deleted file mode 100644 index dcdf164..0000000 --- a/0029-multipath.conf-5-update-documentation-for-max_sector.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 17 Apr 2024 18:59:04 +0200 -Subject: [PATCH] multipath.conf(5): update documentation for max_sectors_kb - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/multipath.conf.5.in | 33 +++++++++++++++++++++++++++++---- - 1 file changed, 29 insertions(+), 4 deletions(-) - -diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in -index c788c180..b29a75fe 100644 ---- a/multipath/multipath.conf.5.in -+++ b/multipath/multipath.conf.5.in -@@ -1311,11 +1311,36 @@ The default is: \fB0\fR - . - .TP - .B max_sectors_kb --Sets the max_sectors_kb device parameter on all path devices and the multipath --device to the specified value. -+Sets the \fImax_sectors_kb\fR device parameter on some path devices and the multipath -+device to the specified value. \fImax_sectors_kb\fR is the largest I/O size, in units -+of 1024 bytes, that the kernel allows for a single I/O request. For hardware devices -+like SCSI disks, this value is limited by the capabilities of the hardware. -+It is crucial that the value of a multipath map is never higher than the minimum value of -+of all its path devices. This is ensured by the kernel when a multipath map -+is loaded, but manipulating the values of a map or either of its paths while the -+map is live can cause race conditions and I/O errors. Therefore this value is only -+enforced by multipathd when a multipath map is first created, or when a path device -+is added to a map. In both cases, race conditions are avoided by the kernel. - .RS --.TP --The default is: in \fB/sys/block//queue/max_sectors_kb\fR -+.PP -+Setting \fImax_sectors_kb\fR does not guarantee that all path devices will have this -+value set. It is not an error if the value of a path device is higher than that of -+the containing multipath map. It is also not an error if the actual limit of a map is -+lower than the value in \fI@CONFIGFILE@\fR. This can happen if the hardware limits of one -+or more path devices are lower than the configured value. -+.PP -+Normally the kernel and its device drivers take care of the maximum -+I/O size, and administrators do not need to bother about \fImax_sectors_kb\fR. -+But some hardware devices may report incorrect I/O size limits, or other components -+in the environment (e.g. the fabric) may impose constraints that the kernel cannot -+detect. In such cases setting \fImax_sectors_kb\fR makes sense. It should be set when -+maps are first created, and not be changed thereafter. -+If the setting \fBmust\fR be changed for a live map, set the -+value in \fI@CONFIGFILE@\fR, run \fBmultipathd reconfigure\fR, and use -+\fBmultipathd del path \fR and \fBmultipathd add path \fR to -+delete and re-add the same path device. -+.LP -+The default is: \fBundefined\fR. - .RE - . - . diff --git a/0030-multipath-tools-simplify-comment-in-hwtable.patch b/0030-multipath-tools-simplify-comment-in-hwtable.patch deleted file mode 100644 index 59090a7..0000000 --- a/0030-multipath-tools-simplify-comment-in-hwtable.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Xose Vazquez Perez -Date: Sun, 28 Apr 2024 01:45:35 +0200 -Subject: [PATCH] multipath-tools: simplify comment in hwtable - -Instead of adding the new 5300 model, replace them with wildcards. - -Cc: Martin Wilck -Cc: Benjamin Marzinski -Cc: Christophe Varoqui -Cc: DM-DEVEL ML -Signed-off-by: Xose Vazquez Perez -Reviewed-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - libmultipath/hwtable.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c -index 640bf347..7aac3f37 100644 ---- a/libmultipath/hwtable.c -+++ b/libmultipath/hwtable.c -@@ -683,8 +683,8 @@ static struct hwentry default_hw[] = { - .pgfailback = -FAILBACK_IMMEDIATE, - }, - { -- // Storwize V5000/V7000 lines / SAN Volume Controller (SVC) / Flex System V7000 -- // FlashSystem V840/V9000/5000/5100/5200/7200/7300/9100/9200/9200R/9500 -+ // Storwize V5000/V7000 lines / SAN Volume Controller (SVC) -+ // Flex System V7000 / FlashSystem V840/V9000 and 5x00/7x00/9x00 - .vendor = "IBM", - .product = "^2145", - .no_path_retry = NO_PATH_RETRY_QUEUE, diff --git a/0031-multipath-tools-unify-text-in-multipath.conf.5.patch b/0031-multipath-tools-unify-text-in-multipath.conf.5.patch deleted file mode 100644 index b6d9af3..0000000 --- a/0031-multipath-tools-unify-text-in-multipath.conf.5.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Xose Vazquez Perez -Date: Sun, 28 Apr 2024 01:45:36 +0200 -Subject: [PATCH] multipath-tools: unify text in multipath.conf.5 - -Cc: Martin Wilck -Cc: Benjamin Marzinski -Cc: Christophe Varoqui -Cc: DM-DEVEL ML -Signed-off-by: Xose Vazquez Perez -Reviewed-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - multipath/multipath.conf.5.in | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in -index b29a75fe..c1a19ebb 100644 ---- a/multipath/multipath.conf.5.in -+++ b/multipath/multipath.conf.5.in -@@ -187,7 +187,7 @@ The default is: \fBno\fR - . - .TP - .B multipath_dir --(Deprecated) This option is not supported anymore, and the value is ignored. -+(Deprecated) This option is not supported anymore, and will be ignored. - . - . - .TP -@@ -277,7 +277,7 @@ The default is: \fBno\fR - . - .TP - .B pg_timeout --(Deprecated) This option is not supported anymore, and the value is ignored. -+(Deprecated) This option is not supported anymore, and will be ignored. - . - . - .TP -@@ -322,7 +322,7 @@ The default is: \fBID_WWN\fR, for NVMe devices - . - .TP - .B getuid_callout --(Deprecated) This option is not supported anymore, and the value is ignored. -+(Deprecated) This option is not supported anymore, and will be ignored. - . - . - .TP -@@ -995,7 +995,7 @@ The default is: \fB\fR - . - .TP - .B config_dir --(Deprecated) This option is not supported anymore, and the value is ignored. -+(Deprecated) This option is not supported anymore, and will be ignored. - .RS - .TP - The compiled-in value is: \fB@CONFIGDIR@\fR -@@ -1295,7 +1295,7 @@ The default is: \fBno\fR - . - .TP - .B disable_changed_wwids --(Deprecated) This option is not supported anymore, and the value is ignored. -+(Deprecated) This option is not supported anymore, and will be ignored. - .RE - . - . -@@ -1340,7 +1340,7 @@ value in \fI@CONFIGFILE@\fR, run \fBmultipathd reconfigure\fR, and use - \fBmultipathd del path \fR and \fBmultipathd add path \fR to - delete and re-add the same path device. - .LP --The default is: \fBundefined\fR. -+The default is: \fB\fR - .RE - . - . diff --git a/0032-multipath-tools-update-man-pages-dates.patch b/0032-multipath-tools-update-man-pages-dates.patch deleted file mode 100644 index c011eac..0000000 --- a/0032-multipath-tools-update-man-pages-dates.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Xose Vazquez Perez -Date: Sun, 28 Apr 2024 01:45:37 +0200 -Subject: [PATCH] multipath-tools: update man pages dates - -Cc: Martin Wilck -Cc: Benjamin Marzinski -Cc: Christophe Varoqui -Cc: DM-DEVEL ML -Signed-off-by: Xose Vazquez Perez -Reviewed-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - libmpathpersist/mpath_persistent_reserve_in.3 | 2 +- - libmpathpersist/mpath_persistent_reserve_out.3 | 2 +- - multipath/multipath.8.in | 2 +- - multipath/multipath.conf.5.in | 2 +- - multipathd/multipathd.8.in | 2 +- - 5 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/libmpathpersist/mpath_persistent_reserve_in.3 b/libmpathpersist/mpath_persistent_reserve_in.3 -index 6cc35349..4ac43fa3 100644 ---- a/libmpathpersist/mpath_persistent_reserve_in.3 -+++ b/libmpathpersist/mpath_persistent_reserve_in.3 -@@ -6,7 +6,7 @@ - .\" Update the date below if you make any significant change. - .\" ---------------------------------------------------------------------------- - . --.TH MPATH_PERSISTENT_RESERVE_IN 3 2018-06-15 Linux -+.TH MPATH_PERSISTENT_RESERVE_IN 3 2024-02-09 Linux - . - . - .\" ---------------------------------------------------------------------------- -diff --git a/libmpathpersist/mpath_persistent_reserve_out.3 b/libmpathpersist/mpath_persistent_reserve_out.3 -index 70e26028..3dbeae1f 100644 ---- a/libmpathpersist/mpath_persistent_reserve_out.3 -+++ b/libmpathpersist/mpath_persistent_reserve_out.3 -@@ -6,7 +6,7 @@ - .\" Update the date below if you make any significant change. - .\" ---------------------------------------------------------------------------- - . --.TH MPATH_PERSISTENT_RESERVE_OUT 3 2018-06-15 Linux -+.TH MPATH_PERSISTENT_RESERVE_OUT 3 2024-02-09 Linux - . - . - .\" ---------------------------------------------------------------------------- -diff --git a/multipath/multipath.8.in b/multipath/multipath.8.in -index 348eb220..b88e9a4c 100644 ---- a/multipath/multipath.8.in -+++ b/multipath/multipath.8.in -@@ -6,7 +6,7 @@ - .\" Update the date below if you make any significant change. - .\" ---------------------------------------------------------------------------- - . --.TH MULTIPATH 8 2021-11-12 Linux -+.TH MULTIPATH 8 2023-09-08 Linux - . - . - .\" ---------------------------------------------------------------------------- -diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in -index c1a19ebb..46d3685a 100644 ---- a/multipath/multipath.conf.5.in -+++ b/multipath/multipath.conf.5.in -@@ -6,7 +6,7 @@ - .\" Update the date below if you make any significant change. - .\" ---------------------------------------------------------------------------- - . --.TH MULTIPATH.CONF 5 2023-06-15 Linux -+.TH MULTIPATH.CONF 5 2024-04-17 Linux - . - . - .\" ---------------------------------------------------------------------------- -diff --git a/multipathd/multipathd.8.in b/multipathd/multipathd.8.in -index f1cab3ff..12b77156 100644 ---- a/multipathd/multipathd.8.in -+++ b/multipathd/multipathd.8.in -@@ -6,7 +6,7 @@ - .\" Update the date below if you make any significant change. - .\" ---------------------------------------------------------------------------- - . --.TH MULTIPATHD 8 2022-09-03 Linux -+.TH MULTIPATHD 8 2023-12-19 Linux - . - . - .\" ---------------------------------------------------------------------------- diff --git a/0033-libmultipath-export-partmap_in_use.patch b/0033-libmultipath-export-partmap_in_use.patch deleted file mode 100644 index 47a6772..0000000 --- a/0033-libmultipath-export-partmap_in_use.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Thu, 25 Apr 2024 19:35:13 -0400 -Subject: [PATCH] libmultipath: export partmap_in_use - -A future commit will make use of this function - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -Reviewed-by: Benjamin Marzinski ---- - libmultipath/devmapper.c | 2 +- - libmultipath/devmapper.h | 1 + - libmultipath/libmultipath.version | 1 + - 3 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c -index 4ce7e82f..a87abf7e 100644 ---- a/libmultipath/devmapper.c -+++ b/libmultipath/devmapper.c -@@ -1043,7 +1043,7 @@ has_partmap(const char *name __attribute__((unused)), - return 1; - } - --static int -+int - partmap_in_use(const char *name, void *data) - { - int part_count, *ret_count = (int *)data; -diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h -index a7d66604..93caa2aa 100644 ---- a/libmultipath/devmapper.h -+++ b/libmultipath/devmapper.h -@@ -57,6 +57,7 @@ enum { - DM_FLUSH_BUSY, - }; - -+int partmap_in_use(const char *name, void *data); - int _dm_flush_map (const char *, int, int, int, int); - int dm_flush_map_nopaths(const char * mapname, int deferred_remove); - #define dm_flush_map(mapname) _dm_flush_map(mapname, 1, 0, 0, 0) -diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version -index 724786d5..e070f296 100644 ---- a/libmultipath/libmultipath.version -+++ b/libmultipath/libmultipath.version -@@ -141,6 +141,7 @@ global: - need_io_err_check; - orphan_path; - parse_prkey_flags; -+ partmap_in_use; - pathcount; - path_discovery; - path_get_tpgs; diff --git a/0034-libmultipath-change-flush_on_last_del-to-fix-a-multi.patch b/0034-libmultipath-change-flush_on_last_del-to-fix-a-multi.patch deleted file mode 100644 index 7c36521..0000000 --- a/0034-libmultipath-change-flush_on_last_del-to-fix-a-multi.patch +++ /dev/null @@ -1,346 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Thu, 25 Apr 2024 19:35:14 -0400 -Subject: [PATCH] libmultipath: change flush_on_last_del to fix a multipathd - hang - -Commit 9bd3482e ("multipathd: make flush_map() delete maps like the -multipath command") fixed an issue where deleting a queueing multipath -device through multipathd could hang because the multipath device had -outstanding IO, even though the only openers of it at the time of -deletion were the kpartx partition devices. However it is still possible -to hang multipathd, because autoremoving the device when all paths have -been deleted doesn't disable queueing. To reproduce this hang: - -1. create a multipath device with a kpartx partition on top of it and -no_path_retry set to either "queue" or something long enough to run all -the commands in the reproducer before it disables queueing. -2. disable all the paths to the device with something like: - # echo offline > /sys/block//device/state -3. Write directly to the multipath device with something like: - # dd if=/dev/zero of=/dev/mapper/ bs=4K count=1 -4. delete all the paths to the device with something like: - # echo 1 > /sys/block//device/delete - -Multipathd will hang trying to delete the kpartx device because, as the -last opener, it must flush the multipath device before closing it. -Because it hangs holding the vecs_lock, multipathd will never disable -queueing on the device, so it will hang forever, even if no_path_retry -is set to a number. - -This hang can occur, even if deferred_remove is set. Since nothing has -the kpartx device opened, device-mapper does an immediate remove, which -will still hang. This means that even if deferred_remove is set, -multipathd still cannot delete a map while queueing is enabled. It must -either disable queueing or skip the autoremove. - -Mulitpath can currently be configured to avoid this hang by setting - -flush_on_last_del yes - -However there are good reasons why users wouldn't want to set that. They -may need to be able to survive having all paths getting temporarily -deleted. I should note that this is a pretty rare corner case, since -multipath automatically sets dev_loss_tmo so that it should not trigger -before queueing is disabled. - -This commit avoids the hang by changing the possible values for -flush_on_last_del to "never", "unused", and "always", and sets the -default to "unused". "always" works like "yes" did, "never" will not -disable queueing, and "unused" will only disable queueing if nothing has -the kpartx devices or the multipath device open. In order to be safe, if -the device has queue_if_no_paths set (and in case of "unused", the -device is in-use) the autoremove will be skipped. Also, instead of just -trusting the lack of "queue_if_no_paths" in the current mpp->features, -multipathd will tell the kernel to disable queueing, just to be sure it -actually is. - -I chose "unused" as the default because this should generally only cause -multipathd to work differently from the users perspective when nothing -has the multipath device open but it is queueing and there is -outstanding IO. Without this change, it would have hung instead of -failing the outstanding IO. However, I do understand that an argument -could be made that "never" makes more sense as default, even though it -will cause multipathd to skip autoremoves in cases where it wouldn't -before. The change to the behavior of deffered_remove will be -noticeable, but skipping an autoremove is much better than hanging. - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -Reviewed-by: Benjamin Marzinski ---- - libmultipath/defaults.h | 2 +- - libmultipath/dict.c | 72 +++++++++++++++++++++++++++++++---- - libmultipath/dict.h | 1 + - libmultipath/hwtable.c | 6 +-- - libmultipath/propsel.c | 4 +- - libmultipath/structs.h | 7 ++-- - multipath/multipath.conf.5.in | 20 +++++++--- - multipathd/main.c | 39 +++++++++++++++---- - 8 files changed, 122 insertions(+), 29 deletions(-) - -diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h -index 64b633f2..ed08c251 100644 ---- a/libmultipath/defaults.h -+++ b/libmultipath/defaults.h -@@ -43,7 +43,7 @@ - #define DEFAULT_PRIO PRIO_CONST - #define DEFAULT_PRIO_ARGS "" - #define DEFAULT_CHECKER TUR --#define DEFAULT_FLUSH FLUSH_DISABLED -+#define DEFAULT_FLUSH FLUSH_UNUSED - #define DEFAULT_USER_FRIENDLY_NAMES USER_FRIENDLY_NAMES_OFF - #define DEFAULT_FORCE_SYNC 0 - #define UNSET_PARTITION_DELIM "/UNSET/" -diff --git a/libmultipath/dict.c b/libmultipath/dict.c -index 5af036b7..546103f2 100644 ---- a/libmultipath/dict.c -+++ b/libmultipath/dict.c -@@ -791,14 +791,70 @@ declare_def_snprint(checker_timeout, print_nonzero) - declare_def_handler(allow_usb_devices, set_yes_no) - declare_def_snprint(allow_usb_devices, print_yes_no) - --declare_def_handler(flush_on_last_del, set_yes_no_undef) --declare_def_snprint_defint(flush_on_last_del, print_yes_no_undef, DEFAULT_FLUSH) --declare_ovr_handler(flush_on_last_del, set_yes_no_undef) --declare_ovr_snprint(flush_on_last_del, print_yes_no_undef) --declare_hw_handler(flush_on_last_del, set_yes_no_undef) --declare_hw_snprint(flush_on_last_del, print_yes_no_undef) --declare_mp_handler(flush_on_last_del, set_yes_no_undef) --declare_mp_snprint(flush_on_last_del, print_yes_no_undef) -+ -+static const char * const flush_on_last_del_optvals[] = { -+ [FLUSH_NEVER] = "never", -+ [FLUSH_ALWAYS] = "always", -+ [FLUSH_UNUSED] = "unused", -+}; -+ -+static int -+set_flush_on_last_del(vector strvec, void *ptr, const char *file, int line_nr) -+{ -+ int i; -+ int *flush_val_ptr = (int *)ptr; -+ char *buff; -+ -+ buff = set_value(strvec); -+ if (!buff) -+ return 1; -+ -+ for (i = FLUSH_NEVER; i <= FLUSH_UNUSED; i++) { -+ if (flush_on_last_del_optvals[i] != NULL && -+ !strcmp(buff, flush_on_last_del_optvals[i])) { -+ *flush_val_ptr = i; -+ break; -+ } -+ } -+ -+ if (i > FLUSH_UNUSED) { -+ bool deprecated = true; -+ if (strcmp(buff, "no") == 0 || strcmp(buff, "0") == 0) -+ *flush_val_ptr = FLUSH_UNUSED; -+ else if (strcmp(buff, "yes") == 0 || strcmp(buff, "1") == 0) -+ *flush_val_ptr = FLUSH_ALWAYS; -+ else { -+ deprecated = false; -+ condlog(1, "%s line %d, invalid value for flush_on_last_del: \"%s\"", -+ file, line_nr, buff); -+ } -+ if (deprecated) -+ condlog(2, "%s line %d, \"%s\" is a deprecated value for flush_on_last_del and is treated as \"%s\"", -+ file, line_nr, buff, -+ flush_on_last_del_optvals[*flush_val_ptr]); -+ } -+ -+ free(buff); -+ return 0; -+} -+ -+int -+print_flush_on_last_del(struct strbuf *buff, long v) -+{ -+ if (v == FLUSH_UNDEF) -+ return 0; -+ return append_strbuf_quoted(buff, flush_on_last_del_optvals[(int)v]); -+} -+ -+declare_def_handler(flush_on_last_del, set_flush_on_last_del) -+declare_def_snprint_defint(flush_on_last_del, print_flush_on_last_del, -+ DEFAULT_FLUSH) -+declare_ovr_handler(flush_on_last_del, set_flush_on_last_del) -+declare_ovr_snprint(flush_on_last_del, print_flush_on_last_del) -+declare_hw_handler(flush_on_last_del, set_flush_on_last_del) -+declare_hw_snprint(flush_on_last_del, print_flush_on_last_del) -+declare_mp_handler(flush_on_last_del, set_flush_on_last_del) -+declare_mp_snprint(flush_on_last_del, print_flush_on_last_del) - - declare_def_handler(user_friendly_names, set_yes_no_undef) - declare_def_snprint_defint(user_friendly_names, print_yes_no_undef, -diff --git a/libmultipath/dict.h b/libmultipath/dict.h -index 7e2dfbe0..e1794537 100644 ---- a/libmultipath/dict.h -+++ b/libmultipath/dict.h -@@ -18,4 +18,5 @@ int print_undef_off_zero(struct strbuf *buff, long v); - int print_dev_loss(struct strbuf *buff, unsigned long v); - int print_off_int_undef(struct strbuf *buff, long v); - int print_auto_resize(struct strbuf *buff, long v); -+int print_flush_on_last_del(struct strbuf *buff, long v); - #endif /* _DICT_H */ -diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c -index 7aac3f37..d1148de7 100644 ---- a/libmultipath/hwtable.c -+++ b/libmultipath/hwtable.c -@@ -60,7 +60,7 @@ - .no_path_retry = NO_PATH_RETRY_UNDEF, - .minio = 1000, - .minio_rq = 1, -- .flush_on_last_del = FLUSH_DISABLED, -+ .flush_on_last_del = FLUSH_UNUSED, - .user_friendly_names = USER_FRIENDLY_NAMES_OFF, - .fast_io_fail = 5, - .dev_loss = 600, -@@ -829,7 +829,7 @@ static struct hwentry default_hw[] = { - .no_path_retry = NO_PATH_RETRY_QUEUE, - .pgpolicy = GROUP_BY_PRIO, - .pgfailback = -FAILBACK_IMMEDIATE, -- .flush_on_last_del = FLUSH_ENABLED, -+ .flush_on_last_del = FLUSH_ALWAYS, - .dev_loss = MAX_DEV_LOSS_TMO, - .prio_name = PRIO_ONTAP, - .user_friendly_names = USER_FRIENDLY_NAMES_OFF, -@@ -1160,7 +1160,7 @@ static struct hwentry default_hw[] = { - .no_path_retry = NO_PATH_RETRY_FAIL, - .minio = 1, - .minio_rq = 1, -- .flush_on_last_del = FLUSH_ENABLED, -+ .flush_on_last_del = FLUSH_ALWAYS, - .fast_io_fail = 15, - }, - /* -diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c -index 44241e2a..e2dcb316 100644 ---- a/libmultipath/propsel.c -+++ b/libmultipath/propsel.c -@@ -963,6 +963,7 @@ out: - int select_flush_on_last_del(struct config *conf, struct multipath *mp) - { - const char *origin; -+ STRBUF_ON_STACK(buff); - - mp_set_mpe(flush_on_last_del); - mp_set_ovr(flush_on_last_del); -@@ -970,8 +971,9 @@ int select_flush_on_last_del(struct config *conf, struct multipath *mp) - mp_set_conf(flush_on_last_del); - mp_set_default(flush_on_last_del, DEFAULT_FLUSH); - out: -+ print_flush_on_last_del(&buff, mp->flush_on_last_del); - condlog(3, "%s: flush_on_last_del = %s %s", mp->alias, -- (mp->flush_on_last_del == FLUSH_ENABLED)? "yes" : "no", origin); -+ get_strbuf_str(&buff), origin); - return 0; - } - -diff --git a/libmultipath/structs.h b/libmultipath/structs.h -index a25eb9d5..dbaf4d43 100644 ---- a/libmultipath/structs.h -+++ b/libmultipath/structs.h -@@ -109,9 +109,10 @@ enum marginal_pathgroups_mode { - }; - - enum flush_states { -- FLUSH_UNDEF = YNU_UNDEF, -- FLUSH_DISABLED = YNU_NO, -- FLUSH_ENABLED = YNU_YES, -+ FLUSH_UNDEF, -+ FLUSH_NEVER, -+ FLUSH_ALWAYS, -+ FLUSH_UNUSED, - }; - - enum log_checker_err_states { -diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in -index 46d3685a..1d3d53bb 100644 ---- a/multipath/multipath.conf.5.in -+++ b/multipath/multipath.conf.5.in -@@ -707,12 +707,22 @@ The default is: \fBno\fR - .TP - .B flush_on_last_del - If set to --.I yes -+.I always - , multipathd will disable queueing when the last path to a device has been --deleted. --.RS --.TP --The default is: \fBno\fR -+deleted. If set to -+.I never -+, multipathd will not disable queueing when the last path to a device has -+been deleted. Since multipath cannot safely remove a device while queueing -+is enabled, setting this to \fInever\fR means that multipathd will not -+automatically remove an unused multipath device whose paths are all deleted if -+it is currently set to queue_if_no_path. If set to -+.I unused -+, multipathd will only disable queueing when the last path is removed if -+nothing currently has the multipath device or any of the kpartx partition -+devices on top of it open. -+.RS -+.TP -+The default is: \fBunused\fR - .RE - . - . -diff --git a/multipathd/main.c b/multipathd/main.c -index d8518a92..09286dd0 100644 ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -584,19 +584,42 @@ int update_multipath (struct vectors *vecs, char *mapname) - static bool - flush_map_nopaths(struct multipath *mpp, struct vectors *vecs) { - int r; -+ bool is_queueing = true; - -+ if (mpp->features) -+ is_queueing = strstr(mpp->features, "queue_if_no_path"); -+ -+ /* It's not safe to do a remove of a map that has "queue_if_no_path" -+ * set, since there could be outstanding IO which will cause -+ * multipathd to hang while attempting the remove */ -+ if (mpp->flush_on_last_del == FLUSH_NEVER && is_queueing) { -+ condlog(2, "%s: map is queueing, can't remove", mpp->alias); -+ return false; -+ } -+ if (mpp->flush_on_last_del == FLUSH_UNUSED && -+ partmap_in_use(mpp->alias, NULL) && is_queueing) { -+ condlog(2, "%s: map in use and queueing, can't remove", -+ mpp->alias); -+ return false; -+ } - /* -- * flush_map will fail if the device is open -+ * This will flush FLUSH_NEVER devices and FLUSH_UNUSED devices -+ * that are in use, but only if they are already marked as not -+ * queueing. That is just to make absolutely certain that they -+ * really are not queueing, like they claim. - */ -- if (mpp->flush_on_last_del == FLUSH_ENABLED) { -- condlog(2, "%s Last path deleted, disabling queueing", -+ condlog(is_queueing ? 2 : 3, "%s Last path deleted, disabling queueing", -+ mpp->alias); -+ mpp->retry_tick = 0; -+ mpp->no_path_retry = NO_PATH_RETRY_FAIL; -+ mpp->disable_queueing = 1; -+ mpp->stat_map_failures++; -+ if (dm_queue_if_no_path(mpp, 0) != 0) { -+ condlog(0, "%s: failed to disable queueing. Not removing", - mpp->alias); -- mpp->retry_tick = 0; -- mpp->no_path_retry = NO_PATH_RETRY_FAIL; -- mpp->disable_queueing = 1; -- mpp->stat_map_failures++; -- dm_queue_if_no_path(mpp, 0); -+ return false; - } -+ - r = dm_flush_map_nopaths(mpp->alias, mpp->deferred_remove); - if (r != DM_FLUSH_OK) { - if (r == DM_FLUSH_DEFERRED) { diff --git a/0035-libmultipath-remove-redundant-config-option-from-Inf.patch b/0035-libmultipath-remove-redundant-config-option-from-Inf.patch deleted file mode 100644 index 8de5639..0000000 --- a/0035-libmultipath-remove-redundant-config-option-from-Inf.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Thu, 25 Apr 2024 19:35:15 -0400 -Subject: [PATCH] libmultipath: remove redundant config option from InfiniBox - config - -The InfiniBox config already sets no_path_retry to "fail", so it won't -ever queue IO. That means setting flush_on_last_del to "always" is -redundant, since queueing is always disabled. Remove the -flush_on_last_del parameter, to make it easier for users to override the -default behavior if desired. - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -Reviewed-by: Benjamin Marzinski ---- - libmultipath/hwtable.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c -index d1148de7..9e008df6 100644 ---- a/libmultipath/hwtable.c -+++ b/libmultipath/hwtable.c -@@ -1160,7 +1160,6 @@ static struct hwentry default_hw[] = { - .no_path_retry = NO_PATH_RETRY_FAIL, - .minio = 1, - .minio_rq = 1, -- .flush_on_last_del = FLUSH_ALWAYS, - .fast_io_fail = 15, - }, - /* diff --git a/0036-libmultipath-pad-dev_loss_tmo-to-avoid-race-with-no_.patch b/0036-libmultipath-pad-dev_loss_tmo-to-avoid-race-with-no_.patch deleted file mode 100644 index f61f658..0000000 --- a/0036-libmultipath-pad-dev_loss_tmo-to-avoid-race-with-no_.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Thu, 25 Apr 2024 19:35:16 -0400 -Subject: [PATCH] libmultipath: pad dev_loss_tmo to avoid race with - no_path_retry - -Currently multipath makes sure that dev_loss_tmo is at least as long as -the configured no path queueing time. The goal is to make sure that path -devices aren't removed while the multipath device is still queueing in -hopes that they will become usable again. - -This is racy. Multipathd may take longer to check the paths than -configured. If strict_timing isn't set, it will definitely take longer. -To account for this, pad the minimum dev_loss_tmo value by five seconds -(one default checker interval) plus one second per minute of no path -queueing time. - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -Reviewed-by: Benjamin Marzinski ---- - libmultipath/discovery.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c -index 6fd4dabb..e2052422 100644 ---- a/libmultipath/discovery.c -+++ b/libmultipath/discovery.c -@@ -901,6 +901,11 @@ sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp) - uint64_t no_path_retry_tmo = - (uint64_t)mpp->no_path_retry * conf->checkint; - -+ /* pad no_path_retry_tmo by one standard check interval -+ * plus one second per minute to account for timing -+ * issues with the rechecks */ -+ no_path_retry_tmo += no_path_retry_tmo / 60 + DEFAULT_CHECKINT; -+ - if (no_path_retry_tmo > MAX_DEV_LOSS_TMO) - min_dev_loss = MAX_DEV_LOSS_TMO; - else diff --git a/0037-libmultipath-fix-deferred_remove-function-arguments.patch b/0037-libmultipath-fix-deferred_remove-function-arguments.patch deleted file mode 100644 index 507a056..0000000 --- a/0037-libmultipath-fix-deferred_remove-function-arguments.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Thu, 25 Apr 2024 19:35:17 -0400 -Subject: [PATCH] libmultipath: fix deferred_remove function arguments - -Aside from one version of dm_flush_map_nopaths(), all the callers of -_dm_flush_map() and dm_simplecmd() set deferred_remove to 0. But these -functions, as well as some helper functions they called, all treated the -deferred_remove argument as an enum deferred_remove_states, and called -do_deferred() to see if the remove should be deferred. To simplify the -code, make these functions treat deferred_remove as a boolean value -signifying whether a remove is deferred, and make dm_flush_map_nopaths() -do the work of checking if the remove should be deferred. - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -Reviewed-by: Benjamin Marzinski ---- - libmultipath/devmapper.c | 19 +++++++++---------- - libmultipath/libmultipath.version | 2 +- - 2 files changed, 10 insertions(+), 11 deletions(-) - -diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c -index a87abf7e..2e7b2c64 100644 ---- a/libmultipath/devmapper.c -+++ b/libmultipath/devmapper.c -@@ -386,8 +386,6 @@ libmp_dm_task_create(int task) - return dm_task_create(task); - } - --#define do_deferred(x) ((x) == DEFERRED_REMOVE_ON || (x) == DEFERRED_REMOVE_IN_PROGRESS) -- - static int - dm_simplecmd (int task, const char *name, int no_flush, int need_sync, - uint16_t udev_flags, int deferred_remove __DR_UNUSED__) { -@@ -411,7 +409,7 @@ dm_simplecmd (int task, const char *name, int no_flush, int need_sync, - dm_task_no_flush(dmt); /* for DM_DEVICE_SUSPEND/RESUME */ - #endif - #ifdef LIBDM_API_DEFERRED -- if (do_deferred(deferred_remove)) -+ if (deferred_remove) - dm_task_deferred_remove(dmt); - #endif - if (udev_wait_flag && -@@ -1082,7 +1080,7 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, - - /* If you aren't doing a deferred remove, make sure that no - * devices are in use */ -- if (!do_deferred(deferred_remove) && partmap_in_use(mapname, NULL)) -+ if (!deferred_remove && partmap_in_use(mapname, NULL)) - return DM_FLUSH_BUSY; - - if (need_suspend && -@@ -1100,7 +1098,7 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, - if ((r = dm_remove_partmaps(mapname, need_sync, deferred_remove))) - return r; - -- if (!do_deferred(deferred_remove) && dm_get_opencount(mapname)) { -+ if (!deferred_remove && dm_get_opencount(mapname)) { - condlog(2, "%s: map in use", mapname); - return DM_FLUSH_BUSY; - } -@@ -1112,8 +1110,7 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, - r = dm_device_remove(mapname, need_sync, deferred_remove); - - if (r) { -- if (do_deferred(deferred_remove) -- && dm_map_present(mapname)) { -+ if (deferred_remove && dm_map_present(mapname)) { - condlog(4, "multipath map %s remove deferred", - mapname); - return DM_FLUSH_DEFERRED; -@@ -1147,7 +1144,10 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, - int - dm_flush_map_nopaths(const char * mapname, int deferred_remove) - { -- return _dm_flush_map(mapname, 1, deferred_remove, 0, 0); -+ return _dm_flush_map(mapname, 1, -+ (deferred_remove == DEFERRED_REMOVE_ON || -+ deferred_remove == DEFERRED_REMOVE_IN_PROGRESS), -+ 0, 0); - } - - #else -@@ -1539,8 +1539,7 @@ remove_partmap(const char *name, void *data) - - if (dm_get_opencount(name)) { - dm_remove_partmaps(name, rd->need_sync, rd->deferred_remove); -- if (!do_deferred(rd->deferred_remove) && -- dm_get_opencount(name)) { -+ if (rd->deferred_remove && dm_get_opencount(name)) { - condlog(2, "%s: map in use", name); - return DM_FLUSH_BUSY; - } -diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version -index e070f296..eb511749 100644 ---- a/libmultipath/libmultipath.version -+++ b/libmultipath/libmultipath.version -@@ -43,7 +43,7 @@ LIBMPATHCOMMON_1.0.0 { - put_multipath_config; - }; - --LIBMULTIPATH_23.0.0 { -+LIBMULTIPATH_24.0.0 { - global: - /* symbols referenced by multipath and multipathd */ - add_foreign; diff --git a/0038-libmultipath-use-bitwise-flags-for-map-flushing-API.patch b/0038-libmultipath-use-bitwise-flags-for-map-flushing-API.patch deleted file mode 100644 index ef922ec..0000000 --- a/0038-libmultipath-use-bitwise-flags-for-map-flushing-API.patch +++ /dev/null @@ -1,212 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 2 May 2024 18:38:24 +0200 -Subject: [PATCH] libmultipath: use bitwise flags for map flushing API - -Rather than passing 3 separate bool variables to _dm_flush_map(), -define bitwise flags to modify the function's behavior, and pass -these flags to called functions accordingly. - -This improves the readability of the code, function calls are -more expressive. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmultipath/devmapper.c | 68 +++++++++++++++++----------------------- - libmultipath/devmapper.h | 18 ++++++++--- - 2 files changed, 41 insertions(+), 45 deletions(-) - -diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c -index 2e7b2c64..a6a9c2b7 100644 ---- a/libmultipath/devmapper.c -+++ b/libmultipath/devmapper.c -@@ -53,9 +53,8 @@ static int dm_cancel_remove_partmaps(const char * mapname); - #define __DR_UNUSED__ __attribute__((unused)) - #endif - --static int dm_remove_partmaps (const char * mapname, int need_sync, -- int deferred_remove); --static int do_foreach_partmaps(const char * mapname, -+static int dm_remove_partmaps (const char *mapname, int flags); -+static int do_foreach_partmaps(const char *mapname, - int (*partmap_func)(const char *, void *), - void *data); - static int _dm_queue_if_no_path(const char *mapname, int enable); -@@ -439,9 +438,9 @@ int dm_simplecmd_noflush (int task, const char *name, uint16_t udev_flags) - } - - static int --dm_device_remove (const char *name, int needsync, int deferred_remove) { -- return dm_simplecmd(DM_DEVICE_REMOVE, name, 0, needsync, 0, -- deferred_remove); -+dm_device_remove (const char *name, int flags) { -+ return dm_simplecmd(DM_DEVICE_REMOVE, name, 0, flags & DMFL_NEED_SYNC, 0, -+ flags & DMFL_DEFERRED); - } - - static int -@@ -1061,8 +1060,7 @@ partmap_in_use(const char *name, void *data) - return 0; - } - --int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, -- int need_suspend, int retries) -+int _dm_flush_map (const char *mapname, int flags, int retries) - { - int r; - int queue_if_no_path = 0; -@@ -1080,10 +1078,10 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, - - /* If you aren't doing a deferred remove, make sure that no - * devices are in use */ -- if (!deferred_remove && partmap_in_use(mapname, NULL)) -+ if (!(flags & DMFL_DEFERRED) && partmap_in_use(mapname, NULL)) - return DM_FLUSH_BUSY; - -- if (need_suspend && -+ if ((flags & DMFL_SUSPEND) && - dm_get_map(mapname, &mapsize, ¶ms) == DMP_OK && - strstr(params, "queue_if_no_path")) { - if (!_dm_queue_if_no_path(mapname, 0)) -@@ -1095,22 +1093,22 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, - free(params); - params = NULL; - -- if ((r = dm_remove_partmaps(mapname, need_sync, deferred_remove))) -+ if ((r = dm_remove_partmaps(mapname, flags))) - return r; - -- if (!deferred_remove && dm_get_opencount(mapname)) { -+ if (!(flags & DMFL_DEFERRED) && dm_get_opencount(mapname)) { - condlog(2, "%s: map in use", mapname); - return DM_FLUSH_BUSY; - } - - do { -- if (need_suspend && queue_if_no_path != -1) -+ if ((flags & DMFL_SUSPEND) && queue_if_no_path != -1) - dm_simplecmd_flush(DM_DEVICE_SUSPEND, mapname, 0); - -- r = dm_device_remove(mapname, need_sync, deferred_remove); -+ r = dm_device_remove(mapname, flags); - - if (r) { -- if (deferred_remove && dm_map_present(mapname)) { -+ if ((flags & DMFL_DEFERRED) && dm_map_present(mapname)) { - condlog(4, "multipath map %s remove deferred", - mapname); - return DM_FLUSH_DEFERRED; -@@ -1124,7 +1122,7 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, - } else { - condlog(2, "failed to remove multipath map %s", - mapname); -- if (need_suspend && queue_if_no_path != -1) { -+ if ((flags & DMFL_SUSPEND) && queue_if_no_path != -1) { - dm_simplecmd_noflush(DM_DEVICE_RESUME, - mapname, udev_flags); - } -@@ -1139,27 +1137,18 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove, - return DM_FLUSH_FAIL; - } - --#ifdef LIBDM_API_DEFERRED -- - int --dm_flush_map_nopaths(const char * mapname, int deferred_remove) -+dm_flush_map_nopaths(const char *mapname, int deferred_remove __DR_UNUSED__) - { -- return _dm_flush_map(mapname, 1, -- (deferred_remove == DEFERRED_REMOVE_ON || -- deferred_remove == DEFERRED_REMOVE_IN_PROGRESS), -- 0, 0); --} -- --#else -- --int --dm_flush_map_nopaths(const char * mapname, -- int deferred_remove __attribute__((unused))) --{ -- return _dm_flush_map(mapname, 1, 0, 0, 0); --} -+ int flags = DMFL_NEED_SYNC; - -+#ifdef LIBDM_API_DEFERRED -+ flags |= ((deferred_remove == DEFERRED_REMOVE_ON || -+ deferred_remove == DEFERRED_REMOVE_IN_PROGRESS) ? -+ DMFL_DEFERRED : 0); - #endif -+ return _dm_flush_map(mapname, flags, 0); -+} - - int dm_flush_maps (int retries) - { -@@ -1528,8 +1517,7 @@ out: - } - - struct remove_data { -- int need_sync; -- int deferred_remove; -+ int flags; - }; - - static int -@@ -1538,21 +1526,21 @@ remove_partmap(const char *name, void *data) - struct remove_data *rd = (struct remove_data *)data; - - if (dm_get_opencount(name)) { -- dm_remove_partmaps(name, rd->need_sync, rd->deferred_remove); -- if (rd->deferred_remove && dm_get_opencount(name)) { -+ dm_remove_partmaps(name, rd->flags); -+ if ((rd->flags & DMFL_DEFERRED) && dm_get_opencount(name)) { - condlog(2, "%s: map in use", name); - return DM_FLUSH_BUSY; - } - } - condlog(4, "partition map %s removed", name); -- dm_device_remove(name, rd->need_sync, rd->deferred_remove); -+ dm_device_remove(name, rd->flags); - return DM_FLUSH_OK; - } - - static int --dm_remove_partmaps (const char * mapname, int need_sync, int deferred_remove) -+dm_remove_partmaps (const char * mapname, int flags) - { -- struct remove_data rd = { need_sync, deferred_remove }; -+ struct remove_data rd = { flags }; - return do_foreach_partmaps(mapname, remove_partmap, &rd); - } - -diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h -index 93caa2aa..bb4a55a6 100644 ---- a/libmultipath/devmapper.h -+++ b/libmultipath/devmapper.h -@@ -58,12 +58,20 @@ enum { - }; - - int partmap_in_use(const char *name, void *data); --int _dm_flush_map (const char *, int, int, int, int); --int dm_flush_map_nopaths(const char * mapname, int deferred_remove); --#define dm_flush_map(mapname) _dm_flush_map(mapname, 1, 0, 0, 0) --#define dm_flush_map_nosync(mapname) _dm_flush_map(mapname, 0, 0, 0, 0) -+ -+enum { -+ DMFL_NONE = 0, -+ DMFL_NEED_SYNC = 1 << 0, -+ DMFL_DEFERRED = 1 << 1, -+ DMFL_SUSPEND = 1 << 2, -+}; -+ -+int _dm_flush_map (const char *mapname, int flags, int retries); -+#define dm_flush_map(mapname) _dm_flush_map(mapname, DMFL_NEED_SYNC, 0) -+#define dm_flush_map_nosync(mapname) _dm_flush_map(mapname, DMFL_NONE, 0) - #define dm_suspend_and_flush_map(mapname, retries) \ -- _dm_flush_map(mapname, 1, 0, 1, retries) -+ _dm_flush_map(mapname, DMFL_NEED_SYNC|DMFL_SUSPEND, retries) -+int dm_flush_map_nopaths(const char * mapname, int deferred_remove); - int dm_cancel_deferred_remove(struct multipath *mpp); - int dm_flush_maps (int retries); - int dm_fail_path(const char * mapname, char * path); diff --git a/0039-libmultipath-use-bitwise-flags-for-dm_simplecmd-API.patch b/0039-libmultipath-use-bitwise-flags-for-dm_simplecmd-API.patch deleted file mode 100644 index 1aee878..0000000 --- a/0039-libmultipath-use-bitwise-flags-for-dm_simplecmd-API.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 2 May 2024 18:45:17 +0200 -Subject: [PATCH] libmultipath: use bitwise flags for dm_simplecmd API - -Also use bitwise flags for dm_simplecmd() and its relatives. Again, -this makes the code more expressive and more readable, while -simplifying the function calls. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmultipath/devmapper.c | 26 +++++++++++++------------- - libmultipath/devmapper.h | 5 +++-- - 2 files changed, 16 insertions(+), 15 deletions(-) - -diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c -index a6a9c2b7..08bb3c51 100644 ---- a/libmultipath/devmapper.c -+++ b/libmultipath/devmapper.c -@@ -386,10 +386,9 @@ libmp_dm_task_create(int task) - } - - static int --dm_simplecmd (int task, const char *name, int no_flush, int need_sync, -- uint16_t udev_flags, int deferred_remove __DR_UNUSED__) { -+dm_simplecmd (int task, const char *name, int flags, uint16_t udev_flags) { - int r = 0; -- int udev_wait_flag = ((need_sync || udev_flags) && -+ int udev_wait_flag = (((flags & DMFL_NEED_SYNC) || udev_flags) && - (task == DM_DEVICE_RESUME || - task == DM_DEVICE_REMOVE)); - uint32_t cookie = 0; -@@ -404,11 +403,11 @@ dm_simplecmd (int task, const char *name, int no_flush, int need_sync, - dm_task_no_open_count(dmt); - dm_task_skip_lockfs(dmt); /* for DM_DEVICE_RESUME */ - #ifdef LIBDM_API_FLUSH -- if (no_flush) -+ if (flags & DMFL_NO_FLUSH) - dm_task_no_flush(dmt); /* for DM_DEVICE_SUSPEND/RESUME */ - #endif - #ifdef LIBDM_API_DEFERRED -- if (deferred_remove) -+ if (flags & DMFL_DEFERRED) - dm_task_deferred_remove(dmt); - #endif - if (udev_wait_flag && -@@ -429,18 +428,17 @@ out: - - int dm_simplecmd_flush (int task, const char *name, uint16_t udev_flags) - { -- return dm_simplecmd(task, name, 0, 1, udev_flags, 0); -+ return dm_simplecmd(task, name, DMFL_NEED_SYNC, udev_flags); - } - - int dm_simplecmd_noflush (int task, const char *name, uint16_t udev_flags) - { -- return dm_simplecmd(task, name, 1, 1, udev_flags, 0); -+ return dm_simplecmd(task, name, DMFL_NO_FLUSH|DMFL_NEED_SYNC, udev_flags); - } - - static int - dm_device_remove (const char *name, int flags) { -- return dm_simplecmd(DM_DEVICE_REMOVE, name, 0, flags & DMFL_NEED_SYNC, 0, -- flags & DMFL_DEFERRED); -+ return dm_simplecmd(DM_DEVICE_REMOVE, name, flags, 0); - } - - static int -@@ -594,8 +592,9 @@ int dm_addmap_reload(struct multipath *mpp, char *params, int flush) - params, ADDMAP_RO, 0); - } - if (r) -- r = dm_simplecmd(DM_DEVICE_RESUME, mpp->alias, !flush, -- 1, udev_flags, 0); -+ r = dm_simplecmd(DM_DEVICE_RESUME, mpp->alias, -+ DMFL_NEED_SYNC | (flush ? 0 : DMFL_NO_FLUSH), -+ udev_flags); - if (r) - return r; - -@@ -603,8 +602,9 @@ int dm_addmap_reload(struct multipath *mpp, char *params, int flush) - * drop the new table, so doing a second resume will try using - * the original table */ - if (dm_is_suspended(mpp->alias)) -- dm_simplecmd(DM_DEVICE_RESUME, mpp->alias, !flush, 1, -- udev_flags, 0); -+ dm_simplecmd(DM_DEVICE_RESUME, mpp->alias, -+ DMFL_NEED_SYNC | (flush ? 0 : DMFL_NO_FLUSH), -+ udev_flags); - return 0; - } - -diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h -index bb4a55a6..a242381e 100644 ---- a/libmultipath/devmapper.h -+++ b/libmultipath/devmapper.h -@@ -38,8 +38,8 @@ void skip_libmp_dm_init(void); - void libmp_dm_exit(void); - void libmp_udev_set_sync_support(int on); - struct dm_task *libmp_dm_task_create(int task); --int dm_simplecmd_flush (int, const char *, uint16_t); --int dm_simplecmd_noflush (int, const char *, uint16_t); -+int dm_simplecmd_flush (int task, const char *name, uint16_t udev_flags); -+int dm_simplecmd_noflush (int task, const char *name, uint16_t udev_flags); - int dm_addmap_create (struct multipath *mpp, char *params); - int dm_addmap_reload (struct multipath *mpp, char *params, int flush); - int dm_map_present (const char *); -@@ -64,6 +64,7 @@ enum { - DMFL_NEED_SYNC = 1 << 0, - DMFL_DEFERRED = 1 << 1, - DMFL_SUSPEND = 1 << 2, -+ DMFL_NO_FLUSH = 1 << 3, - }; - - int _dm_flush_map (const char *mapname, int flags, int retries); diff --git a/0040-libmultipath-add-argument-names-to-some-prototypes.patch b/0040-libmultipath-add-argument-names-to-some-prototypes.patch deleted file mode 100644 index 3244d55..0000000 --- a/0040-libmultipath-add-argument-names-to-some-prototypes.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 2 May 2024 18:46:42 +0200 -Subject: [PATCH] libmultipath: add argument names to some prototypes - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmultipath/devmapper.h | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h -index a242381e..19b79c5b 100644 ---- a/libmultipath/devmapper.h -+++ b/libmultipath/devmapper.h -@@ -42,12 +42,12 @@ int dm_simplecmd_flush (int task, const char *name, uint16_t udev_flags); - int dm_simplecmd_noflush (int task, const char *name, uint16_t udev_flags); - int dm_addmap_create (struct multipath *mpp, char *params); - int dm_addmap_reload (struct multipath *mpp, char *params, int flush); --int dm_map_present (const char *); -+int dm_map_present (const char *name); - int dm_map_present_by_uuid(const char *uuid); --int dm_get_map(const char *, unsigned long long *, char **); --int dm_get_status(const char *, char **); --int dm_type(const char *, char *); --int dm_is_mpath(const char *); -+int dm_get_map(const char *name, unsigned long long *size, char **outparams); -+int dm_get_status(const char *name, char **outstatus); -+int dm_type(const char *name, char *type); -+int dm_is_mpath(const char *name); - - enum { - DM_FLUSH_OK = 0, diff --git a/0041-libmultipath-bump-version-to-0.9.9.patch b/0041-libmultipath-bump-version-to-0.9.9.patch deleted file mode 100644 index 890b047..0000000 --- a/0041-libmultipath-bump-version-to-0.9.9.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 3 May 2024 22:09:10 +0200 -Subject: [PATCH] libmultipath: bump version to 0.9.9 - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - libmultipath/version.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libmultipath/version.h b/libmultipath/version.h -index e102975f..271d8e74 100644 ---- a/libmultipath/version.h -+++ b/libmultipath/version.h -@@ -20,9 +20,9 @@ - #ifndef _VERSION_H - #define _VERSION_H - --#define VERSION_CODE 0x000908 -+#define VERSION_CODE 0x000909 - /* MMDDYY, in hex */ --#define DATE_CODE 0x020F18 -+#define DATE_CODE 0x050318 - - #define PROG "multipath-tools" - diff --git a/0042-GitHub-Workflows-native.yaml-run-for-Fedora-40.patch b/0042-GitHub-Workflows-native.yaml-run-for-Fedora-40.patch deleted file mode 100644 index 47c3949..0000000 --- a/0042-GitHub-Workflows-native.yaml-run-for-Fedora-40.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 3 May 2024 22:28:34 +0200 -Subject: [PATCH] GitHub Workflows: native.yaml: run for Fedora 40 - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/workflows/native.yaml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml -index 0ef9df94..a062845e 100644 ---- a/.github/workflows/native.yaml -+++ b/.github/workflows/native.yaml -@@ -33,7 +33,7 @@ jobs: - - debian-buster - - debian-bullseye - - debian-bookworm -- - fedora-39 -+ - fedora-40 - - opensuse-leap - container: ghcr.io/mwilck/multipath-build-${{ matrix.os }} - steps: diff --git a/0043-update-NEWS.md.patch b/0043-update-NEWS.md.patch deleted file mode 100644 index 4edc69d..0000000 --- a/0043-update-NEWS.md.patch +++ /dev/null @@ -1,134 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 3 May 2024 23:11:48 +0200 -Subject: [PATCH] update NEWS.md - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/actions/spelling/expect.txt | 3 ++ - .github/actions/spelling/patterns.txt | 3 +- - NEWS.md | 62 +++++++++++++++++++++++++++ - 3 files changed, 67 insertions(+), 1 deletion(-) - -diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt -index fc9f22f8..bdfce83a 100644 ---- a/.github/actions/spelling/expect.txt -+++ b/.github/actions/spelling/expect.txt -@@ -17,6 +17,7 @@ blkid - bmarzins - cciss - CFLAGS -+cgroups - christophe - clangd - clariion -@@ -67,6 +68,7 @@ fulldescr - gcc - getprkey - getprstatus -+getrlimit - getuid - github - GPT -@@ -170,6 +172,7 @@ rootprefixdir - rpmbuild - rport - rtpi -+rtprio - sas - sbp - scsi -diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt -index 858faee6..aa361654 100644 ---- a/.github/actions/spelling/patterns.txt -+++ b/.github/actions/spelling/patterns.txt -@@ -22,7 +22,7 @@ - \bdmmp_pgs\b - \bdmmp_mpath_kdev_name_get\b - \bfast_io_fail_tmo\b --\bLimitRTPRIO\b -+\bLimitRTPRIO=?\b - \bmax_fds\b - \bmissing_uev_wait_timeout\b - \bMPATH_MAX_PARAM_LEN\b -@@ -87,6 +87,7 @@ - \bprin_resvdescr\b - \bprout_param_descriptor\b - \brq_servact\b -+\bRLIMIT_RTPRIO\b - \bSCHED_RT_PRIO\b - \bssize_t\b - \btrnptid_list\b -diff --git a/NEWS.md b/NEWS.md -index 0b094b98..4c54afa0 100644 ---- a/NEWS.md -+++ b/NEWS.md -@@ -1,5 +1,67 @@ - # multipath-tools Release Notes - -+## multipath-tools 0.9.9, 2024/05 -+ -+### User-Visible Changes -+ -+* *Changed realtime scheduling:* multipathd used to run at the highest possible -+ realtime priority, 99. This has always been excessive, and on some -+ distributions (e.g. RHEL 8), it hasn't worked at all. It is now possible to -+ set multipathd's real time scheduling by setting the hard limit for -+ `RLIMIT_RTPRIO` (see getrlimit(2)), which corresponds to the `rtprio` -+ setting in limits.conf and to `LimitRTPRIO=` in the systemd unit file. The -+ default in the systemd unit file has been set to 10. If the limit is set to -+ 0, multipathd doesn't attempt to enable real-time scheduling. -+ Otherwise, it will try to set the scheduling priority to the given value. -+ Fixes [#82](https://github.com/opensvc/multipath-tools/issues/82). -+* *Changed normal scheduling:* In order to make sure that multipathd has -+ sufficient priority even if real time scheduling is switched off, the -+ `CPUWeight=` setting in the unit file is set to 1000. This is necessary -+ because regular nice(2) values have no effect in systems with cgroups enabled. -+* *Changed handling of `max_sectors_kb` configuration:* multipathd applies -+ the `max_sectors_kb` setting only during map creation, or when a new path is -+ added to an existing map. The kernel makes sure that the multipath device -+ never has a larger `max_sectors_kb` value than any of its configured path -+ devices. The reason for this change is that applying `max_sectors_kb` on -+ live maps can cause IO errors and data loss in rare situations. -+ It can now happen that some path devices have a higher `max_sectors_kb` -+ value than the map; this is not an error. It is not possible any more to -+ decrease `max_sectors_kb` in `multipath.conf` and run `multipathd -+ reconfigure` to "apply" this setting to the map and its paths. If decreasing -+ the IO size is necessary, either destroy and recreate the map, or remove one -+ path with `multipathd del path $PATH`, run `multipathd reconfigure`, and -+ re-add the path with `multipathd add path $PATH`. -+* *New wildcard %k:* The wildcard `%k` for `max_sectors_kb` has been added to -+ the `multipathd show paths format` and `multipathd show maps format` -+ commands. -+* *Changed semantics of flush_on_last_del:* The `flush_on_last_del` option -+ now takes the values `always` , `unused`, or `never`. `yes` and `no` -+ are still accepted as aliases for `always` and `unused`, respectively. -+ `always` means that when all paths for a multipath map have been removed, -+ *outstanding IO will be failed* and the map will be deleted. `unused` means -+ that this will only happen when the map is not mounted or otherwise opened. -+ `never` means the map will only be removed if the `queue_if_no_path` -+ feature is off. -+ This fixes a problem where multipathd could hang when the last path of -+ a queueing map was deleted. -+ -+### Other major changes -+ -+* Adapted the dm-mpath udev rules such that they will work with the modified -+ device mapper udev rules (`DM_UDEV_RULES_VSN==3`, lvm2 > 2.03.22). They are -+ still compatible with older versions of the device-mapper udev rules. -+ -+### Bug fixes -+ -+* Fixed misspelled DM_UDEV_DISABLE_OTHER_RULES_FLAG in 11-dm-mpath.rules -+* Always use `glibc_basename()` to avoid some issues with MUSL libc. -+ Fixes [#84](https://github.com/opensvc/multipath-tools/pull/84). -+ -+### Other -+ -+* Build: added `TGTDIR` option to simplify building for a different target -+ host (see README.md). -+ - ## multipath-tools 0.9.8, 2024/02 - - ### User-Visible Changes diff --git a/0044-multipath.conf.5.in-fix-man-page-date.patch b/0044-multipath.conf.5.in-fix-man-page-date.patch deleted file mode 100644 index c9f2d5d..0000000 --- a/0044-multipath.conf.5.in-fix-man-page-date.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 3 May 2024 23:22:50 +0200 -Subject: [PATCH] multipath.conf.5.in: fix man page date - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - multipath/multipath.conf.5.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in -index 1d3d53bb..dacb9b0e 100644 ---- a/multipath/multipath.conf.5.in -+++ b/multipath/multipath.conf.5.in -@@ -6,7 +6,7 @@ - .\" Update the date below if you make any significant change. - .\" ---------------------------------------------------------------------------- - . --.TH MULTIPATH.CONF 5 2024-04-17 Linux -+.TH MULTIPATH.CONF 5 2024-04-25 Linux - . - . - .\" ---------------------------------------------------------------------------- diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 22e6ad7..b898339 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,5 +1,5 @@ Name: device-mapper-multipath -Version: 0.9.8 +Version: 0.9.9 Release: 1%{?dist} Summary: Tools to manage multipath devices using device-mapper License: GPLv2 @@ -7,66 +7,22 @@ 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.8.tar.gz -o multipath-tools-0.9.8.tgz -Source0: multipath-tools-0.9.8.tgz +# curl -L https://github.com/opensvc/multipath-tools/archive/0.9.9.tar.gz -o multipath-tools-0.9.9.tgz +Source0: multipath-tools-0.9.9.tgz Source1: multipath.conf -Patch0001: 0001-11-dm-mpath.rules-fix-misspelled-DM_UDEV_DISABLE_OTH.patch -Patch0002: 0002-multipathd-use-condlog-level-for-setscheduler-error-.patch -Patch0003: 0003-multipathd-make-multipathd-scheduling-configurable.patch -Patch0004: 0004-libmpathutil-really-always-use-glibc-basename.patch -Patch0005: 0005-multipathd-make-multipathd-set-priority-to-RLIMIT_RT.patch -Patch0006: 0006-multipathd-Set-CPUWeight-to-1000-and-LimitRTPRIO-to-.patch -Patch0007: 0007-11-dm-mpath.rules-explain-logic-for-device-becoming-.patch -Patch0008: 0008-11-dm-mpath.rules-don-t-import-DM_NOSCAN-from-udev-d.patch -Patch0009: 0009-11-dm-mpath.rules-don-t-import-ID_FS_VERSION-from-ud.patch -Patch0010: 0010-11-dm-mpath.rules-adapt-MPATH_DEVICE_READY-0-logic-t.patch -Patch0011: 0011-11-dm-mpath.rules-adapt-coldplug-event-handling-ro-1.patch -Patch0012: 0012-11-dm-mpath.rules-don-t-import-properties-with-new-1.patch -Patch0013: 0013-11-dm-mpath.rules-replace-DM_SUSPENDED-by-.DM_SUSPEN.patch -Patch0014: 0014-11-dm-mpath.rules-replace-DM_NOSCAN-by-.DM_NOSCAN.patch -Patch0015: 0015-11-dm-mpath.rules-simplify-PATH_FAILED-case.patch -Patch0016: 0016-11-dm-mpath.rules-make-label-names-more-intuitive.patch -Patch0017: 0017-kpartx.rules-ignore-DM_SUSPENDED.patch -Patch0018: 0018-multipath-tools-tests-fix-CI-failures-on-arm-v7-with.patch -Patch0019: 0019-multipath-tools-tests-fix-CI-failures-with-clang-on-.patch -Patch0020: 0020-GitHub-actions-fixes-for-spelling-CI.patch -Patch0021: 0021-GitHub-workflows-run-workflows-if-workflow-file-has-.patch -Patch0022: 0022-multipath-tools-add-TGTDIR-option.patch -Patch0023: 0023-libmultipath-move-get_udev_for_mpp-to-sysfs.c.patch -Patch0024: 0024-libmultipath-add-mp_find_path_by_devt.patch -Patch0025: 0025-Revert-libmultipath-fix-max_sectors_kb-on-adding-pat.patch -Patch0026: 0026-libmultipath-Only-set-max_sectors_kb-on-map-creation.patch -Patch0027: 0027-libmultipath-set-max_sectors_kb-in-adopt_paths.patch -Patch0028: 0028-libmultipath-add-wildcard-k-for-printing-max_sectors.patch -Patch0029: 0029-multipath.conf-5-update-documentation-for-max_sector.patch -Patch0030: 0030-multipath-tools-simplify-comment-in-hwtable.patch -Patch0031: 0031-multipath-tools-unify-text-in-multipath.conf.5.patch -Patch0032: 0032-multipath-tools-update-man-pages-dates.patch -Patch0033: 0033-libmultipath-export-partmap_in_use.patch -Patch0034: 0034-libmultipath-change-flush_on_last_del-to-fix-a-multi.patch -Patch0035: 0035-libmultipath-remove-redundant-config-option-from-Inf.patch -Patch0036: 0036-libmultipath-pad-dev_loss_tmo-to-avoid-race-with-no_.patch -Patch0037: 0037-libmultipath-fix-deferred_remove-function-arguments.patch -Patch0038: 0038-libmultipath-use-bitwise-flags-for-map-flushing-API.patch -Patch0039: 0039-libmultipath-use-bitwise-flags-for-dm_simplecmd-API.patch -Patch0040: 0040-libmultipath-add-argument-names-to-some-prototypes.patch -Patch0041: 0041-libmultipath-bump-version-to-0.9.9.patch -Patch0042: 0042-GitHub-Workflows-native.yaml-run-for-Fedora-40.patch -Patch0043: 0043-update-NEWS.md.patch -Patch0044: 0044-multipath.conf.5.in-fix-man-page-date.patch -Patch0045: 0045-RH-fixup-udev-rules-for-redhat.patch -Patch0046: 0046-RH-Remove-the-property-blacklist-exception-builtin.patch -Patch0047: 0047-RH-don-t-start-without-a-config-file.patch -Patch0048: 0048-RH-Fix-nvme-function-missing-argument.patch -Patch0049: 0049-RH-use-rpm-optflags-if-present.patch -Patch0050: 0050-RH-add-mpathconf.patch -Patch0051: 0051-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch -Patch0052: 0052-RH-reset-default-find_mutipaths-value-to-off.patch -Patch0053: 0053-RH-attempt-to-get-ANA-info-via-sysfs-first.patch -Patch0054: 0054-RH-make-parse_vpd_pg83-match-scsi_id-output.patch -Patch0055: 0055-RH-add-scsi-device-handlers-to-modules-load.d.patch -Patch0056: 0056-RH-compile-with-libreadline-support.patch -Patch0057: 0057-RH-Add-mpathcleanup.patch +Patch0001: 0001-RH-fixup-udev-rules-for-redhat.patch +Patch0002: 0002-RH-Remove-the-property-blacklist-exception-builtin.patch +Patch0003: 0003-RH-don-t-start-without-a-config-file.patch +Patch0004: 0004-RH-Fix-nvme-function-missing-argument.patch +Patch0005: 0005-RH-use-rpm-optflags-if-present.patch +Patch0006: 0006-RH-add-mpathconf.patch +Patch0007: 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +Patch0008: 0008-RH-reset-default-find_mutipaths-value-to-off.patch +Patch0009: 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch +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 # runtime Requires: %{name}-libs = %{version}-%{release} @@ -153,7 +109,7 @@ 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.8 -p1 +%autosetup -n multipath-tools-0.9.9 -p1 cp %{SOURCE1} . %build @@ -275,6 +231,12 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Thu Jun 13 2024 Benjamin Marzinski - 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 - 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 diff --git a/sources b/sources index b0337e2..f098bc9 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (multipath-tools-0.9.8.tgz) = 4d73bcf6bce769a829c306c609b206ddba65a708620f458106e406dd18d12f9a9d97f400662daa8e6a75c9fdf7decb6dcbda92cb807b6c53522c7b4b2795b627 +SHA512 (multipath-tools-0.9.9.tgz) = 65b5d5c48792f6041d700968c87675bc349ede475fe178a203814dbb0325f69895782a22c5c35f6c0157f694951714de9e83cc1464a6c062d911a58faed8960a SHA512 (multipath.conf) = 71953dce5a68adcf60a942305f5a66023e6f4c4baf53b1bfdb4edf65ed5b8e03db804363c36d1dcfd85591f4766f52b515269904c53b84d7b076da0b80b09942 From 4e4233829d041b14b0773e59b57ed1aca0de9b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 9 Jul 2024 12:58:25 +0200 Subject: [PATCH 04/19] Rebuilt for the bin-sbin merge https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin --- device-mapper-multipath.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index b898339..2897380 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.9.9 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tools to manage multipath devices using device-mapper License: GPLv2 URL: http://christophe.varoqui.free.fr/ @@ -231,6 +231,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Tue Jul 09 2024 Zbigniew JÄ™drzejewski-Szmek - 0.9.9-2 +- Rebuilt for the bin-sbin merge + * Thu Jun 13 2024 Benjamin Marzinski - 0.9.9-1 - Update source to upstream version 0.9.9 * Previous patches 0001-0044 are included in the source tarball From 3cde646adee765e1e8dca298f73db057039f317d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 17 Jul 2024 20:51:42 +0000 Subject: [PATCH 05/19] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- device-mapper-multipath.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 2897380..247501d 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.9.9 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Tools to manage multipath devices using device-mapper License: GPLv2 URL: http://christophe.varoqui.free.fr/ @@ -231,6 +231,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Wed Jul 17 2024 Fedora Release Engineering - 0.9.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Tue Jul 09 2024 Zbigniew JÄ™drzejewski-Szmek - 0.9.9-2 - Rebuilt for the bin-sbin merge From 519bd15b4dd30fadd1310fae97d8189ea061cae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Thu, 25 Jul 2024 11:35:35 +0200 Subject: [PATCH 06/19] convert GPLv3+ license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- device-mapper-multipath.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 247501d..fb448ed 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.9.9 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Tools to manage multipath devices using device-mapper License: GPLv2 URL: http://christophe.varoqui.free.fr/ @@ -90,7 +90,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} @@ -231,6 +232,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Thu Jul 25 2024 Miroslav Suchý - 0.9.9-4 +- convert license to SPDX + * Wed Jul 17 2024 Fedora Release Engineering - 0.9.9-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 354f1e7cfbad435492ff429f5a3e98e713a2530b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Mon, 29 Jul 2024 10:25:45 +0200 Subject: [PATCH 07/19] convert GPLv2 license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- device-mapper-multipath.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index fb448ed..6cd8a6d 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,8 +1,9 @@ Name: device-mapper-multipath Version: 0.9.9 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Tools to manage multipath devices using device-mapper -License: GPLv2 +# Automatically converted from old format: GPLv2 - review is highly recommended. +License: GPL-2.0-only URL: http://christophe.varoqui.free.fr/ # The source for this package was pulled from upstream's git repo. Use the @@ -232,6 +233,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Mon Jul 29 2024 Miroslav Suchý - 0.9.9-5 +- convert license to SPDX + * Thu Jul 25 2024 Miroslav Suchý - 0.9.9-4 - convert license to SPDX From 0c6649fa32544f07677c7495c8269bd0d95cc62b Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Fri, 9 Aug 2024 16:00:03 -0400 Subject: [PATCH 08/19] device-mapper-multipath-0.9.9-6 Add 0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch * multipath features tracking on failed removes --- ...tipathd-fix-flush-check-in-flush_map.patch | 28 +++++++++++++++++++ device-mapper-multipath.spec | 7 ++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0014-multipathd-fix-flush-check-in-flush_map.patch diff --git a/0014-multipathd-fix-flush-check-in-flush_map.patch b/0014-multipathd-fix-flush-check-in-flush_map.patch new file mode 100644 index 0000000..3ff957d --- /dev/null +++ b/0014-multipathd-fix-flush-check-in-flush_map.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 5 Jun 2024 19:22:48 -0400 +Subject: [PATCH] multipathd: fix flush check in flush_map() + +Forgot the comparison in the "if" statement. + +Fixes 8a3898339 ("multipathd: sync features on flush_map failure corner case") + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + multipathd/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipathd/main.c b/multipathd/main.c +index 09286dd0..58afe14a 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -813,7 +813,7 @@ flush_map(struct multipath * mpp, struct vectors * vecs) + { + int r = dm_suspend_and_flush_map(mpp->alias, 0); + if (r != DM_FLUSH_OK) { +- if (DM_FLUSH_FAIL_CANT_RESTORE) ++ if (r == DM_FLUSH_FAIL_CANT_RESTORE) + remove_feature(&mpp->features, "queue_if_no_path"); + condlog(0, "%s: can't flush", mpp->alias); + return r; diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 6cd8a6d..9e74d46 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.9.9 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Tools to manage multipath devices using device-mapper # Automatically converted from old format: GPLv2 - review is highly recommended. License: GPL-2.0-only @@ -24,6 +24,7 @@ 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-flush-check-in-flush_map.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -233,6 +234,10 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Fri Aug 9 2024 Benjamin Marzinski - 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ý - 0.9.9-5 - convert license to SPDX From 94144d9276e41dd879043596114d248db042dbc5 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Thu, 29 Aug 2024 15:20:13 -0400 Subject: [PATCH 09/19] device-mapper-multipath-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 --- .gitignore | 1 + 0001-RH-fixup-udev-rules-for-redhat.patch | 20 ++++----- ...property-blacklist-exception-builtin.patch | 8 ++-- ...RH-don-t-start-without-a-config-file.patch | 16 +++---- ...H-Fix-nvme-function-missing-argument.patch | 2 +- 0005-RH-use-rpm-optflags-if-present.patch | 30 ++++++++----- 0006-RH-add-mpathconf.patch | 43 +++++++++++++++---- ...om-kernel-cmdline-mpath.wwids-with-A.patch | 16 +++---- ...-default-find_mutipaths-value-to-off.patch | 8 ++-- ...-parse_vpd_pg83-match-scsi_id-output.patch | 2 +- ...si-device-handlers-to-modules-load.d.patch | 2 +- ...-RH-compile-with-libreadline-support.patch | 2 +- ...tipathd-fix-flush-check-in-flush_map.patch | 28 ------------ device-mapper-multipath.spec | 17 +++++--- sources | 2 +- 15 files changed, 105 insertions(+), 92 deletions(-) delete mode 100644 0014-multipathd-fix-flush-check-in-flush_map.patch diff --git a/.gitignore b/.gitignore index 3bea72e..908094d 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ multipath-tools-091027.tar.gz /multipath-tools-0.9.7.tgz /multipath-tools-0.9.8.tgz /multipath-tools-0.9.9.tgz +/multipath-tools-0.10.0.tgz diff --git a/0001-RH-fixup-udev-rules-for-redhat.patch b/0001-RH-fixup-udev-rules-for-redhat.patch index d78919e..0645240 100644 --- a/0001-RH-fixup-udev-rules-for-redhat.patch +++ b/0001-RH-fixup-udev-rules-for-redhat.patch @@ -9,13 +9,13 @@ different naming scheme for partitions than SuSE. Signed-off-by: Benjamin Marzinski --- - 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 81b86cd8..33dbb99c 100644 +index 729618bd..81cb61d2 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -34,7 +34,7 @@ endif @@ -27,16 +27,16 @@ index 81b86cd8..33dbb99c 100644 # Prefix for non-essential libraries (libdmmp) usr_prefix := $(if $(prefix),$(prefix),/usr) # Prefix for configuration files (multipath.conf) -diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules -index 8dd3369c..7c3c7524 100644 ---- a/kpartx/kpartx.rules -+++ b/kpartx/kpartx.rules +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 diff --git a/0002-RH-Remove-the-property-blacklist-exception-builtin.patch b/0002-RH-Remove-the-property-blacklist-exception-builtin.patch index b039539..a74e6c2 100644 --- a/0002-RH-Remove-the-property-blacklist-exception-builtin.patch +++ b/0002-RH-Remove-the-property-blacklist-exception-builtin.patch @@ -19,7 +19,7 @@ Signed-off-by: Benjamin Marzinski 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 dacb9b0e..645e8f88 100644 +index 4388baad..af9fbb96 100644 --- a/multipath/multipath.conf.5.in +++ b/multipath/multipath.conf.5.in -@@ -1468,9 +1468,14 @@ keywords. Both are regular expressions. For a full description of these keywords +@@ -1469,9 +1469,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 dacb9b0e..645e8f88 100644 . .RS .PP -@@ -1481,10 +1486,6 @@ Blacklisting by missing properties is only applied to devices which do have the +@@ -1482,10 +1487,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. diff --git a/0003-RH-don-t-start-without-a-config-file.patch b/0003-RH-don-t-start-without-a-config-file.patch index 267ffa7..02827df 100644 --- a/0003-RH-don-t-start-without-a-config-file.patch +++ b/0003-RH-don-t-start-without-a-config-file.patch @@ -22,10 +22,10 @@ Signed-off-by: Benjamin Marzinski 7 files changed, 25 insertions(+) diff --git a/libmultipath/config.c b/libmultipath/config.c -index 83fa7369..002027a7 100644 +index 0e3a5cc1..80f61914 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c -@@ -959,6 +959,19 @@ int _init_config (const char *file, struct config *conf) +@@ -959,6 +959,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 83fa7369..002027a7 100644 conf->processed_main_config = 1; diff --git a/libmultipath/config.h b/libmultipath/config.h -index 384193ab..158cebf0 100644 +index 94cdf252..534b6142 100644 --- a/libmultipath/config.h +++ b/libmultipath/config.h @@ -10,6 +10,7 @@ @@ -58,10 +58,10 @@ index 384193ab..158cebf0 100644 enum devtypes { DEV_NONE, diff --git a/multipath/main.c b/multipath/main.c -index ce702e7f..c21e3e0b 100644 +index 28e3a055..346acb61 100644 --- a/multipath/main.c +++ b/multipath/main.c -@@ -842,11 +842,14 @@ main (int argc, char *argv[]) +@@ -843,11 +843,14 @@ main (int argc, char *argv[]) char *dev = NULL; struct config *conf; bool enable_foreign = false; @@ -76,7 +76,7 @@ index ce702e7f..c21e3e0b 100644 if (init_config(DEFAULT_CONFIGFILE)) exit(RTVL_FAIL); if (atexit(uninit_config)) -@@ -1097,6 +1100,9 @@ main (int argc, char *argv[]) +@@ -1101,6 +1104,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 ce702e7f..c21e3e0b 100644 put_multipath_config(conf); if (dev) diff --git a/multipath/multipath.rules.in b/multipath/multipath.rules.in -index 780bf852..2c518378 100644 +index 2ac1972f..cc248231 100644 --- a/multipath/multipath.rules.in +++ b/multipath/multipath.rules.in @@ -9,6 +9,7 @@ IMPORT{cmdline}="nompath" @@ -112,7 +112,7 @@ index 7bc8806e..315884eb 100644 . .\" ---------------------------------------------------------------------------- diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in -index a63ddd9a..01ceff7d 100644 +index 646001e6..72e44849 100644 --- a/multipathd/multipathd.service.in +++ b/multipathd/multipathd.service.in @@ -6,6 +6,7 @@ Wants=systemd-udevd-kernel.socket @MODPROBE_UNIT@ diff --git a/0004-RH-Fix-nvme-function-missing-argument.patch b/0004-RH-Fix-nvme-function-missing-argument.patch index ced7159..74b7b53 100644 --- a/0004-RH-Fix-nvme-function-missing-argument.patch +++ b/0004-RH-Fix-nvme-function-missing-argument.patch @@ -12,7 +12,7 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/nvme/argconfig.h b/libmultipath/nvme/argconfig.h -index adb192b6..bfd10ef8 100644 +index e6c54453..0c6c9439 100644 --- a/libmultipath/nvme/argconfig.h +++ b/libmultipath/nvme/argconfig.h @@ -76,7 +76,7 @@ struct argconfig_commandline_options { diff --git a/0005-RH-use-rpm-optflags-if-present.patch b/0005-RH-use-rpm-optflags-if-present.patch index 0f354e7..3f115c1 100644 --- a/0005-RH-use-rpm-optflags-if-present.patch +++ b/0005-RH-use-rpm-optflags-if-present.patch @@ -9,19 +9,18 @@ still being generic. Signed-off-by: Benjamin Marzinski --- - 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 33dbb99c..94e0ec85 100644 +index 81cb61d2..35334a0c 100644 --- a/Makefile.inc +++ b/Makefile.inc -@@ -95,11 +95,23 @@ SYSTEMD_LIBDEPS := $(if $(SYSTEMD),$(if $(shell test $(SYSTEMD) -gt 209 && echo +@@ -99,28 +99,39 @@ 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,27 @@ index 33dbb99c..94e0ec85 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) \ -D_FILE_OFFSET_BITS=64 \ -DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(TGTDIR)$(plugindir)\" \ -DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \ -@@ -109,7 +121,7 @@ CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe + -DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" -DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \ + -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP +-CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \ +- -fexceptions ++CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe BIN_CFLAGS := -fPIE -DPIE LIB_CFLAGS := -fPIC SHARED_FLAGS := -shared diff --git a/0006-RH-add-mpathconf.patch b/0006-RH-add-mpathconf.patch index fd65e34..2ae48f3 100644 --- a/0006-RH-add-mpathconf.patch +++ b/0006-RH-add-mpathconf.patch @@ -13,19 +13,44 @@ a single command. Co-authored-by: Paul Donohue Signed-off-by: Benjamin Marzinski --- - 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 934f582e..61351583 100644 +--- a/.github/actions/spelling/expect.txt ++++ b/.github/actions/spelling/expect.txt +@@ -124,9 +124,11 @@ lvmteam + Marzinski + mpath + mpathb ++mpathconf + mpathpersist + mpathvalid + msecs ++multipathable + multipathc + multipathd + multipathed +@@ -144,6 +146,7 @@ ontap + OOM + opensvc + OPTFLAGS ++outfile + paramp + partx + pathgroup diff --git a/libmultipath/config.c b/libmultipath/config.c -index 002027a7..3d5943d3 100644 +index 80f61914..1373f15b 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c -@@ -961,6 +961,8 @@ int _init_config (const char *file, struct config *conf) +@@ -961,6 +961,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."); @@ -735,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 @@ @@ -877,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 diff --git a/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch b/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch index 9884258..4e781fa 100644 --- a/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +++ b/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch @@ -20,7 +20,7 @@ Signed-off-by: Benjamin Marzinski 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/multipath/main.c b/multipath/main.c -index c21e3e0b..3f3ac9fb 100644 +index 346acb61..adc50d69 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -120,7 +120,7 @@ usage (char * progname) @@ -41,7 +41,7 @@ index c21e3e0b..3f3ac9fb 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) +@@ -449,6 +451,50 @@ static void cleanup_vecs(void) free_pathvec(vecs.pathvec, FREE_PATHS); } @@ -92,7 +92,7 @@ index c21e3e0b..3f3ac9fb 100644 static int configure (struct config *conf, enum mpath_cmds cmd, enum devtypes dev_type, char *devpath) -@@ -861,7 +907,7 @@ main (int argc, char *argv[]) +@@ -860,7 +906,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 c21e3e0b..3f3ac9fb 100644 switch(arg) { case 'v': if (!isdigit(optarg[0])) { -@@ -932,6 +978,10 @@ main (int argc, char *argv[]) +@@ -931,6 +977,10 @@ main (int argc, char *argv[]) case 'T': cmd = CMD_DUMP_CONFIG; break; @@ -138,14 +138,14 @@ index b88e9a4c..edd742aa 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 01ceff7d..e0c2011b 100644 +index 72e44849..69a6c39d 100644 --- a/multipathd/multipathd.service.in +++ b/multipathd/multipathd.service.in @@ -17,6 +17,7 @@ ConditionVirtualization=!container [Service] Type=notify NotifyAccess=main -+ExecStartPre=-/sbin/multipath -A - ExecStart=/sbin/multipathd -d -s - ExecReload=/sbin/multipathd reconfigure ++ExecStartPre=-@BINDIR@/multipath -A + ExecStart=@BINDIR@/multipathd -d -s + ExecReload=@BINDIR@/multipathd reconfigure TasksMax=infinity diff --git a/0008-RH-reset-default-find_mutipaths-value-to-off.patch b/0008-RH-reset-default-find_mutipaths-value-to-off.patch index 04ad52c..5789916 100644 --- a/0008-RH-reset-default-find_mutipaths-value-to-off.patch +++ b/0008-RH-reset-default-find_mutipaths-value-to-off.patch @@ -14,10 +14,10 @@ Signed-off-by: Benjamin Marzinski 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h -index ed08c251..4b033ff9 100644 +index 02f7e57c..cd03fd1a 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 ed08c251..4b033ff9 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 645e8f88..a7543939 100644 +index af9fbb96..0c1eff40 100644 --- a/multipath/multipath.conf.5.in +++ b/multipath/multipath.conf.5.in -@@ -1225,7 +1225,7 @@ as non-multipath and passed on to upper layers. +@@ -1226,7 +1226,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 diff --git a/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch b/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch index c090da0..06194f6 100644 --- a/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch +++ b/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch @@ -14,7 +14,7 @@ Signed-off-by: Benjamin Marzinski 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c -index e2052422..3bcd94ce 100644 +index e94705bf..61ac27ef 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -1221,13 +1221,9 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, diff --git a/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch b/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch index 7624c5b..3debe8a 100644 --- a/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch +++ b/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch @@ -11,7 +11,7 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc -index 94e0ec85..49514b06 100644 +index 35334a0c..377125b6 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -16,7 +16,7 @@ READLINE := diff --git a/0012-RH-compile-with-libreadline-support.patch b/0012-RH-compile-with-libreadline-support.patch index eb0ab13..db04640 100644 --- a/0012-RH-compile-with-libreadline-support.patch +++ b/0012-RH-compile-with-libreadline-support.patch @@ -12,7 +12,7 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc -index 49514b06..a3ed9f28 100644 +index 377125b6..4a6528a9 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -12,7 +12,7 @@ diff --git a/0014-multipathd-fix-flush-check-in-flush_map.patch b/0014-multipathd-fix-flush-check-in-flush_map.patch deleted file mode 100644 index 3ff957d..0000000 --- a/0014-multipathd-fix-flush-check-in-flush_map.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Wed, 5 Jun 2024 19:22:48 -0400 -Subject: [PATCH] multipathd: fix flush check in flush_map() - -Forgot the comparison in the "if" statement. - -Fixes 8a3898339 ("multipathd: sync features on flush_map failure corner case") - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck ---- - multipathd/main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/multipathd/main.c b/multipathd/main.c -index 09286dd0..58afe14a 100644 ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -813,7 +813,7 @@ flush_map(struct multipath * mpp, struct vectors * vecs) - { - int r = dm_suspend_and_flush_map(mpp->alias, 0); - if (r != DM_FLUSH_OK) { -- if (DM_FLUSH_FAIL_CANT_RESTORE) -+ if (r == DM_FLUSH_FAIL_CANT_RESTORE) - remove_feature(&mpp->features, "queue_if_no_path"); - condlog(0, "%s: can't flush", mpp->alias); - return r; diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 9e74d46..da97503 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath -Version: 0.9.9 -Release: 6%{?dist} +Version: 0.10.0 +Release: 1%{?dist} Summary: Tools to manage multipath devices using device-mapper # Automatically converted from old format: GPLv2 - review is highly recommended. License: GPL-2.0-only @@ -8,8 +8,8 @@ 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.9.tar.gz -o multipath-tools-0.9.9.tgz -Source0: multipath-tools-0.9.9.tgz +# curl -L https://github.com/opensvc/multipath-tools/archive/0.10.0.tar.gz -o multipath-tools-0.10.0.tgz +Source0: multipath-tools-0.10.0.tgz Source1: multipath.conf Patch0001: 0001-RH-fixup-udev-rules-for-redhat.patch Patch0002: 0002-RH-Remove-the-property-blacklist-exception-builtin.patch @@ -24,7 +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-flush-check-in-flush_map.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -112,7 +111,7 @@ 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.9 -p1 +%autosetup -n multipath-tools-0.10.0 -p1 cp %{SOURCE1} . %build @@ -234,6 +233,12 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Thu Aug 29 2024 Benjamin Marzinski - 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 - 0.9.9-6 - Add 0014-multipathd-fix-null-pointer-dereference-in-uev_updat.patch * multipath features tracking on failed removes diff --git a/sources b/sources index f098bc9..da06e16 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (multipath-tools-0.9.9.tgz) = 65b5d5c48792f6041d700968c87675bc349ede475fe178a203814dbb0325f69895782a22c5c35f6c0157f694951714de9e83cc1464a6c062d911a58faed8960a +SHA512 (multipath-tools-0.10.0.tgz) = 8f545609fa20df7547428f2929571dc0df87c17d9f61f11aad3559446c2e94755e18b1c4b3780b3de92ec2cbc450939ca15a9d6c95551eee4084064d83874b2d SHA512 (multipath.conf) = 71953dce5a68adcf60a942305f5a66023e6f4c4baf53b1bfdb4edf65ed5b8e03db804363c36d1dcfd85591f4766f52b515269904c53b84d7b076da0b80b09942 From 75d5c0c70a04b7033f662e60c47f6634298a067e Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Thu, 29 Aug 2024 18:11:38 -0400 Subject: [PATCH 10/19] device-mapper-multipath-0.10.0-2 Update CI tests. --- device-mapper-multipath.spec | 5 +- tests/bindings/main.sh | 126 ++++++++--- tests/find_multipaths/Makefile | 49 ----- tests/find_multipaths/main.sh | 208 ++++++++++++------- tests/include/ec.sh | 14 +- tests/medium_error_scsi_debug/main.sh | 66 +++--- tests/restate_module/main.sh | 6 +- tests/user_friendly_names/main.sh | 151 ++++++++++---- tests/user_friendly_names/multipath.conf.no | 3 - tests/user_friendly_names/multipath.conf.yes | 11 - 10 files changed, 395 insertions(+), 244 deletions(-) delete mode 100644 tests/find_multipaths/Makefile delete mode 100644 tests/user_friendly_names/multipath.conf.no delete mode 100644 tests/user_friendly_names/multipath.conf.yes diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index da97503..4363b49 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.10.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tools to manage multipath devices using device-mapper # Automatically converted from old format: GPLv2 - review is highly recommended. License: GPL-2.0-only @@ -233,6 +233,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Thu Aug 29 2024 Benjamin Marzinski - 0.10.0-2 +- update CI tests. + * Thu Aug 29 2024 Benjamin Marzinski - 0.10.0-1 - Update source to upstream version 0.9.9 * Previous patch 0014-multipathd-fix-flush-check-in-flush_map.patch is diff --git a/tests/bindings/main.sh b/tests/bindings/main.sh index 2d6f284..76292e4 100755 --- a/tests/bindings/main.sh +++ b/tests/bindings/main.sh @@ -18,40 +18,110 @@ # Author: Lin Li #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 diff --git a/tests/find_multipaths/Makefile b/tests/find_multipaths/Makefile deleted file mode 100644 index b78dc57..0000000 --- a/tests/find_multipaths/Makefile +++ /dev/null @@ -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 . -# -# # Author: Lin Li - -.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 " > $(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) diff --git a/tests/find_multipaths/main.sh b/tests/find_multipaths/main.sh index 4d94c87..28c325c 100755 --- a/tests/find_multipaths/main.sh +++ b/tests/find_multipaths/main.sh @@ -18,39 +18,92 @@ # Author: Lin Li #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 diff --git a/tests/include/ec.sh b/tests/include/ec.sh index 22dfc40..4b0aba9 100755 --- a/tests/include/ec.sh +++ b/tests/include/ec.sh @@ -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 { diff --git a/tests/medium_error_scsi_debug/main.sh b/tests/medium_error_scsi_debug/main.sh index db2f008..35c6e6f 100755 --- a/tests/medium_error_scsi_debug/main.sh +++ b/tests/medium_error_scsi_debug/main.sh @@ -16,47 +16,51 @@ # along with this program. If not, see . # Author: LiLin +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 diff --git a/tests/restate_module/main.sh b/tests/restate_module/main.sh index 565e59c..be60eba 100755 --- a/tests/restate_module/main.sh +++ b/tests/restate_module/main.sh @@ -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 diff --git a/tests/user_friendly_names/main.sh b/tests/user_friendly_names/main.sh index 56082fd..1d48801 100755 --- a/tests/user_friendly_names/main.sh +++ b/tests/user_friendly_names/main.sh @@ -17,50 +17,125 @@ # Author: Lin Li -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 diff --git a/tests/user_friendly_names/multipath.conf.no b/tests/user_friendly_names/multipath.conf.no deleted file mode 100644 index b916bfb..0000000 --- a/tests/user_friendly_names/multipath.conf.no +++ /dev/null @@ -1,3 +0,0 @@ -defaults { - user_friendly_names no -} diff --git a/tests/user_friendly_names/multipath.conf.yes b/tests/user_friendly_names/multipath.conf.yes deleted file mode 100644 index ffc21bb..0000000 --- a/tests/user_friendly_names/multipath.conf.yes +++ /dev/null @@ -1,11 +0,0 @@ -defaults { - user_friendly_names yes -} - -multipaths { - multipath { - wwid your_wwid - alias test - } -} - From 4ec4661deede93f7134c87624f89a07ac166e3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 12 Jan 2025 14:25:51 +0100 Subject: [PATCH 11/19] Rebuilt for the bin-sbin merge (2nd attempt) https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin --- device-mapper-multipath.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 4363b49..2eebd2f 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.10.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Tools to manage multipath devices using device-mapper # Automatically converted from old format: GPLv2 - review is highly recommended. License: GPL-2.0-only @@ -233,6 +233,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Sun Jan 12 2025 Zbigniew JÄ™drzejewski-Szmek - 0.10.0-3 +- Rebuilt for the bin-sbin merge (2nd attempt) + * Thu Aug 29 2024 Benjamin Marzinski - 0.10.0-2 - update CI tests. From 61847c90be2f7afa60de098651ff5c92cd0f1374 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jan 2025 15:37:12 +0000 Subject: [PATCH 12/19] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- device-mapper-multipath.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 2eebd2f..8ff030a 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.10.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Tools to manage multipath devices using device-mapper # Automatically converted from old format: GPLv2 - review is highly recommended. License: GPL-2.0-only @@ -233,6 +233,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Thu Jan 16 2025 Fedora Release Engineering - 0.10.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sun Jan 12 2025 Zbigniew JÄ™drzejewski-Szmek - 0.10.0-3 - Rebuilt for the bin-sbin merge (2nd attempt) From 05ecb26e7c73e0563c5b4096bf6288324b753cea Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 28 Jan 2025 23:12:39 -0500 Subject: [PATCH 13/19] Fix build with userspace-rcu 0.15.0 C11 (or C++11) are now required for atomics in userspace-rcu: https://github.com/urcu/userspace-rcu/commit/89280d020bf064d1055c360fb9974f128051043f --- 0005-RH-use-rpm-optflags-if-present.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/0005-RH-use-rpm-optflags-if-present.patch b/0005-RH-use-rpm-optflags-if-present.patch index 3f115c1..266e224 100644 --- a/0005-RH-use-rpm-optflags-if-present.patch +++ b/0005-RH-use-rpm-optflags-if-present.patch @@ -54,7 +54,7 @@ index 81cb61d2..35334a0c 100644 -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP -CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \ - -fexceptions -+CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe ++CFLAGS := -std=gnu11 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe BIN_CFLAGS := -fPIE -DPIE LIB_CFLAGS := -fPIC SHARED_FLAGS := -shared From 3c2eb3f84ecbc2fd6790437dc83955ab4fd6cc33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Mon, 20 Jan 2025 08:06:30 +0000 Subject: [PATCH 14/19] Migrate to SPDX license This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- device-mapper-multipath.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 8ff030a..d2c3cc6 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -2,8 +2,8 @@ Name: device-mapper-multipath Version: 0.10.0 Release: 4%{?dist} Summary: Tools to manage multipath devices using device-mapper -# Automatically converted from old format: GPLv2 - review is highly recommended. -License: GPL-2.0-only +# 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 @@ -65,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 From f2377371e3fef1c096acab223bd842dbd755f5d0 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Sun, 2 Feb 2025 01:54:16 -0500 Subject: [PATCH 15/19] device-mapper-multipath-0.10.0-5 - Update source to upstream staging branch for 0.10.y (will be 0.10.2 when merged). - Rebase redhat patches --- ...lows-use-upload-download-artifact-v4.patch | 122 ++++++++++++++++ ...-update-dawidd6-action-download-arti.patch | 24 +++ ...-native.yml-use-mosteo-actions-docke.patch | 98 +++++++++++++ ...s-native.yml-use-extra-job-for-clang.patch | 43 ++++++ ...-native.yaml-make-test-and-archive-s.patch | 51 +++++++ ...-enable-unit-tests-for-stable-branch.patch | 133 +++++++++++++++++ ...ws-add-abi-check-for-stable-branches.patch | 110 ++++++++++++++ ...get_maps-don-t-bail-out-for-single-m.patch | 32 ++++ ...s.in-import-DM_COLDPLUG_SUSPENDED-on.patch | 42 ++++++ ...s.in-handle-inactive-suspended-devic.patch | 66 +++++++++ ...rules.in-clarify-DM_ACTIVATION-logic.patch | 78 ++++++++++ ...h-rules.in-skip-one-.DM_NOSCAN-check.patch | 28 ++++ ...s.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch | 44 ++++++ ...-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch | 31 ++++ ...eferred_failback_tick-for-reload-rem.patch | 35 +++++ ...ipathd-fix-an-unsigned-int-ovwerflow.patch | 28 ++++ ...id-Wcast-function-type-mismatch-erro.patch | 36 +++++ 0018-Update-NEWS.md-for-0.10.1.patch | 44 ++++++ ...-t-print-error-message-if-WATCHDOG_U.patch | 30 ++++ ...uce-log-level-of-map-X-has-multiple-.patch | 38 +++++ ...eign-fix-memory-leak-in-nvme-foreign.patch | 54 +++++++ ...-condition-for-enqueueing-path-to-io.patch | 41 ++++++ ...dditional-NEWS.md-updates-for-0.10.1.patch | 63 ++++++++ ...multipath-fix-handling-of-pp-pgindex.patch | 138 ++++++++++++++++++ ...e-pgcmp-detect-if-map-is-missing-a-p.patch | 70 +++++++++ ...gger-uevents-upon-map-creation-in-do.patch | 94 ++++++++++++ ...er-uevents-upon-map-removal-in-coale.patch | 41 ++++++ ...h-Don-t-skip-set_path_max_sectors_kb.patch | 31 ++++ ...p-static-analyzer-complaint-in-init_.patch | 27 ++++ ...lenient-in-allowing-the-alua-based-p.patch | 44 ++++++ 0031-Update-NEWS.md-for-0.10.2.patch | 64 ++++++++ ...-fix-abi-stable.yaml-for-pull-reques.patch | 61 ++++++++ ... 0033-RH-fixup-udev-rules-for-redhat.patch | 0 ...property-blacklist-exception-builtin.patch | 0 ...RH-don-t-start-without-a-config-file.patch | 4 +- ...H-Fix-nvme-function-missing-argument.patch | 0 ... 0037-RH-use-rpm-optflags-if-present.patch | 3 +- ...hconf.patch => 0038-RH-add-mpathconf.patch | 12 +- ...om-kernel-cmdline-mpath.wwids-with-A.patch | 0 ...-default-find_mutipaths-value-to-off.patch | 0 ...empt-to-get-ANA-info-via-sysfs-first.patch | 0 ...-parse_vpd_pg83-match-scsi_id-output.patch | 2 +- ...si-device-handlers-to-modules-load.d.patch | 2 +- ...-RH-compile-with-libreadline-support.patch | 2 +- ...up.patch => 0045-RH-Add-mpathcleanup.patch | 0 device-mapper-multipath.spec | 65 +++++++-- 46 files changed, 1905 insertions(+), 26 deletions(-) create mode 100644 0001-GitHub-workflows-use-upload-download-artifact-v4.patch create mode 100644 0002-GitHub-workflows-update-dawidd6-action-download-arti.patch create mode 100644 0003-Github-workflows-native.yml-use-mosteo-actions-docke.patch create mode 100644 0004-GitHub-workflows-native.yml-use-extra-job-for-clang.patch create mode 100644 0005-GitHub-workflows-native.yaml-make-test-and-archive-s.patch create mode 100644 0006-GitHub-workflows-enable-unit-tests-for-stable-branch.patch create mode 100644 0007-GitHub-Workflows-add-abi-check-for-stable-branches.patch create mode 100644 0008-libmultipath-dm_get_maps-don-t-bail-out-for-single-m.patch create mode 100644 0009-11-dm-mpath.rules.in-import-DM_COLDPLUG_SUSPENDED-on.patch create mode 100644 0010-11-dm-mpath.rules.in-handle-inactive-suspended-devic.patch create mode 100644 0011-11-dm-mpath.rules.in-clarify-DM_ACTIVATION-logic.patch create mode 100644 0012-11-dm-mpath-rules.in-skip-one-.DM_NOSCAN-check.patch create mode 100644 0013-11-dm-mpath.rules.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch create mode 100644 0014-libmultipath-don-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch create mode 100644 0015-multipathd-fix-deferred_failback_tick-for-reload-rem.patch create mode 100644 0016-multipathd-fix-an-unsigned-int-ovwerflow.patch create mode 100644 0017-libmpathutil-avoid-Wcast-function-type-mismatch-erro.patch create mode 100644 0018-Update-NEWS.md-for-0.10.1.patch create mode 100644 0019-libmultipath-don-t-print-error-message-if-WATCHDOG_U.patch create mode 100644 0020-libmultipath-reduce-log-level-of-map-X-has-multiple-.patch create mode 100644 0021-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch create mode 100644 0022-libmultipath-add-condition-for-enqueueing-path-to-io.patch create mode 100644 0023-Additional-NEWS.md-updates-for-0.10.1.patch create mode 100644 0024-libmultipath-fix-handling-of-pp-pgindex.patch create mode 100644 0025-libmultipath-make-pgcmp-detect-if-map-is-missing-a-p.patch create mode 100644 0026-libmultipath-trigger-uevents-upon-map-creation-in-do.patch create mode 100644 0027-multipathd-trigger-uevents-upon-map-removal-in-coale.patch create mode 100644 0028-libmultipath-Don-t-skip-set_path_max_sectors_kb.patch create mode 100644 0029-libmultipath-stop-static-analyzer-complaint-in-init_.patch create mode 100644 0030-libmultipath-be-lenient-in-allowing-the-alua-based-p.patch create mode 100644 0031-Update-NEWS.md-for-0.10.2.patch create mode 100644 0032-GitHub-Workflows-fix-abi-stable.yaml-for-pull-reques.patch rename 0001-RH-fixup-udev-rules-for-redhat.patch => 0033-RH-fixup-udev-rules-for-redhat.patch (100%) rename 0002-RH-Remove-the-property-blacklist-exception-builtin.patch => 0034-RH-Remove-the-property-blacklist-exception-builtin.patch (100%) rename 0003-RH-don-t-start-without-a-config-file.patch => 0035-RH-don-t-start-without-a-config-file.patch (98%) rename 0004-RH-Fix-nvme-function-missing-argument.patch => 0036-RH-Fix-nvme-function-missing-argument.patch (100%) rename 0005-RH-use-rpm-optflags-if-present.patch => 0037-RH-use-rpm-optflags-if-present.patch (97%) rename 0006-RH-add-mpathconf.patch => 0038-RH-add-mpathconf.patch (99%) rename 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch => 0039-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch (100%) rename 0008-RH-reset-default-find_mutipaths-value-to-off.patch => 0040-RH-reset-default-find_mutipaths-value-to-off.patch (100%) rename 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch => 0041-RH-attempt-to-get-ANA-info-via-sysfs-first.patch (100%) rename 0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch => 0042-RH-make-parse_vpd_pg83-match-scsi_id-output.patch (98%) rename 0011-RH-add-scsi-device-handlers-to-modules-load.d.patch => 0043-RH-add-scsi-device-handlers-to-modules-load.d.patch (96%) rename 0012-RH-compile-with-libreadline-support.patch => 0044-RH-compile-with-libreadline-support.patch (96%) rename 0013-RH-Add-mpathcleanup.patch => 0045-RH-Add-mpathcleanup.patch (100%) diff --git a/0001-GitHub-workflows-use-upload-download-artifact-v4.patch b/0001-GitHub-workflows-use-upload-download-artifact-v4.patch new file mode 100644 index 0000000..c8247ca --- /dev/null +++ b/0001-GitHub-workflows-use-upload-download-artifact-v4.patch @@ -0,0 +1,122 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 13 Sep 2024 09:09:19 +0200 +Subject: [PATCH] GitHub workflows: use {upload,download}-artifact@v4 + +The @v1 releases are deprecated. +https://github.blog/changelog/2024-02-13-deprecation-notice-v1-and-v2-of-the-artifact-actions/ + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/workflows/abi.yaml | 6 ++++-- + .github/workflows/foreign.yaml | 15 +++++++-------- + .github/workflows/native.yaml | 5 +++-- + 3 files changed, 14 insertions(+), 12 deletions(-) + +diff --git a/.github/workflows/abi.yaml b/.github/workflows/abi.yaml +index 393322e5..dce09f5c 100644 +--- a/.github/workflows/abi.yaml ++++ b/.github/workflows/abi.yaml +@@ -45,10 +45,11 @@ jobs: + - name: create ABI + run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) abi.tar.gz + - name: save ABI +- uses: actions/upload-artifact@v1 ++ uses: actions/upload-artifact@v4 + with: + name: abi + path: abi ++ overwrite: true + - name: compare ABI against reference + id: compare + continue-on-error: true +@@ -56,10 +57,11 @@ jobs: + run: make abi-test + - name: save differences + if: ${{ steps.compare.outcome == 'failure' }} +- uses: actions/upload-artifact@v1 ++ uses: actions/upload-artifact@v4 + with: + name: abi-test + path: abi-test ++ overwrite: true + + - name: fail + # MUST use >- here, otherwise the condition always evaluates to true +diff --git a/.github/workflows/foreign.yaml b/.github/workflows/foreign.yaml +index 9e4d35e0..d68650df 100644 +--- a/.github/workflows/foreign.yaml ++++ b/.github/workflows/foreign.yaml +@@ -36,14 +36,13 @@ jobs: + - name: checkout + uses: actions/checkout@v1 + - name: build +- run: make -j8 -Orecurse test-progs +- - name: create binary archive +- run: make test-progs.tar ++ run: make -j -Orecurse test-progs.tar + - name: upload binary archive +- uses: actions/upload-artifact@v1 ++ uses: actions/upload-artifact@v4 + with: + name: cross-${{ matrix.os }}-${{ matrix.arch }} + path: test-progs.tar ++ overwrite: true + + test: + runs-on: ubuntu-22.04 +@@ -61,11 +60,11 @@ jobs: + run: echo CONTAINER_ARCH="arm/v7" >> $GITHUB_ENV + if: ${{ matrix.arch == 'armhf' }} + - name: download binary archive +- uses: actions/download-artifact@v1 ++ uses: actions/download-artifact@v4 + with: + name: cross-${{ matrix.os }}-${{ matrix.arch }} + - name: unpack binary archive +- run: tar xfv cross-${{ matrix.os }}-${{ matrix.arch }}/test-progs.tar ++ run: tar xfv test-progs.tar + - name: enable foreign arch + uses: dbhi/qus/action@main + - name: run tests +@@ -100,11 +99,11 @@ jobs: + run: echo CONTAINER_ARCH="arm/v7" >> $GITHUB_ENV + if: ${{ matrix.arch == 'armhf' }} + - name: download binary archive +- uses: actions/download-artifact@v1 ++ uses: actions/download-artifact@v4 + with: + name: cross-${{ matrix.os }}-${{ matrix.arch }} + - name: unpack binary archive +- run: tar xfv cross-${{ matrix.os }}-${{ matrix.arch }}/test-progs.tar ++ run: tar xfv test-progs.tar + - name: enable foreign arch + uses: dbhi/qus/action@main + - name: run tests +diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml +index 80ff6df5..500becaa 100644 +--- a/.github/workflows/native.yaml ++++ b/.github/workflows/native.yaml +@@ -57,10 +57,11 @@ jobs: + - name: create binary archive + run: make ${{ env.ARCHIVE_TGT }} + - name: upload binary archive +- uses: actions/upload-artifact@v1 ++ uses: actions/upload-artifact@v4 + with: + name: native-${{ matrix.os }} + path: ${{ env.ARCHIVE_TGT }} ++ overwrite: true + + - name: clean + run: make clean +@@ -98,7 +99,7 @@ jobs: + uses: actions/checkout@v1 + + - name: download binary archive +- uses: actions/download-artifact@v1 ++ uses: actions/download-artifact@v4 + with: + name: native-${{ matrix.os }} + - name: unpack binary archive diff --git a/0002-GitHub-workflows-update-dawidd6-action-download-arti.patch b/0002-GitHub-workflows-update-dawidd6-action-download-arti.patch new file mode 100644 index 0000000..423bf56 --- /dev/null +++ b/0002-GitHub-workflows-update-dawidd6-action-download-arti.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 13 Sep 2024 09:10:38 +0200 +Subject: [PATCH] GitHub workflows: update dawidd6/action-download-artifact + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/workflows/abi.yaml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/.github/workflows/abi.yaml b/.github/workflows/abi.yaml +index dce09f5c..d5f8b477 100644 +--- a/.github/workflows/abi.yaml ++++ b/.github/workflows/abi.yaml +@@ -28,7 +28,7 @@ jobs: + - name: get reference ABI + id: reference + continue-on-error: true +- uses: dawidd6/action-download-artifact@v2 ++ uses: dawidd6/action-download-artifact@v6 + with: + workflow: abi.yaml + branch: ${{ env.ABI_BRANCH }} diff --git a/0003-Github-workflows-native.yml-use-mosteo-actions-docke.patch b/0003-Github-workflows-native.yml-use-mosteo-actions-docke.patch new file mode 100644 index 0000000..63aa273 --- /dev/null +++ b/0003-Github-workflows-native.yml-use-mosteo-actions-docke.patch @@ -0,0 +1,98 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 13 Sep 2024 09:45:25 +0200 +Subject: [PATCH] Github workflows: native.yml: use mosteo-actions/docker-run + +We can't use "container:" any more because upload-artifact@v4 doesn't +work on Debian Jessie. + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/workflows/native.yaml | 45 +++++++++++++++++++++-------------- + 1 file changed, 27 insertions(+), 18 deletions(-) + +diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml +index 500becaa..70d01c55 100644 +--- a/.github/workflows/native.yaml ++++ b/.github/workflows/native.yaml +@@ -35,17 +35,9 @@ jobs: + - debian-bookworm + - fedora-40 + - opensuse-leap +- container: ghcr.io/mwilck/multipath-build-${{ matrix.os }} + steps: + - name: checkout + uses: actions/checkout@v1 +- - name: build and test +- if: ${{ matrix.os != 'debian-jessie' }} +- run: make -j -Orecurse test +- - name: build and test (jessie) +- # On jessie, we use libreadline 5 (no licensing issue) +- if: ${{ matrix.os == 'debian-jessie' }} +- run: make -j -Orecurse READLINE=libreadline test + + - name: set archive name + # Leap containers have cpio but not tar +@@ -54,8 +46,21 @@ jobs: + - name: set archive name + run: echo ARCHIVE_TGT=test-progs.tar >> $GITHUB_ENV + if: ${{ matrix.os != 'opensuse-leap' }} +- - name: create binary archive +- run: make ${{ env.ARCHIVE_TGT }} ++ ++ - name: build and test ++ if: ${{ matrix.os != 'debian-jessie' }} ++ uses: mosteo-actions/docker-run@v1 ++ with: ++ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} ++ command: -j -Orecurse ${{ env.ARCHIVE_TGT }} test ++ - name: build and test (jessie) ++ # On jessie, we use libreadline 5 (no licensing issue) ++ if: ${{ matrix.os == 'debian-jessie' }} ++ uses: mosteo-actions/docker-run@v1 ++ with: ++ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} ++ command: -j -Orecurse READLINE=libreadline ${{ env.ARCHIVE_TGT }} test ++ + - name: upload binary archive + uses: actions/upload-artifact@v4 + with: +@@ -67,14 +72,18 @@ jobs: + run: make clean + - name: clang + if: ${{ matrix.os != 'debian-jessie' }} +- env: +- CC: clang +- run: make -j -Orecurse test ++ uses: mosteo-actions/docker-run@v1 ++ with: ++ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} ++ params: -e CC=clang ++ command: -j -Orecurse test + - name: clang (jessie) + if: ${{ matrix.os == 'debian-jessie' }} +- env: +- CC: clang +- run: make READLINE=libreadline test ++ uses: mosteo-actions/docker-run@v1 ++ with: ++ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} ++ params: -e CC=clang ++ command: -j -Orecurse READLINE=libreadline test + + root-test: + runs-on: ubuntu-22.04 +@@ -103,10 +112,10 @@ jobs: + with: + name: native-${{ matrix.os }} + - name: unpack binary archive +- run: cpio -idv < native-${{ matrix.os }}/test-progs.cpio ++ run: cpio -idv < test-progs.cpio + if: ${{ matrix.os == 'opensuse-leap' }} + - name: unpack binary archive +- run: tar xfmv native-${{ matrix.os }}/test-progs.tar ++ run: tar xfmv test-progs.tar + if: ${{ matrix.os != 'opensuse-leap' }} + + - name: run root tests diff --git a/0004-GitHub-workflows-native.yml-use-extra-job-for-clang.patch b/0004-GitHub-workflows-native.yml-use-extra-job-for-clang.patch new file mode 100644 index 0000000..e6d618c --- /dev/null +++ b/0004-GitHub-workflows-native.yml-use-extra-job-for-clang.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 13 Sep 2024 10:17:17 +0200 +Subject: [PATCH] GitHub workflows: native.yml: use extra job for clang + +Running "make" in a container and "make clean" outside doesn't +work (access right issues). So just use separate jobs. + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/workflows/native.yaml | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml +index 70d01c55..95b53b87 100644 +--- a/.github/workflows/native.yaml ++++ b/.github/workflows/native.yaml +@@ -68,8 +68,22 @@ jobs: + path: ${{ env.ARCHIVE_TGT }} + overwrite: true + +- - name: clean +- run: make clean ++ clang: ++ runs-on: ubuntu-22.04 ++ strategy: ++ fail-fast: false ++ matrix: ++ os: ++ - debian-jessie ++ - debian-buster ++ - debian-bullseye ++ - debian-bookworm ++ - fedora-40 ++ - opensuse-leap ++ steps: ++ - name: checkout ++ uses: actions/checkout@v1 ++ + - name: clang + if: ${{ matrix.os != 'debian-jessie' }} + uses: mosteo-actions/docker-run@v1 diff --git a/0005-GitHub-workflows-native.yaml-make-test-and-archive-s.patch b/0005-GitHub-workflows-native.yaml-make-test-and-archive-s.patch new file mode 100644 index 0000000..cabfbcf --- /dev/null +++ b/0005-GitHub-workflows-native.yaml-make-test-and-archive-s.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 13 Sep 2024 10:30:47 +0200 +Subject: [PATCH] GitHub workflows: native.yaml: make test and archive + separately + +Avoid "text file busy" error on GitHub. + +dmevents-test: Text file busy +Makefile:74: recipe for target 'dmevents.out' failed + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/workflows/native.yaml | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml +index 95b53b87..f06b09df 100644 +--- a/.github/workflows/native.yaml ++++ b/.github/workflows/native.yaml +@@ -52,14 +52,27 @@ jobs: + uses: mosteo-actions/docker-run@v1 + with: + image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} +- command: -j -Orecurse ${{ env.ARCHIVE_TGT }} test ++ command: -j -Orecurse test + - name: build and test (jessie) + # On jessie, we use libreadline 5 (no licensing issue) + if: ${{ matrix.os == 'debian-jessie' }} + uses: mosteo-actions/docker-run@v1 + with: + image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} +- command: -j -Orecurse READLINE=libreadline ${{ env.ARCHIVE_TGT }} test ++ command: -j -Orecurse READLINE=libreadline test ++ ++ - name: create ${{ env.ARCHIVE_TGT }} ++ if: ${{ matrix.os != 'debian-jessie' }} ++ uses: mosteo-actions/docker-run@v1 ++ with: ++ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} ++ command: ${{ env.ARCHIVE_TGT }} ++ - name: create ${{ env.ARCHIVE_TGT }} (jessie) ++ if: ${{ matrix.os == 'debian-jessie' }} ++ uses: mosteo-actions/docker-run@v1 ++ with: ++ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} ++ command: READLINE=libreadline ${{ env.ARCHIVE_TGT }} + + - name: upload binary archive + uses: actions/upload-artifact@v4 diff --git a/0006-GitHub-workflows-enable-unit-tests-for-stable-branch.patch b/0006-GitHub-workflows-enable-unit-tests-for-stable-branch.patch new file mode 100644 index 0000000..4a9b254 --- /dev/null +++ b/0006-GitHub-workflows-enable-unit-tests-for-stable-branch.patch @@ -0,0 +1,133 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 14 Nov 2024 16:02:38 +0100 +Subject: [PATCH] GitHub workflows: enable unit tests for stable branches + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/workflows/build-and-unittest.yaml | 2 ++ + .github/workflows/foreign.yaml | 2 ++ + .github/workflows/multiarch-stable.yaml | 2 ++ + .github/workflows/multiarch.yaml | 2 ++ + .github/workflows/native.yaml | 2 ++ + .github/workflows/rolling.yaml | 2 ++ + 6 files changed, 12 insertions(+) + +diff --git a/.github/workflows/build-and-unittest.yaml b/.github/workflows/build-and-unittest.yaml +index a838f9a2..1a727e14 100644 +--- a/.github/workflows/build-and-unittest.yaml ++++ b/.github/workflows/build-and-unittest.yaml +@@ -5,10 +5,12 @@ on: + - master + - queue + - tip ++ - 'stable-*' + pull_request: + branches: + - master + - queue ++ - 'stable-*' + jobs: + jammy: + runs-on: ubuntu-22.04 +diff --git a/.github/workflows/foreign.yaml b/.github/workflows/foreign.yaml +index d68650df..0f80957b 100644 +--- a/.github/workflows/foreign.yaml ++++ b/.github/workflows/foreign.yaml +@@ -5,6 +5,7 @@ on: + - master + - queue + - tip ++ - 'stable-*' + paths: + - '.github/workflows/foreign.yaml' + - '**.h' +@@ -15,6 +16,7 @@ on: + branches: + - master + - queue ++ - 'stable-*' + paths: + - '.github/workflows/foreign.yaml' + - '**.h' +diff --git a/.github/workflows/multiarch-stable.yaml b/.github/workflows/multiarch-stable.yaml +index e51d383c..ffede53d 100644 +--- a/.github/workflows/multiarch-stable.yaml ++++ b/.github/workflows/multiarch-stable.yaml +@@ -5,6 +5,7 @@ on: + - master + - queue + - tip ++ - 'stable-*' + paths: + - '.github/workflows/multiarch-stable.yaml' + - '**.h' +@@ -15,6 +16,7 @@ on: + branches: + - master + - queue ++ - 'stable-*' + paths: + - '.github/workflows/multiarch-stable.yaml' + - '**.h' +diff --git a/.github/workflows/multiarch.yaml b/.github/workflows/multiarch.yaml +index df95a02f..d2b833a4 100644 +--- a/.github/workflows/multiarch.yaml ++++ b/.github/workflows/multiarch.yaml +@@ -5,6 +5,7 @@ on: + - master + - queue + - tip ++ - 'stable-*' + paths: + - '.github/workflows/multiarch.yaml' + - '**.h' +@@ -15,6 +16,7 @@ on: + branches: + - master + - queue ++ - 'stable-*' + paths: + - '.github/workflows/multiarch.yaml' + - '**.h' +diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml +index f06b09df..c9d9df9e 100644 +--- a/.github/workflows/native.yaml ++++ b/.github/workflows/native.yaml +@@ -5,6 +5,7 @@ on: + - master + - queue + - tip ++ - 'stable-*' + paths: + - '.github/workflows/native.yaml' + - '**.h' +@@ -15,6 +16,7 @@ on: + branches: + - master + - queue ++ - 'stable-*' + paths: + - '.github/workflows/native.yaml' + - '**.h' +diff --git a/.github/workflows/rolling.yaml b/.github/workflows/rolling.yaml +index 3536b944..66af7a44 100644 +--- a/.github/workflows/rolling.yaml ++++ b/.github/workflows/rolling.yaml +@@ -5,6 +5,7 @@ on: + - master + - queue + - tip ++ - 'stable-*' + paths: + - '.github/workflows/rolling.yaml' + - '**.h' +@@ -15,6 +16,7 @@ on: + branches: + - master + - queue ++ - 'stable-*' + paths: + - '.github/workflows/rolling.yaml' + - '**.h' diff --git a/0007-GitHub-Workflows-add-abi-check-for-stable-branches.patch b/0007-GitHub-Workflows-add-abi-check-for-stable-branches.patch new file mode 100644 index 0000000..c19980f --- /dev/null +++ b/0007-GitHub-Workflows-add-abi-check-for-stable-branches.patch @@ -0,0 +1,110 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 14 Nov 2024 16:51:05 +0100 +Subject: [PATCH] GitHub Workflows: add abi check for stable branches + +The ABI should never change on a stable branch. This workflow +asserts that. + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/workflows/abi-stable.yaml | 89 +++++++++++++++++++++++++++++++ + 1 file changed, 89 insertions(+) + create mode 100644 .github/workflows/abi-stable.yaml + +diff --git a/.github/workflows/abi-stable.yaml b/.github/workflows/abi-stable.yaml +new file mode 100644 +index 00000000..a6746f23 +--- /dev/null ++++ b/.github/workflows/abi-stable.yaml +@@ -0,0 +1,89 @@ ++name: check-abi for stable branch ++on: ++ push: ++ branches: ++ - 'stable-*' ++ paths: ++ - '.github/workflows/abi-stable.yaml' ++ - '**.h' ++ - '**.c' ++ - '**.version' ++ pull_request: ++ branches: ++ - 'stable-*' ++ workflow_dispatch: ++ ++jobs: ++ reference-abi: ++ runs-on: ubuntu-20.04 ++ steps: ++ - name: get parent tag ++ run: > ++ echo ${{ github.ref }} | ++ sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV ++ - name: assert parent tag ++ run: /bin/false ++ if: ${{ env.PARENT_TAG == '' }} ++ - name: update ++ run: sudo apt-get update ++ - name: dependencies ++ run: > ++ sudo apt-get install --yes gcc ++ gcc make pkg-config abigail-tools ++ libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev ++ libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev ++ - name: checkout ${{ env.PARENT_TAG }} ++ uses: actions/checkout@v4 ++ with: ++ ref: ${{ env.PARENT_TAG }} ++ - name: build ABI for ${{ env.PARENT_TAG }} ++ run: make -j$(grep -c ^processor /proc/cpuinfo) -Orecurse abi ++ - name: save ABI ++ uses: actions/upload-artifact@v4 ++ with: ++ name: multipath-abi-${{ env.PARENT_TAG }} ++ path: abi ++ ++ check-abi: ++ runs-on: ubuntu-20.04 ++ needs: reference-abi ++ steps: ++ - name: get parent tag ++ run: > ++ echo ${{ github.ref }} | ++ sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV ++ - name: assert parent tag ++ run: /bin/false ++ if: ${{ env.PARENT_TAG == '' }} ++ - name: checkout ${{ env.PARENT_TAG }} ++ uses: actions/checkout@v4 ++ with: ++ ref: ${{ env.PARENT_TAG }} ++ - name: download ABI for ${{ env.PARENT_TAG }} ++ id: download_abi ++ uses: actions/download-artifact@v4 ++ with: ++ name: multipath-abi-${{ env.PARENT_TAG }} ++ path: reference-abi ++ - name: update ++ run: sudo apt-get update ++ if: steps.download_abi.outcome != 'success' ++ - name: dependencies ++ run: > ++ sudo apt-get install --yes gcc ++ gcc make pkg-config abigail-tools ++ libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev ++ libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev ++ - name: check ABI of ${{ github.ref }} against ${{ env.PARENT_TAG }} ++ id: check_abi ++ run: make -j$(grep -c ^processor /proc/cpuinfo) -Orecurse abi-test ++ continue-on-error: true ++ - name: save differences ++ if: ${{ steps.check_abi.outcome != 'success' }} ++ uses: actions/upload-artifact@v4 ++ with: ++ name: abi-test ++ path: abi-test ++ - name: fail ++ run: /bin/false ++ if: steps.check_abi.outcome != 'success' diff --git a/0008-libmultipath-dm_get_maps-don-t-bail-out-for-single-m.patch b/0008-libmultipath-dm_get_maps-don-t-bail-out-for-single-m.patch new file mode 100644 index 0000000..88122b0 --- /dev/null +++ b/0008-libmultipath-dm_get_maps-don-t-bail-out-for-single-m.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Tue, 12 Nov 2024 13:06:10 +0100 +Subject: [PATCH] libmultipath: dm_get_maps(): don't bail out for single-map + failures + +dm_get_maps() traverses the entire list of dm maps. We shouldn't +give up just because probing a single map failed. + +Fixes: bf3a4ad ("libmultipath: simplify dm_get_maps()") +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + libmultipath/devmapper.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c +index c497c225..52bfe9ce 100644 +--- a/libmultipath/devmapper.c ++++ b/libmultipath/devmapper.c +@@ -1262,10 +1262,8 @@ int dm_get_maps(vector mp) + } + vector_set_slot(mp, mpp); + break; +- case DMP_NO_MATCH: +- break; + default: +- return 1; ++ break; + } + next = names->next; + names = (void *) names + next; diff --git a/0009-11-dm-mpath.rules.in-import-DM_COLDPLUG_SUSPENDED-on.patch b/0009-11-dm-mpath.rules.in-import-DM_COLDPLUG_SUSPENDED-on.patch new file mode 100644 index 0000000..b380f75 --- /dev/null +++ b/0009-11-dm-mpath.rules.in-import-DM_COLDPLUG_SUSPENDED-on.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 31 Oct 2024 12:08:08 +0100 +Subject: [PATCH] 11-dm-mpath.rules.in: import DM_COLDPLUG_SUSPENDED only once + +We import DM_COLDPLUG_SUSPENDED in all code flows below mpath_coldplug_end. +Clarify this in the code. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index 30647b99..67838261 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -24,12 +24,13 @@ ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{.DM_SUSPENDED}!="1", ENV{DISK_RO}!="1", \ + ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="", GOTO="scan_import" + LABEL="mpath_coldplug_end" + ++IMPORT{db}="DM_COLDPLUG_SUSPENDED" ++ + # If this uevent didn't come from dm, don't try to update the + # device state + # Note that .MPATH_DEVICE_READY_OLD=="" here. Thus we won't activate the + # device below at mpath_is_ready, which is correct. + ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \ +- IMPORT{db}="DM_COLDPLUG_SUSPENDED", \ + GOTO="check_mpath_ready" + + ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" +@@ -67,7 +68,6 @@ LABEL="check_mpath_unchanged" + # A previous coldplug event occurred while the device was suspended. + # Activation might have been partially skipped. Activate the device now, + # i.e. disable the MPATH_UNCHANGED logic and set DM_ACTIVATION=1. +-IMPORT{db}="DM_COLDPLUG_SUSPENDED" + ENV{DM_COLDPLUG_SUSPENDED}=="1", ENV{.DM_SUSPENDED}!="1", \ + ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0", \ + PROGRAM="@SYSDIR_BIN@/logger -t 11-dm-mpath.rules -p daemon.notice \"Forcing activation of previously suspended device\"", \ diff --git a/0010-11-dm-mpath.rules.in-handle-inactive-suspended-devic.patch b/0010-11-dm-mpath.rules.in-handle-inactive-suspended-devic.patch new file mode 100644 index 0000000..f34e699 --- /dev/null +++ b/0010-11-dm-mpath.rules.in-handle-inactive-suspended-devic.patch @@ -0,0 +1,66 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 31 Oct 2024 12:59:03 +0100 +Subject: [PATCH] 11-dm-mpath.rules.in: handle inactive suspended devices + correctly + +Since b22c273 ("11-dm-mpath.rules: Don't force activation while device is +suspended"), we've handled the case where a device is suspended while +an uevent is processed (e.g. because multipathd is reloading the +map again at the same time). But we were missing the case where +The device had never been initialized before. If .MPATH_DEVICE_READY_OLD +was empty, we'd jump to scan_import without setting MPATH_DEVICE_READY +to 0. This can cause a device not to be fully activated at boot time, +because in follow-up uevents we'd assume that the device had already +been set up. + +Treat the case in which an uevent is processed for a previously not +fully set-up, suspended device like other situations where we set +MPATH_DEVICE_READY to 0. + +Fixes: b22c273 ("11-dm-mpath.rules: Don't force activation while device is +suspended") +Reviewed-by: Benjamin Marzinski + +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index 67838261..20f8c6ac 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -35,6 +35,13 @@ ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \ + + ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" + ++# If the device wasn't ready previously and is currently suspended, ++# we have to postpone the activation until the next event. ++# In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the ++# MPATH_UNCHANGED logic will cause later rules to skipped in the next event. ++ENV{.MPATH_DEVICE_READY_OLD}!="1", ENV{.DM_SUSPENDED}=="1", \ ++ ENV{MPATH_DEVICE_READY}="0", GOTO="check_mpath_unchanged" ++ + # multipath sets DM_SUBSYSTEM_UDEV_FLAG2 when it reloads a + # table with no active devices. If this happens, mark the + # device not ready +@@ -106,14 +113,10 @@ GOTO="scan_import" + LABEL="mpath_is_ready" + + # If the device comes back online, set DM_ACTIVATION so that +-# upper layers do a rescan. If the device is currently suspended, +-# we have to postpone the activation until the next event. +-# In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the +-# MPATH_UNCHANGED logic will cause later rules to skipped in the next event. +-ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="scan_import" +-ENV{.DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="scan_import" +- +-ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" ++# upper layers will do a rescan. Don't do this if .MPATH_DEVICE_READY_OLD ++# is just empty (see comment above the DM_COOKIE test above). ++ENV{.MPATH_DEVICE_READY_OLD}=="0", \ ++ ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" + + # The code to check multipath state ends here. We need to set + # properties and symlinks regardless whether the map is usable or diff --git a/0011-11-dm-mpath.rules.in-clarify-DM_ACTIVATION-logic.patch b/0011-11-dm-mpath.rules.in-clarify-DM_ACTIVATION-logic.patch new file mode 100644 index 0000000..cb129bf --- /dev/null +++ b/0011-11-dm-mpath.rules.in-clarify-DM_ACTIVATION-logic.patch @@ -0,0 +1,78 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 31 Oct 2024 13:11:21 +0100 +Subject: [PATCH] 11-dm-mpath.rules.in: clarify DM_ACTIVATION logic + +Our code is always setting MPATH_UNCHANGED and DM_ACTIVATION in +pairs. While DM_ACTIVATION is a global DM property, MPATH_UNCHANGED +is owned by us. Just set MPATH_UNCHANGED, and adapt DM_ACTIVATION +when necessary just in one place. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index 20f8c6ac..a2655cb2 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -74,25 +74,25 @@ LABEL="check_mpath_unchanged" + + # A previous coldplug event occurred while the device was suspended. + # Activation might have been partially skipped. Activate the device now, +-# i.e. disable the MPATH_UNCHANGED logic and set DM_ACTIVATION=1. ++# i.e. disable the MPATH_UNCHANGED logic. + ENV{DM_COLDPLUG_SUSPENDED}=="1", ENV{.DM_SUSPENDED}!="1", \ +- ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0", \ ++ ENV{MPATH_UNCHANGED}="0", \ + PROGRAM="@SYSDIR_BIN@/logger -t 11-dm-mpath.rules -p daemon.notice \"Forcing activation of previously suspended device\"", \ + GOTO="check_mpath_ready" + + # DM_SUBSYSTEM_UDEV_FLAG0 is the "RELOAD" flag for multipath subsystem. +-# Drop the DM_ACTIVATION flag here as mpath reloads tables if any of its ++# Set the MPATH_UNCHANGED flag here as mpath reloads tables if any of its + # paths are lost/recovered. For any stack above the mpath device, this is not + # something that should be reacted upon since it would be useless extra work. + # It's exactly mpath's job to provide *seamless* device access to any of the + # paths that are available underneath. + ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", \ +- ENV{DM_ACTIVATION}="0", ENV{MPATH_UNCHANGED}="1" ++ ENV{MPATH_UNCHANGED}="1" + +-# For path failed or reinstated events, unset DM_ACTIVATION. ++# For path failed or reinstated events, set MPATH_UNCHANGED. + # This is similar to the DM_SUBSYSTEM_UDEV_FLAG0 case above. + ENV{DM_ACTION}=="PATH_FAILED|PATH_REINSTATED", \ +- ENV{DM_ACTIVATION}="0", ENV{MPATH_UNCHANGED}="1" ++ ENV{MPATH_UNCHANGED}="1" + + LABEL="check_mpath_ready" + +@@ -112,11 +112,10 @@ GOTO="scan_import" + + LABEL="mpath_is_ready" + +-# If the device comes back online, set DM_ACTIVATION so that ++# If the device comes back online, clear MPATH_UNCHANGED so that + # upper layers will do a rescan. Don't do this if .MPATH_DEVICE_READY_OLD + # is just empty (see comment above the DM_COOKIE test above). +-ENV{.MPATH_DEVICE_READY_OLD}=="0", \ +- ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" ++ENV{.MPATH_DEVICE_READY_OLD}=="0", ENV{MPATH_UNCHANGED}="0" + + # The code to check multipath state ends here. We need to set + # properties and symlinks regardless whether the map is usable or +@@ -146,6 +145,10 @@ IMPORT{db}="ID_PART_GPT_AUTO_ROOT" + + LABEL="import_end" + ++# If MPATH_UNCHANGED is set, adapt DM_ACTIVATION. ++ENV{MPATH_UNCHANGED}=="0", ENV{DM_ACTIVATION}="1" ++ENV{MPATH_UNCHANGED}=="1", ENV{DM_ACTIVATION}="0" ++ + # Reset previous DM_COLDPLUG_SUSPENDED if activation happens now + ENV{.DM_SUSPENDED}!="1", ENV{DM_ACTIVATION}=="1", ENV{DM_COLDPLUG_SUSPENDED}="" + diff --git a/0012-11-dm-mpath-rules.in-skip-one-.DM_NOSCAN-check.patch b/0012-11-dm-mpath-rules.in-skip-one-.DM_NOSCAN-check.patch new file mode 100644 index 0000000..cb1620a --- /dev/null +++ b/0012-11-dm-mpath-rules.in-skip-one-.DM_NOSCAN-check.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Sun, 3 Nov 2024 23:04:08 +0100 +Subject: [PATCH] 11-dm-mpath-rules.in: skip one .DM_NOSCAN check + +We set .DM_NOSCAN above where we set DM_UDEV_DISABLE_OTHER_RULES_FLAG, too. If +the latter isn't set, .DM_NOSCAN can't be set. Skip the redundant test. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index a2655cb2..79227bec 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -132,7 +132,7 @@ ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="import_end" + ENV{DM_UDEV_RULES_VSN}!="1|2", GOTO="import_end" + + # Don't import the properties from db if we will run blkid later. +-ENV{.DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" ++ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" + + IMPORT{db}="ID_FS_TYPE" + IMPORT{db}="ID_FS_USAGE" diff --git a/0013-11-dm-mpath.rules.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch b/0013-11-dm-mpath.rules.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch new file mode 100644 index 0000000..36cd91d --- /dev/null +++ b/0013-11-dm-mpath.rules.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Sun, 3 Nov 2024 23:07:23 +0100 +Subject: [PATCH] 11-dm-mpath.rules.in: set .DM_NOSCAN if MPATH_UNCHANGED is + set + +When multipath reloads a device or fails or restores a path, the udev +rules disable LVM scanning, but since .DM_NOSCAN isn't set, blkid is +still run on the device. When multipath devices that are set to +queue_if_no_path lose all their paths at close to the same time, udev +workers can hang trying to run blkid. The blkid results shouldn't +change when multipathd is adding, removing, failing or reinstating +paths, aside from avoiding hanging udev processes, we're skipping +unnecessary work. + +Hence, set .DM_NOSCAN if MPATH_UNCHANGED is set, to avoid blkid from +being called in 13-dm.rules. + +Suggested-by: Benjamin Marzinski +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules.in | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in +index 79227bec..a816edbf 100644 +--- a/multipath/11-dm-mpath.rules.in ++++ b/multipath/11-dm-mpath.rules.in +@@ -145,9 +145,11 @@ IMPORT{db}="ID_PART_GPT_AUTO_ROOT" + + LABEL="import_end" + +-# If MPATH_UNCHANGED is set, adapt DM_ACTIVATION. ++# If MPATH_UNCHANGED is set, adapt DM_ACTIVATION and DM_NOSCAN. ++# .DM_NOSCAN controls whether blkid will be run in 13-dm-disk.rules; ++# we don't want to do that if MPATH_UNCHANGED is 1. + ENV{MPATH_UNCHANGED}=="0", ENV{DM_ACTIVATION}="1" +-ENV{MPATH_UNCHANGED}=="1", ENV{DM_ACTIVATION}="0" ++ENV{MPATH_UNCHANGED}=="1", ENV{DM_ACTIVATION}="0", ENV{.DM_NOSCAN}="1" + + # Reset previous DM_COLDPLUG_SUSPENDED if activation happens now + ENV{.DM_SUSPENDED}!="1", ENV{DM_ACTIVATION}=="1", ENV{DM_COLDPLUG_SUSPENDED}="" diff --git a/0014-libmultipath-don-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch b/0014-libmultipath-don-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch new file mode 100644 index 0000000..b7ae3c4 --- /dev/null +++ b/0014-libmultipath-don-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 7 Nov 2024 22:07:03 +0100 +Subject: [PATCH] libmultipath: don't set dev_loss_tmo to 0 for + NO_PATH_RETRY_FAIL + +If pp->dev_loss is DEV_LOSS_TMO_UNSET and min_dev_loss is 0 (which is +the case if no_path_retry is NO_PATH_RETRY_FAIL or NO_PATH_RETRY_UNDEF), +we will set pp->dev_loss to 0, which is wrong. Fix it. + +Fixes: 058b5f5 ("libmultipath: fix dev_loss_tmo even if not set in configuration") +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmultipath/discovery.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c +index e94705bf..5043330c 100644 +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -942,7 +942,7 @@ sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp) + continue; + } + +- if (pp->dev_loss == DEV_LOSS_TMO_UNSET) ++ if (pp->dev_loss == DEV_LOSS_TMO_UNSET && min_dev_loss != 0) + pp->dev_loss = min_dev_loss; + else if (pp->dev_loss < min_dev_loss) { + pp->dev_loss = min_dev_loss; diff --git a/0015-multipathd-fix-deferred_failback_tick-for-reload-rem.patch b/0015-multipathd-fix-deferred_failback_tick-for-reload-rem.patch new file mode 100644 index 0000000..f775e85 --- /dev/null +++ b/0015-multipathd-fix-deferred_failback_tick-for-reload-rem.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Mon, 14 Oct 2024 23:28:30 -0400 +Subject: [PATCH] multipathd: fix deferred_failback_tick for reload removes + +If reload_and_sync_map() removes the multipath device, +deferred_failback_tick() needs to decrement the counter so that it +doesn't skip the following device. + +Reviewed-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + multipathd/main.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/multipathd/main.c b/multipathd/main.c +index 1b7fd04f..e4ef9a1d 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -2080,9 +2080,12 @@ deferred_failback_tick (struct vectors *vecs) + + if (!mpp->failback_tick && + need_switch_pathgroup(mpp, &need_reload)) { +- if (need_reload) +- reload_and_sync_map(mpp, vecs); +- else ++ if (need_reload) { ++ if (reload_and_sync_map(mpp, vecs) == 2) { ++ /* multipath device removed */ ++ i--; ++ } ++ } else + switch_pathgroup(mpp); + } + } diff --git a/0016-multipathd-fix-an-unsigned-int-ovwerflow.patch b/0016-multipathd-fix-an-unsigned-int-ovwerflow.patch new file mode 100644 index 0000000..12c9a51 --- /dev/null +++ b/0016-multipathd-fix-an-unsigned-int-ovwerflow.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 13 Nov 2024 16:19:49 +0100 +Subject: [PATCH] multipathd: fix an unsigned int ovwerflow + +Reported by coverity: "i--" may cause an underflow, which will again +cause an overflow when the loop continues. Use a signed int for +loops like this to make coverity happy. + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + multipathd/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipathd/main.c b/multipathd/main.c +index e4ef9a1d..3fb623fd 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -2068,7 +2068,7 @@ static void + deferred_failback_tick (struct vectors *vecs) + { + struct multipath * mpp; +- unsigned int i; ++ int i; + bool need_reload; + + vector_foreach_slot (vecs->mpvec, mpp, i) { diff --git a/0017-libmpathutil-avoid-Wcast-function-type-mismatch-erro.patch b/0017-libmpathutil-avoid-Wcast-function-type-mismatch-erro.patch new file mode 100644 index 0000000..64b90d7 --- /dev/null +++ b/0017-libmpathutil-avoid-Wcast-function-type-mismatch-erro.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 6 Nov 2024 22:17:16 +0100 +Subject: [PATCH] libmpathutil: avoid -Wcast-function-type-mismatch error with + clang 19 + +Avoid the following error with clang 19: + +msort.c:268:27: error: cast from '__compar_fn_t' (aka 'int (*)(const void *, const void *)') to '__compar_d_fn_t' (aka 'int (*)(const void *, const void *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch] + 268 | return msort_r (b, n, s, (__compar_d_fn_t)cmp, NULL); + | ^~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + libmpathutil/msort.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/libmpathutil/msort.c b/libmpathutil/msort.c +index 50f799d9..9df7b267 100644 +--- a/libmpathutil/msort.c ++++ b/libmpathutil/msort.c +@@ -259,9 +259,12 @@ msort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, void *arg) + * If this is safe for them, it should be for us, too. + */ + #pragma GCC diagnostic push +-#if __GNUC__ >= 8 ++#if __GNUC__ >= 8 || __clang_major__ >= 19 + #pragma GCC diagnostic ignored "-Wcast-function-type" + #endif ++#if __clang_major__ >= 19 ++#pragma GCC diagnostic ignored "-Wcast-function-type-mismatch" ++#endif + void + msort (void *b, size_t n, size_t s, __compar_fn_t cmp) + { diff --git a/0018-Update-NEWS.md-for-0.10.1.patch b/0018-Update-NEWS.md-for-0.10.1.patch new file mode 100644 index 0000000..601b6e5 --- /dev/null +++ b/0018-Update-NEWS.md-for-0.10.1.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 14 Nov 2024 17:59:14 +0100 +Subject: [PATCH] Update NEWS.md for 0.10.1 + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + NEWS.md | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/NEWS.md b/NEWS.md +index 69acda47..b740efb1 100644 +--- a/NEWS.md ++++ b/NEWS.md +@@ -1,5 +1,28 @@ + # multipath-tools Release Notes + ++## multipath-tools 0.10.1, 2024/11 ++ ++This is the first bug fix release on the `stable-0.10.y` branch. It contains ++bug fixes from 0.11.0, and some CI-related fixes. ++ ++### Bug fixes ++ ++* Fixed the problem that multipathd wouldn't start on systems with certain types ++ of device mapper devices, in particular devices with multiple DM targets. ++ The problem was introduced in 0.10.0. ++ Fixes [#102](https://github.com/opensvc/multipath-tools/issues/102). ++* Fixed a corner case in the udev rules which could cause a device not to be ++ activated during boot if a cold plug uevent is processed for a previously ++ not configured multipath map while this map was suspended. This problem existed ++ since 0.9.8. ++* Fixed the problem that devices with `no_path_retry fail` and no setting ++ for `dev_loss_tmo` might get the `dev_loss_tmo` set to 0, causing the ++ device to be deleted immediately in the event of a transport disruption. ++ This bug was introduced in 0.9.6. ++* Fixed the problem that, if there were multiple maps with deferred failback ++ (`failback` value > 0 in `multipath.conf`), some maps might fail back later ++ than configured. The problem existed since 0.9.6. ++ + ## multipath-tools 0.10.0, 2024/08 + + ### User-Visible Changes diff --git a/0019-libmultipath-don-t-print-error-message-if-WATCHDOG_U.patch b/0019-libmultipath-don-t-print-error-message-if-WATCHDOG_U.patch new file mode 100644 index 0000000..18fb614 --- /dev/null +++ b/0019-libmultipath-don-t-print-error-message-if-WATCHDOG_U.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 14 Nov 2024 15:20:24 +0100 +Subject: [PATCH] libmultipath: don't print error message if WATCHDOG_USEC is 0 + +WATCHDOG_USEC may be set to 0, which means that the watchdog +is disabled in systemd. + +Fixes: 9366cfb ("multipathd: Implement systemd watchdog integration") +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmultipath/config.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/libmultipath/config.c b/libmultipath/config.c +index 0e3a5cc1..226ddecb 100644 +--- a/libmultipath/config.c ++++ b/libmultipath/config.c +@@ -865,6 +865,9 @@ static void set_max_checkint_from_watchdog(struct config *conf) + unsigned long checkint; + + if (envp && sscanf(envp, "%lu", &checkint) == 1) { ++ if (checkint == 0) ++ /* watchdog disabled */ ++ return; + /* Value is in microseconds */ + checkint /= 1000000; + if (checkint < 1 || checkint > UINT_MAX) { diff --git a/0020-libmultipath-reduce-log-level-of-map-X-has-multiple-.patch b/0020-libmultipath-reduce-log-level-of-map-X-has-multiple-.patch new file mode 100644 index 0000000..7467627 --- /dev/null +++ b/0020-libmultipath-reduce-log-level-of-map-X-has-multiple-.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Mon, 25 Nov 2024 18:01:32 +0100 +Subject: [PATCH] libmultipath: reduce log level of "map X has multiple + targets" + +On systems with LVM volumes, "multipath -ll" will spit out lots of messages +like + + libmp_mapinfo: map vg-lv0 has multiple targets + +which is irritating. Reduce the log level of these messages to 3, as they +are harmless most of the time. + +This is a backport of e8949c2 ("libmultipath: reduce log level of +libmp_mapinfo() messages") from the master branch. We can't apply exactly +the same fix because the stable branch is missing 8c772d3 ("libmultipath: +check DM UUID earlier in libmp_mapinfo__"). + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + libmultipath/devmapper.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c +index 52bfe9ce..fe5637b3 100644 +--- a/libmultipath/devmapper.c ++++ b/libmultipath/devmapper.c +@@ -718,7 +718,7 @@ static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma + if (info.target || info.status || info.size || flags & MAPINFO_TGT_TYPE__) { + if (dm_get_next_target(dmt, NULL, &start, &length, + &target_type, ¶ms) != NULL) { +- condlog(2, "%s: map %s has multiple targets", fname__, map_id); ++ condlog(3, "%s: map %s has multiple targets", fname__, map_id); + return DMP_NOT_FOUND; + } + if (!params) { diff --git a/0021-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch b/0021-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch new file mode 100644 index 0000000..2610c6d --- /dev/null +++ b/0021-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch @@ -0,0 +1,54 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 8 Jan 2025 19:06:53 -0500 +Subject: [PATCH] libmultipath/foreign: fix memory leak in nvme foreign handler + +_find_controllers() needs to free the udev device if it doesn't get +added to a path. Otherwise it can leak memory whenever check_foreign() +is called, causing multipathd's memory usage to continually grow. + +Fixes: 7b47762 ("libmultipath: nvme: fix path detection for kernel 4.16") +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +(cherry picked from commit 5a3d334e416a4a35ee88d7b8f1433ff7f57923ad) +--- + libmultipath/foreign/nvme.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c +index 0b7f4eab..cde660ce 100644 +--- a/libmultipath/foreign/nvme.c ++++ b/libmultipath/foreign/nvme.c +@@ -675,7 +675,8 @@ static void _find_controllers(struct context *ctx, struct nvme_map *map) + pthread_cleanup_push_cast(free_scandir_result, &sr); + for (i = 0; i < r; i++) { + char *fn = di[i]->d_name; +- struct udev_device *ctrl, *udev; ++ struct udev_device *ctrl; ++ struct udev_device *udev __attribute__((cleanup(cleanup_udev_device))) = NULL; + + if (safe_snprintf(pathbuf + n, sizeof(pathbuf) - n, "/%s", fn)) + continue; +@@ -719,11 +720,11 @@ static void _find_controllers(struct context *ctx, struct nvme_map *map) + continue; + + path->gen.ops = &nvme_path_ops; +- path->udev = udev; ++ path->udev = steal_ptr(udev); + path->seen = true; + path->map = map; + path->ctl = udev_device_get_parent_with_subsystem_devtype +- (udev, "nvme", NULL); ++ (path->udev, "nvme", NULL); + if (path->ctl == NULL) { + condlog(1, "%s: %s: failed to get controller for %s", + __func__, THIS, fn); +@@ -744,7 +745,7 @@ static void _find_controllers(struct context *ctx, struct nvme_map *map) + } + vector_set_slot(&map->pgvec, &path->pg); + condlog(3, "%s: %s: new path %s added to %s", +- __func__, THIS, udev_device_get_sysname(udev), ++ __func__, THIS, udev_device_get_sysname(path->udev), + udev_device_get_sysname(map->udev)); + } + pthread_cleanup_pop(1); diff --git a/0022-libmultipath-add-condition-for-enqueueing-path-to-io.patch b/0022-libmultipath-add-condition-for-enqueueing-path-to-io.patch new file mode 100644 index 0000000..cf8d80a --- /dev/null +++ b/0022-libmultipath-add-condition-for-enqueueing-path-to-io.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: chenrenhui +Date: Fri, 10 Jan 2025 14:38:16 +0800 +Subject: [PATCH] libmultipath: add condition for enqueueing path to io error + check + +In function io_err_stat_handle_pathfail(), path->io_err_dis_reinstate_time +is set to 0 to enqueue path to io error check as soon as possible. But +multipathd can not do it within marginal_path_err_recheck_gap_time seconds +after power-on, because curr_time is less than +marginal_path_err_recheck_gap_time. + +To handle the early marginal path, we can enqueue path when +io_err_dis_reinstate_time is 0. + +Signed-off-by: chenrenhui +Reviewed-by: Benjamin Marzinski +Reviewed-by: Martin Wilck + +> + +(cherry picked from commit a1e3cf2d42cc4bab10753e466c8adb7efa83c99e) +Signed-off-by: Benjamin Marzinski +--- + libmultipath/io_err_stat.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c +index 4996c0b0..879c310a 100644 +--- a/libmultipath/io_err_stat.c ++++ b/libmultipath/io_err_stat.c +@@ -367,7 +367,8 @@ int need_io_err_check(struct path *pp) + return 1; + get_monotonic_time(&curr_time); + if ((curr_time.tv_sec - pp->io_err_dis_reinstate_time) > +- pp->mpp->marginal_path_err_recheck_gap_time) { ++ pp->mpp->marginal_path_err_recheck_gap_time || ++ pp->io_err_dis_reinstate_time == 0) { + io_err_stat_log(4, "%s: reschedule checking after %d seconds", + pp->dev, + pp->mpp->marginal_path_err_recheck_gap_time); diff --git a/0023-Additional-NEWS.md-updates-for-0.10.1.patch b/0023-Additional-NEWS.md-updates-for-0.10.1.patch new file mode 100644 index 0000000..1093bd0 --- /dev/null +++ b/0023-Additional-NEWS.md-updates-for-0.10.1.patch @@ -0,0 +1,63 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 17 Jan 2025 22:38:26 +0100 +Subject: [PATCH] Additional NEWS.md updates for 0.10.1 + +Signed-off-by: Benjamin Marzinski +--- + .github/actions/spelling/expect.txt | 4 ++-- + NEWS.md | 8 ++++++++ + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt +index 934f582e..000d5ebb 100644 +--- a/.github/actions/spelling/expect.txt ++++ b/.github/actions/spelling/expect.txt +@@ -184,7 +184,6 @@ sas + sbp + scsi + sda +-sdc + setmarginal + setprkey + setprstatus +@@ -205,11 +204,11 @@ suse + svg + switchgroup + sys ++SYSDIR + sysfs + sysinit + tcp + terabytes +-SYSDIR + TESTDEPS + testname + tgill +@@ -231,6 +230,7 @@ unsetprkey + unsetprstatus + unspec + usb ++USEC + userdata + userspace + usr +diff --git a/NEWS.md b/NEWS.md +index b740efb1..3c51553e 100644 +--- a/NEWS.md ++++ b/NEWS.md +@@ -22,6 +22,14 @@ bug fixes from 0.11.0, and some CI-related fixes. + * Fixed the problem that, if there were multiple maps with deferred failback + (`failback` value > 0 in `multipath.conf`), some maps might fail back later + than configured. The problem existed since 0.9.6. ++* Removed a warning message that multipathd would print if systemd's ++ `WATCHDOG_USEC` environment variable had the value "0", which means that the ++ watchdog is simply disabled. This (minor) problem existed since 0.4.9. ++* Fixed a memory leak in the nvme foreign library. The bug existed since ++ 0.7.8. ++* Fixed a problem in the marginal path detection algorithm that could cause ++ the io error check for a recently failed path to be delayed. This bug ++ existed since 0.7.4. + + ## multipath-tools 0.10.0, 2024/08 + diff --git a/0024-libmultipath-fix-handling-of-pp-pgindex.patch b/0024-libmultipath-fix-handling-of-pp-pgindex.patch new file mode 100644 index 0000000..a9da346 --- /dev/null +++ b/0024-libmultipath-fix-handling-of-pp-pgindex.patch @@ -0,0 +1,138 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Mon, 25 Nov 2024 13:11:07 +0100 +Subject: [PATCH] libmultipath: fix handling of pp->pgindex + +pp->pgindex is set in disassemble_map() when a map is parsed. +There are various possiblities for this index to become invalid. +pp->pgindex is only used in enable_group() and followover_should_fallback(), +and both callers take no action if it is 0, which is the right +thing to do if we don't know the path's pathgroup. + +Make sure pp->pgindex is reset to 0 in various places: +- when it's orphaned, +- before (re)grouping paths, +- when we detect a bad mpp assignment in update_pathvec_from_dm(). +- when a pathgroup is deleted in update_pathvec_from_dm(). In this + case, pgindex needs to be invalidated for all paths in all pathgroups + after the one that was deleted. + +The hunk in group_paths is mostly redundant with the hunk in free_pgvec(), but +because we're looping over pg->paths in the former and over pg->pgp in +the latter, I think it's better too play safe. + +Fixes: 99db1bd ("[multipathd] re-enable disabled PG when at least one path is up") +Fixes: https://github.com/opensvc/multipath-tools/issues/105 +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +(cherry picked from commit cd912cffa2797a18c47426c816afa8eb2eae5b22) +(cherry picked from commit 714c20bebba6911255a527d937e7a62764ffe338) +Signed-off-by: Benjamin Marzinski +--- + libmultipath/pgpolicies.c | 6 ++++++ + libmultipath/structs.c | 12 +++++++++++- + libmultipath/structs_vec.c | 15 +++++++++++++++ + 3 files changed, 32 insertions(+), 1 deletion(-) + +diff --git a/libmultipath/pgpolicies.c b/libmultipath/pgpolicies.c +index edc3c611..23ef2bdc 100644 +--- a/libmultipath/pgpolicies.c ++++ b/libmultipath/pgpolicies.c +@@ -127,6 +127,8 @@ fail: + int group_paths(struct multipath *mp, int marginal_pathgroups) + { + vector normal, marginal; ++ struct path *pp; ++ int i; + + if (!mp->pg) + mp->pg = vector_alloc(); +@@ -138,6 +140,10 @@ int group_paths(struct multipath *mp, int marginal_pathgroups) + if (!mp->pgpolicyfn) + goto fail; + ++ /* Reset pgindex, we're going to invalidate it */ ++ vector_foreach_slot(mp->paths, pp, i) ++ pp->pgindex = 0; ++ + if (!marginal_pathgroups || + split_marginal_paths(mp->paths, &normal, &marginal) != 0) { + if (mp->pgpolicyfn(mp, mp->paths) != 0) +diff --git a/libmultipath/structs.c b/libmultipath/structs.c +index 61c8f32c..48517252 100644 +--- a/libmultipath/structs.c ++++ b/libmultipath/structs.c +@@ -239,8 +239,18 @@ free_pgvec (vector pgvec, enum free_path_mode free_paths) + if (!pgvec) + return; + +- vector_foreach_slot(pgvec, pgp, i) ++ vector_foreach_slot(pgvec, pgp, i) { ++ ++ /* paths are going to be re-grouped, reset pgindex */ ++ if (free_paths != FREE_PATHS) { ++ struct path *pp; ++ int j; ++ ++ vector_foreach_slot(pgp->paths, pp, j) ++ pp->pgindex = 0; ++ } + free_pathgroup(pgp, free_paths); ++ } + + vector_free(pgvec); + } +diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c +index 5df495b3..9dc5a5ca 100644 +--- a/libmultipath/structs_vec.c ++++ b/libmultipath/structs_vec.c +@@ -108,6 +108,7 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, + struct config *conf; + bool mpp_has_wwid; + bool must_reload = false; ++ bool pg_deleted = false; + + if (!mpp->pg) + return false; +@@ -125,6 +126,10 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, + + vector_foreach_slot(pgp->paths, pp, j) { + ++ /* A pathgroup has been deleted before. Invalidate pgindex */ ++ if (pg_deleted) ++ pp->pgindex = 0; ++ + if (pp->mpp && pp->mpp != mpp) { + condlog(0, "BUG: %s: found path %s which is already in %s", + mpp->alias, pp->dev, pp->mpp->alias); +@@ -139,6 +144,13 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, + must_reload = true; + dm_fail_path(mpp->alias, pp->dev_t); + vector_del_slot(pgp->paths, j--); ++ /* ++ * pp->pgindex has been set in disassemble_map(), ++ * which has probably been called just before for ++ * mpp. So he pgindex relates to mpp and may be ++ * wrong for pp->mpp. Invalidate it. ++ */ ++ pp->pgindex = 0; + continue; + } + pp->mpp = mpp; +@@ -237,6 +249,8 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, + vector_del_slot(mpp->pg, i--); + free_pathgroup(pgp, KEEP_PATHS); + must_reload = true; ++ /* Invalidate pgindex for all other pathgroups */ ++ pg_deleted = true; + } + mpp->need_reload = mpp->need_reload || must_reload; + return must_reload; +@@ -354,6 +368,7 @@ void orphan_path(struct path *pp, const char *reason) + { + condlog(3, "%s: orphan path, %s", pp->dev, reason); + pp->mpp = NULL; ++ pp->pgindex = 0; + uninitialize_path(pp); + } + diff --git a/0025-libmultipath-make-pgcmp-detect-if-map-is-missing-a-p.patch b/0025-libmultipath-make-pgcmp-detect-if-map-is-missing-a-p.patch new file mode 100644 index 0000000..b2b9e48 --- /dev/null +++ b/0025-libmultipath-make-pgcmp-detect-if-map-is-missing-a-p.patch @@ -0,0 +1,70 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Mon, 25 Nov 2024 15:18:15 +0100 +Subject: [PATCH] libmultipath: make pgcmp detect if map is missing a path + group + +The previous algorithm didn't detect the case case where cpgp +contained a path that was not contained in pgp. Fix this. + +Cherry-picked from d4b35f61cb75c6e9b289e56c98457fc04ce4835e +Fixes: 90773ba ("libmultipath: resolve hash collisions in pgcmp()") +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + libmultipath/configure.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/libmultipath/configure.c b/libmultipath/configure.c +index a7257981..e86c1fd5 100644 +--- a/libmultipath/configure.c ++++ b/libmultipath/configure.c +@@ -426,6 +426,11 @@ compute_pgid(struct pathgroup * pgp) + pgp->id ^= (long)pp; + } + ++static void cleanup_bitfield(struct bitfield **p) ++{ ++ free(*p); ++} ++ + static int + pgcmp (struct multipath * mpp, struct multipath * cmpp) + { +@@ -433,16 +438,25 @@ pgcmp (struct multipath * mpp, struct multipath * cmpp) + struct pathgroup * pgp; + struct pathgroup * cpgp; + int r = 0; ++ struct bitfield *bf __attribute__((cleanup(cleanup_bitfield))) = NULL; + + if (!mpp) + return 0; + ++ if (VECTOR_SIZE(mpp->pg) != VECTOR_SIZE(cmpp->pg)) ++ return 1; ++ ++ bf = alloc_bitfield(VECTOR_SIZE(cmpp->pg)); ++ if (!bf) ++ return 1; ++ + vector_foreach_slot (mpp->pg, pgp, i) { + compute_pgid(pgp); + + vector_foreach_slot (cmpp->pg, cpgp, j) { + if (pgp->id == cpgp->id && + !pathcmp(pgp, cpgp)) { ++ set_bit_in_bitfield(j, bf); + r = 0; + break; + } +@@ -451,6 +465,10 @@ pgcmp (struct multipath * mpp, struct multipath * cmpp) + if (r) + return r; + } ++ vector_foreach_slot (cmpp->pg, cpgp, j) { ++ if (!is_bit_set_in_bitfield(j, bf)) ++ return 1; ++ } + return r; + } + diff --git a/0026-libmultipath-trigger-uevents-upon-map-creation-in-do.patch b/0026-libmultipath-trigger-uevents-upon-map-creation-in-do.patch new file mode 100644 index 0000000..bd3a7a4 --- /dev/null +++ b/0026-libmultipath-trigger-uevents-upon-map-creation-in-do.patch @@ -0,0 +1,94 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Tue, 26 Nov 2024 22:37:20 +0100 +Subject: [PATCH] libmultipath: trigger uevents upon map creation in domap() + +If map creation succeeds, previously not multipathed devices are +now multipathed. udev may not have noticed this yet, thus trigger +path uevents to make it aware of the situation. Likewise, if +creating a map fails, the paths in question were likely considered +multipath members by udev, too. They will now be marked as failed, +so trigger an event in this situation as well. + +Fixes: https://github.com/opensvc/multipath-tools/issues/103 +Suggested-by: Benjamin Marzinski +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +(cherry picked from commit 98b3a7bd9ed2a89f068fe40c253843cf78261905) +Signed-off-by: Benjamin Marzinski +--- + libmultipath/configure.c | 11 ++++------- + libmultipath/devmapper.c | 9 +++------ + 2 files changed, 7 insertions(+), 13 deletions(-) + +diff --git a/libmultipath/configure.c b/libmultipath/configure.c +index e86c1fd5..d9fac384 100644 +--- a/libmultipath/configure.c ++++ b/libmultipath/configure.c +@@ -581,8 +581,6 @@ trigger_paths_udev_change(struct multipath *mpp, bool is_mpath) + vector_foreach_slot(pgp->paths, pp, j) + trigger_path_udev_change(pp, is_mpath); + } +- +- mpp->needs_paths_uevent = 0; + } + + static int sysfs_set_max_sectors_kb(struct multipath *mpp) +@@ -954,10 +952,10 @@ int domap(struct multipath *mpp, char *params, int is_daemon) + * succeeded + */ + mpp->force_udev_reload = 0; +- if (mpp->action == ACT_CREATE && +- (remember_wwid(mpp->wwid) == 1 || +- mpp->needs_paths_uevent)) ++ if (mpp->action == ACT_CREATE) { ++ remember_wwid(mpp->wwid); + trigger_paths_udev_change(mpp, true); ++ } + if (!is_daemon) { + /* multipath client mode */ + dm_switchgroup(mpp->alias, mpp->bestpg); +@@ -982,8 +980,7 @@ int domap(struct multipath *mpp, char *params, int is_daemon) + } + dm_setgeometry(mpp); + return DOMAP_OK; +- } else if (r == DOMAP_FAIL && mpp->action == ACT_CREATE && +- mpp->needs_paths_uevent) ++ } else if (r == DOMAP_FAIL && mpp->action == ACT_CREATE) + trigger_paths_udev_change(mpp, false); + + return DOMAP_FAIL; +diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c +index fe5637b3..a0070c56 100644 +--- a/libmultipath/devmapper.c ++++ b/libmultipath/devmapper.c +@@ -536,7 +536,7 @@ static uint16_t build_udev_flags(const struct multipath *mpp, int reload) + MPATH_UDEV_RELOAD_FLAG : 0); + } + +-int dm_addmap_create (struct multipath *mpp, char * params) ++int dm_addmap_create (struct multipath *mpp, char *params) + { + int ro; + uint16_t udev_flags = build_udev_flags(mpp, 0); +@@ -546,9 +546,7 @@ int dm_addmap_create (struct multipath *mpp, char * params) + + if (dm_addmap(DM_DEVICE_CREATE, TGT_MPATH, mpp, params, ro, + udev_flags)) { +- if (unmark_failed_wwid(mpp->wwid) == +- WWID_FAILED_CHANGED) +- mpp->needs_paths_uevent = 1; ++ unmark_failed_wwid(mpp->wwid); + return 1; + } + /* +@@ -566,8 +564,7 @@ int dm_addmap_create (struct multipath *mpp, char * params) + break; + } + } +- if (mark_failed_wwid(mpp->wwid) == WWID_FAILED_CHANGED) +- mpp->needs_paths_uevent = 1; ++ mark_failed_wwid(mpp->wwid); + return 0; + } + diff --git a/0027-multipathd-trigger-uevents-upon-map-removal-in-coale.patch b/0027-multipathd-trigger-uevents-upon-map-removal-in-coale.patch new file mode 100644 index 0000000..f43ca0c --- /dev/null +++ b/0027-multipathd-trigger-uevents-upon-map-removal-in-coale.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 27 Nov 2024 20:39:50 +0100 +Subject: [PATCH] multipathd: trigger uevents upon map removal in + coalesce_maps() + +... if a map has been flushed. In this case, we know that the +the paths haven't been multipathed by coalesce_paths() because of the current +configuration (failure to create the map can't be the reason if the map +exists in coalesce_maps()). Make sure udev sees the paths which have +been released from the map as non-multipath. + +Note that this is the only case where maps are flushed where it is correct +to trigger paths uevents. In other cases, e.g. after a "remove map" CLI +command, the configuration is unchanged and if we triggered an uevent, +the map would be re-created by multipathd when the uevent arrived. + +Signed-off-by: Martin Wilck +Reviewed-by: Benjamin Marzinski +(cherry picked from commit ad3ea472b587c0c20d2100331b5c66f8602f8414) +Signed-off-by: Benjamin Marzinski +--- + multipathd/main.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/multipathd/main.c b/multipathd/main.c +index 3fb623fd..4b089c0e 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -794,8 +794,10 @@ coalesce_maps(struct vectors *vecs, vector nmpv) + vector_del_slot(ompv, i); + i--; + } +- else ++ else { + condlog(2, "%s devmap removed", ompp->alias); ++ trigger_paths_udev_change(ompp, false); ++ } + } else if (reassign_maps) { + condlog(3, "%s: Reassign existing device-mapper" + " devices", ompp->alias); diff --git a/0028-libmultipath-Don-t-skip-set_path_max_sectors_kb.patch b/0028-libmultipath-Don-t-skip-set_path_max_sectors_kb.patch new file mode 100644 index 0000000..6c001f5 --- /dev/null +++ b/0028-libmultipath-Don-t-skip-set_path_max_sectors_kb.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 4 Dec 2024 22:56:36 -0500 +Subject: [PATCH] libmultipath: Don't skip set_path_max_sectors_kb() + +If a multipath device already has need_reload set when a path is +adopted, it won't call set_path_max_sectors_kb() because of +short-circuit evaluation. This isn't what's intended. + +Fixes: e5e20c7b ("libmultipath: set max_sectors_kb in adopt_paths()") +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +(cherry picked from commit f5c0c4b25c5eaac87b78e6e0c8d52b0828c29893) +--- + libmultipath/structs_vec.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c +index 9dc5a5ca..683ab473 100644 +--- a/libmultipath/structs_vec.c ++++ b/libmultipath/structs_vec.c +@@ -349,8 +349,7 @@ int adopt_paths(vector pathvec, struct multipath *mpp, + */ + if (!current_mpp || + !mp_find_path_by_devt(current_mpp, pp->dev_t)) +- mpp->need_reload = mpp->need_reload || +- set_path_max_sectors_kb(pp, mpp->max_sectors_kb); ++ mpp->need_reload = set_path_max_sectors_kb(pp, mpp->max_sectors_kb) || mpp->need_reload; + } + + pp->mpp = mpp; diff --git a/0029-libmultipath-stop-static-analyzer-complaint-in-init_.patch b/0029-libmultipath-stop-static-analyzer-complaint-in-init_.patch new file mode 100644 index 0000000..e293a0e --- /dev/null +++ b/0029-libmultipath-stop-static-analyzer-complaint-in-init_.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 22 Jan 2025 22:16:42 -0500 +Subject: [PATCH] libmultipath: stop static analyzer complaint in init_foreign + +This change doesn't actually fix anything. The code was already safe. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +(cherry picked from commit 85ec51e7930b4cadfbc12718afa91ce3a4adf4b5) +--- + libmultipath/foreign.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c +index 28d1b115..af5b0ed3 100644 +--- a/libmultipath/foreign.c ++++ b/libmultipath/foreign.c +@@ -129,7 +129,7 @@ static void free_pre(void *arg) + static int _init_foreign(const char *enable) + { + char pathbuf[PATH_MAX]; +- struct dirent **di; ++ struct dirent **di = NULL; + struct scandir_result sr; + int r, i; + regex_t *enable_re = NULL; diff --git a/0030-libmultipath-be-lenient-in-allowing-the-alua-based-p.patch b/0030-libmultipath-be-lenient-in-allowing-the-alua-based-p.patch new file mode 100644 index 0000000..06a1b0f --- /dev/null +++ b/0030-libmultipath-be-lenient-in-allowing-the-alua-based-p.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 22 Jan 2025 22:16:43 -0500 +Subject: [PATCH] libmultipath: be lenient in allowing the alua-based + pgpolicies + +multipath wouldn't autodetect the GROUP_BY_PRIO path grouping policy or +allow the GROUP_BY_TPG policy if there was a path that didn't have its +prioritizer selected (for instance because multipathd was reconfigured +while it was offline). To avoid this, make verify_alua_prio() assume an +alua multipath device if all the paths with a prioritizer selected +(there must be at least one) use an alua-based prioritizer. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +(cherry picked from commit b47a577998eaff203018a00b57ba5e3674645848) +--- + libmultipath/propsel.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c +index a3fce203..c09a0619 100644 +--- a/libmultipath/propsel.c ++++ b/libmultipath/propsel.c +@@ -255,14 +255,18 @@ verify_alua_prio(struct multipath *mp) + { + int i; + struct path *pp; ++ bool assume_alua = false; + + vector_foreach_slot(mp->paths, pp, i) { + const char *name = prio_name(&pp->prio); ++ if (!prio_selected(&pp->prio)) ++ continue; + if (strncmp(name, PRIO_ALUA, PRIO_NAME_LEN) && + strncmp(name, PRIO_SYSFS, PRIO_NAME_LEN)) + return false; ++ assume_alua = true; + } +- return true; ++ return assume_alua; + } + + int select_detect_pgpolicy(struct config *conf, struct multipath *mp) diff --git a/0031-Update-NEWS.md-for-0.10.2.patch b/0031-Update-NEWS.md-for-0.10.2.patch new file mode 100644 index 0000000..fd31420 --- /dev/null +++ b/0031-Update-NEWS.md-for-0.10.2.patch @@ -0,0 +1,64 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 24 Jan 2025 20:03:15 +0100 +Subject: [PATCH] Update NEWS.md for 0.10.2 + +Signed-off-by: Benjamin Marzinski +--- + .github/actions/spelling/expect.txt | 2 ++ + NEWS.md | 23 ++++++++++++++++++++++- + 2 files changed, 24 insertions(+), 1 deletion(-) + +diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt +index 000d5ebb..4ac57510 100644 +--- a/.github/actions/spelling/expect.txt ++++ b/.github/actions/spelling/expect.txt +@@ -11,6 +11,7 @@ ata + autoconfig + autodetected + autoresize ++backported + barbie + BINDIR + blkid +@@ -122,6 +123,7 @@ Lun + lvm + lvmteam + Marzinski ++misdetection + mpath + mpathb + mpathpersist +diff --git a/NEWS.md b/NEWS.md +index 3c51553e..1b239ffa 100644 +--- a/NEWS.md ++++ b/NEWS.md +@@ -1,6 +1,27 @@ + # multipath-tools Release Notes + +-## multipath-tools 0.10.1, 2024/11 ++## multipath-tools 0.10.2, 2025/02 ++ ++This release contains backported bug fixes from the stable-0.11.y branch. ++ ++### Bug fixes ++ ++* Fix multipathd crash because of invalid path group index value, for example ++ if an invalid path device was removed from a map. ++ Fixes [#105](https://github.com/opensvc/multipath-tools/issues/105). ++* Make sure maps are reloaded in the path checker loop after detecting an ++ inconsistent or wrong kernel state (e.g. missing or falsely mapped path ++ device). Wrongly mapped paths will be unmapped and released to the system. ++ Fixes another issue reported in ++ [#105](https://github.com/opensvc/multipath-tools/issues/105). ++* Fix the problem that `group_by_tpg` might be disabled if one or more ++ paths were offline during initial configuration. ++* Fix possible misdetection of changed pathgroups in a map. ++* Fix the problem that if a map was scheduled to be reloaded already, ++ `max_sectors_kb` might not be set on a path device that ++ was being added to a multipath map. This problem was introduced in 0.9.9. ++ ++## multipath-tools 0.10.1, 2025/01 + + This is the first bug fix release on the `stable-0.10.y` branch. It contains + bug fixes from 0.11.0, and some CI-related fixes. diff --git a/0032-GitHub-Workflows-fix-abi-stable.yaml-for-pull-reques.patch b/0032-GitHub-Workflows-fix-abi-stable.yaml-for-pull-reques.patch new file mode 100644 index 0000000..3ddab39 --- /dev/null +++ b/0032-GitHub-Workflows-fix-abi-stable.yaml-for-pull-reques.patch @@ -0,0 +1,61 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Sat, 25 Jan 2025 00:49:19 +0100 +Subject: [PATCH] GitHub Workflows: fix abi-stable.yaml for pull request + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + .github/workflows/abi-stable.yaml | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/.github/workflows/abi-stable.yaml b/.github/workflows/abi-stable.yaml +index a6746f23..472914ce 100644 +--- a/.github/workflows/abi-stable.yaml ++++ b/.github/workflows/abi-stable.yaml +@@ -15,12 +15,16 @@ on: + + jobs: + reference-abi: +- runs-on: ubuntu-20.04 ++ runs-on: ubuntu-22.04 + steps: + - name: get parent tag + run: > + echo ${{ github.ref }} | + sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV ++ if: ${{ github.event_name == 'push' }} ++ - name: get parent tag ++ run: echo PARENT_TAG=${{ github.base_ref }} >> $GITHUB_ENV ++ if: ${{ github.event_name == 'pull_request' }} + - name: assert parent tag + run: /bin/false + if: ${{ env.PARENT_TAG == '' }} +@@ -45,20 +49,24 @@ jobs: + path: abi + + check-abi: +- runs-on: ubuntu-20.04 ++ runs-on: ubuntu-22.04 + needs: reference-abi + steps: + - name: get parent tag + run: > + echo ${{ github.ref }} | + sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV ++ if: ${{ github.event_name == 'push' }} ++ - name: get parent tag ++ run: echo PARENT_TAG=${{ github.base_ref }} >> $GITHUB_ENV ++ if: ${{ github.event_name == 'pull_request' }} + - name: assert parent tag + run: /bin/false + if: ${{ env.PARENT_TAG == '' }} +- - name: checkout ${{ env.PARENT_TAG }} ++ - name: checkout ${{ github.base_ref }} + uses: actions/checkout@v4 + with: +- ref: ${{ env.PARENT_TAG }} ++ ref: ${{ github.base_ref }} + - name: download ABI for ${{ env.PARENT_TAG }} + id: download_abi + uses: actions/download-artifact@v4 diff --git a/0001-RH-fixup-udev-rules-for-redhat.patch b/0033-RH-fixup-udev-rules-for-redhat.patch similarity index 100% rename from 0001-RH-fixup-udev-rules-for-redhat.patch rename to 0033-RH-fixup-udev-rules-for-redhat.patch diff --git a/0002-RH-Remove-the-property-blacklist-exception-builtin.patch b/0034-RH-Remove-the-property-blacklist-exception-builtin.patch similarity index 100% rename from 0002-RH-Remove-the-property-blacklist-exception-builtin.patch rename to 0034-RH-Remove-the-property-blacklist-exception-builtin.patch diff --git a/0003-RH-don-t-start-without-a-config-file.patch b/0035-RH-don-t-start-without-a-config-file.patch similarity index 98% rename from 0003-RH-don-t-start-without-a-config-file.patch rename to 0035-RH-don-t-start-without-a-config-file.patch index 02827df..8a3c5b6 100644 --- a/0003-RH-don-t-start-without-a-config-file.patch +++ b/0035-RH-don-t-start-without-a-config-file.patch @@ -22,10 +22,10 @@ Signed-off-by: Benjamin Marzinski 7 files changed, 25 insertions(+) diff --git a/libmultipath/config.c b/libmultipath/config.c -index 0e3a5cc1..80f61914 100644 +index 226ddecb..588ae9ee 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c -@@ -959,6 +959,19 @@ int init_config__ (const char *file, struct config *conf) +@@ -962,6 +962,19 @@ int init_config__ (const char *file, struct config *conf) } factorize_hwtable(conf->hwtable, builtin_hwtable_size, file); validate_pctable(conf->overrides, 0, file); diff --git a/0004-RH-Fix-nvme-function-missing-argument.patch b/0036-RH-Fix-nvme-function-missing-argument.patch similarity index 100% rename from 0004-RH-Fix-nvme-function-missing-argument.patch rename to 0036-RH-Fix-nvme-function-missing-argument.patch diff --git a/0005-RH-use-rpm-optflags-if-present.patch b/0037-RH-use-rpm-optflags-if-present.patch similarity index 97% rename from 0005-RH-use-rpm-optflags-if-present.patch rename to 0037-RH-use-rpm-optflags-if-present.patch index 266e224..66d14bc 100644 --- a/0005-RH-use-rpm-optflags-if-present.patch +++ b/0037-RH-use-rpm-optflags-if-present.patch @@ -7,13 +7,14 @@ Use the passed in optflags when compiling as an RPM, and keep the default flags as close as possible to the current fedora flags, while still being generic. +Co-authored-by: Yaakov Selkowitz Signed-off-by: Benjamin Marzinski --- Makefile.inc | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Makefile.inc b/Makefile.inc -index 81cb61d2..35334a0c 100644 +index 81cb61d2..a5024bb7 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -99,28 +99,39 @@ SYSTEMD_LIBDEPS := $(if $(SYSTEMD),$(if $(shell test $(SYSTEMD) -gt 209 && echo diff --git a/0006-RH-add-mpathconf.patch b/0038-RH-add-mpathconf.patch similarity index 99% rename from 0006-RH-add-mpathconf.patch rename to 0038-RH-add-mpathconf.patch index 2ae48f3..103ca55 100644 --- a/0006-RH-add-mpathconf.patch +++ b/0038-RH-add-mpathconf.patch @@ -23,11 +23,11 @@ Signed-off-by: Benjamin Marzinski create mode 100644 multipath/mpathconf.8 diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt -index 934f582e..61351583 100644 +index 4ac57510..3602a071 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt -@@ -124,9 +124,11 @@ lvmteam - Marzinski +@@ -126,9 +126,11 @@ Marzinski + misdetection mpath mpathb +mpathconf @@ -38,7 +38,7 @@ index 934f582e..61351583 100644 multipathc multipathd multipathed -@@ -144,6 +146,7 @@ ontap +@@ -146,6 +148,7 @@ ontap OOM opensvc OPTFLAGS @@ -47,10 +47,10 @@ index 934f582e..61351583 100644 partx pathgroup diff --git a/libmultipath/config.c b/libmultipath/config.c -index 80f61914..1373f15b 100644 +index 588ae9ee..3cb8449c 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c -@@ -961,6 +961,8 @@ int init_config__ (const char *file, struct config *conf) +@@ -964,6 +964,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."); diff --git a/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch b/0039-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch similarity index 100% rename from 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch rename to 0039-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch diff --git a/0008-RH-reset-default-find_mutipaths-value-to-off.patch b/0040-RH-reset-default-find_mutipaths-value-to-off.patch similarity index 100% rename from 0008-RH-reset-default-find_mutipaths-value-to-off.patch rename to 0040-RH-reset-default-find_mutipaths-value-to-off.patch diff --git a/0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch b/0041-RH-attempt-to-get-ANA-info-via-sysfs-first.patch similarity index 100% rename from 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch rename to 0041-RH-attempt-to-get-ANA-info-via-sysfs-first.patch diff --git a/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch b/0042-RH-make-parse_vpd_pg83-match-scsi_id-output.patch similarity index 98% rename from 0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch rename to 0042-RH-make-parse_vpd_pg83-match-scsi_id-output.patch index 06194f6..0d5baa3 100644 --- a/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch +++ b/0042-RH-make-parse_vpd_pg83-match-scsi_id-output.patch @@ -14,7 +14,7 @@ Signed-off-by: Benjamin Marzinski 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c -index e94705bf..61ac27ef 100644 +index 5043330c..e14507e8 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -1221,13 +1221,9 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, diff --git a/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch b/0043-RH-add-scsi-device-handlers-to-modules-load.d.patch similarity index 96% rename from 0011-RH-add-scsi-device-handlers-to-modules-load.d.patch rename to 0043-RH-add-scsi-device-handlers-to-modules-load.d.patch index 3debe8a..ef0ee42 100644 --- a/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch +++ b/0043-RH-add-scsi-device-handlers-to-modules-load.d.patch @@ -11,7 +11,7 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc -index 35334a0c..377125b6 100644 +index a5024bb7..834b63b9 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -16,7 +16,7 @@ READLINE := diff --git a/0012-RH-compile-with-libreadline-support.patch b/0044-RH-compile-with-libreadline-support.patch similarity index 96% rename from 0012-RH-compile-with-libreadline-support.patch rename to 0044-RH-compile-with-libreadline-support.patch index db04640..50781c3 100644 --- a/0012-RH-compile-with-libreadline-support.patch +++ b/0044-RH-compile-with-libreadline-support.patch @@ -12,7 +12,7 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc -index 377125b6..4a6528a9 100644 +index 834b63b9..c482a181 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -12,7 +12,7 @@ diff --git a/0013-RH-Add-mpathcleanup.patch b/0045-RH-Add-mpathcleanup.patch similarity index 100% rename from 0013-RH-Add-mpathcleanup.patch rename to 0045-RH-Add-mpathcleanup.patch diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index d2c3cc6..8e469ab 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.10.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Tools to manage multipath devices using device-mapper # readline uses GPL-3.0-only License: GPL-2.0-only AND GPL-3.0-only @@ -11,19 +11,51 @@ URL: http://christophe.varoqui.free.fr/ # curl -L https://github.com/opensvc/multipath-tools/archive/0.10.0.tar.gz -o multipath-tools-0.10.0.tgz Source0: multipath-tools-0.10.0.tgz Source1: multipath.conf -Patch0001: 0001-RH-fixup-udev-rules-for-redhat.patch -Patch0002: 0002-RH-Remove-the-property-blacklist-exception-builtin.patch -Patch0003: 0003-RH-don-t-start-without-a-config-file.patch -Patch0004: 0004-RH-Fix-nvme-function-missing-argument.patch -Patch0005: 0005-RH-use-rpm-optflags-if-present.patch -Patch0006: 0006-RH-add-mpathconf.patch -Patch0007: 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch -Patch0008: 0008-RH-reset-default-find_mutipaths-value-to-off.patch -Patch0009: 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch -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 +Patch0001: 0001-GitHub-workflows-use-upload-download-artifact-v4.patch +Patch0002: 0002-GitHub-workflows-update-dawidd6-action-download-arti.patch +Patch0003: 0003-Github-workflows-native.yml-use-mosteo-actions-docke.patch +Patch0004: 0004-GitHub-workflows-native.yml-use-extra-job-for-clang.patch +Patch0005: 0005-GitHub-workflows-native.yaml-make-test-and-archive-s.patch +Patch0006: 0006-GitHub-workflows-enable-unit-tests-for-stable-branch.patch +Patch0007: 0007-GitHub-Workflows-add-abi-check-for-stable-branches.patch +Patch0008: 0008-libmultipath-dm_get_maps-don-t-bail-out-for-single-m.patch +Patch0009: 0009-11-dm-mpath.rules.in-import-DM_COLDPLUG_SUSPENDED-on.patch +Patch0010: 0010-11-dm-mpath.rules.in-handle-inactive-suspended-devic.patch +Patch0011: 0011-11-dm-mpath.rules.in-clarify-DM_ACTIVATION-logic.patch +Patch0012: 0012-11-dm-mpath-rules.in-skip-one-.DM_NOSCAN-check.patch +Patch0013: 0013-11-dm-mpath.rules.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch +Patch0014: 0014-libmultipath-don-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch +Patch0015: 0015-multipathd-fix-deferred_failback_tick-for-reload-rem.patch +Patch0016: 0016-multipathd-fix-an-unsigned-int-ovwerflow.patch +Patch0017: 0017-libmpathutil-avoid-Wcast-function-type-mismatch-erro.patch +Patch0018: 0018-Update-NEWS.md-for-0.10.1.patch +Patch0019: 0019-libmultipath-don-t-print-error-message-if-WATCHDOG_U.patch +Patch0020: 0020-libmultipath-reduce-log-level-of-map-X-has-multiple-.patch +Patch0021: 0021-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch +Patch0022: 0022-libmultipath-add-condition-for-enqueueing-path-to-io.patch +Patch0023: 0023-Additional-NEWS.md-updates-for-0.10.1.patch +Patch0024: 0024-libmultipath-fix-handling-of-pp-pgindex.patch +Patch0025: 0025-libmultipath-make-pgcmp-detect-if-map-is-missing-a-p.patch +Patch0026: 0026-libmultipath-trigger-uevents-upon-map-creation-in-do.patch +Patch0027: 0027-multipathd-trigger-uevents-upon-map-removal-in-coale.patch +Patch0028: 0028-libmultipath-Don-t-skip-set_path_max_sectors_kb.patch +Patch0029: 0029-libmultipath-stop-static-analyzer-complaint-in-init_.patch +Patch0030: 0030-libmultipath-be-lenient-in-allowing-the-alua-based-p.patch +Patch0031: 0031-Update-NEWS.md-for-0.10.2.patch +Patch0032: 0032-GitHub-Workflows-fix-abi-stable.yaml-for-pull-reques.patch +Patch0033: 0033-RH-fixup-udev-rules-for-redhat.patch +Patch0034: 0034-RH-Remove-the-property-blacklist-exception-builtin.patch +Patch0035: 0035-RH-don-t-start-without-a-config-file.patch +Patch0036: 0036-RH-Fix-nvme-function-missing-argument.patch +Patch0037: 0037-RH-use-rpm-optflags-if-present.patch +Patch0038: 0038-RH-add-mpathconf.patch +Patch0039: 0039-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +Patch0040: 0040-RH-reset-default-find_mutipaths-value-to-off.patch +Patch0041: 0041-RH-attempt-to-get-ANA-info-via-sysfs-first.patch +Patch0042: 0042-RH-make-parse_vpd_pg83-match-scsi_id-output.patch +Patch0043: 0043-RH-add-scsi-device-handlers-to-modules-load.d.patch +Patch0044: 0044-RH-compile-with-libreadline-support.patch +Patch0045: 0045-RH-Add-mpathcleanup.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -233,6 +265,11 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Sat Feb 1 2025 Benjamin Marzinski - 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 - 0.10.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 30306052cc8ded97742c95e1b7e1c4a5ceeab621 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Mon, 3 Mar 2025 12:33:06 -0500 Subject: [PATCH 16/19] device-mapper-multipath-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 --- .gitignore | 1 + ...lows-use-upload-download-artifact-v4.patch | 122 ---------------- ...er-uevents-for-blacklisted-paths-in-.patch | 101 +++++++++++++ ...-update-dawidd6-action-download-arti.patch | 24 --- ...fix-compilation-with-latest-userspac.patch | 63 ++++++++ ...-native.yml-use-mosteo-actions-docke.patch | 98 ------------- ...-include-urcu.h-before-urcu-atomic.h.patch | 40 +++++ ...s-native.yml-use-extra-job-for-clang.patch | 43 ------ ...uxsock.c-Include-string.h-for-memcpy.patch | 29 ++++ ...-native.yaml-make-test-and-archive-s.patch | 51 ------- ... 0005-RH-fixup-udev-rules-for-redhat.patch | 2 +- ...-enable-unit-tests-for-stable-branch.patch | 133 ----------------- ...property-blacklist-exception-builtin.patch | 0 ...ws-add-abi-check-for-stable-branches.patch | 110 -------------- ...RH-don-t-start-without-a-config-file.patch | 8 +- ...H-Fix-nvme-function-missing-argument.patch | 0 ...get_maps-don-t-bail-out-for-single-m.patch | 32 ---- ...s.in-import-DM_COLDPLUG_SUSPENDED-on.patch | 42 ------ ... 0009-RH-use-rpm-optflags-if-present.patch | 7 +- ...s.in-handle-inactive-suspended-devic.patch | 66 --------- ...hconf.patch => 0010-RH-add-mpathconf.patch | 10 +- ...rules.in-clarify-DM_ACTIVATION-logic.patch | 78 ---------- ...om-kernel-cmdline-mpath.wwids-with-A.patch | 6 +- ...h-rules.in-skip-one-.DM_NOSCAN-check.patch | 28 ---- ...-default-find_mutipaths-value-to-off.patch | 0 ...s.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch | 44 ------ ...empt-to-get-ANA-info-via-sysfs-first.patch | 0 ...-parse_vpd_pg83-match-scsi_id-output.patch | 6 +- ...-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch | 31 ---- ...si-device-handlers-to-modules-load.d.patch | 2 +- ...eferred_failback_tick-for-reload-rem.patch | 35 ----- ...-RH-compile-with-libreadline-support.patch | 2 +- ...ipathd-fix-an-unsigned-int-ovwerflow.patch | 28 ---- ...up.patch => 0017-RH-Add-mpathcleanup.patch | 0 ...id-Wcast-function-type-mismatch-erro.patch | 36 ----- 0018-Update-NEWS.md-for-0.10.1.patch | 44 ------ ...-t-print-error-message-if-WATCHDOG_U.patch | 30 ---- ...uce-log-level-of-map-X-has-multiple-.patch | 38 ----- ...eign-fix-memory-leak-in-nvme-foreign.patch | 54 ------- ...-condition-for-enqueueing-path-to-io.patch | 41 ------ ...dditional-NEWS.md-updates-for-0.10.1.patch | 63 -------- ...multipath-fix-handling-of-pp-pgindex.patch | 138 ------------------ ...e-pgcmp-detect-if-map-is-missing-a-p.patch | 70 --------- ...gger-uevents-upon-map-creation-in-do.patch | 94 ------------ ...er-uevents-upon-map-removal-in-coale.patch | 41 ------ ...h-Don-t-skip-set_path_max_sectors_kb.patch | 31 ---- ...p-static-analyzer-complaint-in-init_.patch | 27 ---- ...lenient-in-allowing-the-alua-based-p.patch | 44 ------ 0031-Update-NEWS.md-for-0.10.2.patch | 64 -------- ...-fix-abi-stable.yaml-for-pull-reques.patch | 61 -------- device-mapper-multipath.spec | 79 ++++------ sources | 2 +- 52 files changed, 285 insertions(+), 1914 deletions(-) delete mode 100644 0001-GitHub-workflows-use-upload-download-artifact-v4.patch create mode 100644 0001-multipathd-trigger-uevents-for-blacklisted-paths-in-.patch delete mode 100644 0002-GitHub-workflows-update-dawidd6-action-download-arti.patch create mode 100644 0002-multipath-tools-fix-compilation-with-latest-userspac.patch delete mode 100644 0003-Github-workflows-native.yml-use-mosteo-actions-docke.patch create mode 100644 0003-libmultipath-include-urcu.h-before-urcu-atomic.h.patch delete mode 100644 0004-GitHub-workflows-native.yml-use-extra-job-for-clang.patch create mode 100644 0004-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch delete mode 100644 0005-GitHub-workflows-native.yaml-make-test-and-archive-s.patch rename 0033-RH-fixup-udev-rules-for-redhat.patch => 0005-RH-fixup-udev-rules-for-redhat.patch (98%) delete mode 100644 0006-GitHub-workflows-enable-unit-tests-for-stable-branch.patch rename 0034-RH-Remove-the-property-blacklist-exception-builtin.patch => 0006-RH-Remove-the-property-blacklist-exception-builtin.patch (100%) delete mode 100644 0007-GitHub-Workflows-add-abi-check-for-stable-branches.patch rename 0035-RH-don-t-start-without-a-config-file.patch => 0007-RH-don-t-start-without-a-config-file.patch (96%) rename 0036-RH-Fix-nvme-function-missing-argument.patch => 0008-RH-Fix-nvme-function-missing-argument.patch (100%) delete mode 100644 0008-libmultipath-dm_get_maps-don-t-bail-out-for-single-m.patch delete mode 100644 0009-11-dm-mpath.rules.in-import-DM_COLDPLUG_SUSPENDED-on.patch rename 0037-RH-use-rpm-optflags-if-present.patch => 0009-RH-use-rpm-optflags-if-present.patch (92%) delete mode 100644 0010-11-dm-mpath.rules.in-handle-inactive-suspended-devic.patch rename 0038-RH-add-mpathconf.patch => 0010-RH-add-mpathconf.patch (99%) delete mode 100644 0011-11-dm-mpath.rules.in-clarify-DM_ACTIVATION-logic.patch rename 0039-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch => 0011-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch (97%) delete mode 100644 0012-11-dm-mpath-rules.in-skip-one-.DM_NOSCAN-check.patch rename 0040-RH-reset-default-find_mutipaths-value-to-off.patch => 0012-RH-reset-default-find_mutipaths-value-to-off.patch (100%) delete mode 100644 0013-11-dm-mpath.rules.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch rename 0041-RH-attempt-to-get-ANA-info-via-sysfs-first.patch => 0013-RH-attempt-to-get-ANA-info-via-sysfs-first.patch (100%) rename 0042-RH-make-parse_vpd_pg83-match-scsi_id-output.patch => 0014-RH-make-parse_vpd_pg83-match-scsi_id-output.patch (94%) delete mode 100644 0014-libmultipath-don-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch rename 0043-RH-add-scsi-device-handlers-to-modules-load.d.patch => 0015-RH-add-scsi-device-handlers-to-modules-load.d.patch (96%) delete mode 100644 0015-multipathd-fix-deferred_failback_tick-for-reload-rem.patch rename 0044-RH-compile-with-libreadline-support.patch => 0016-RH-compile-with-libreadline-support.patch (96%) delete mode 100644 0016-multipathd-fix-an-unsigned-int-ovwerflow.patch rename 0045-RH-Add-mpathcleanup.patch => 0017-RH-Add-mpathcleanup.patch (100%) delete mode 100644 0017-libmpathutil-avoid-Wcast-function-type-mismatch-erro.patch delete mode 100644 0018-Update-NEWS.md-for-0.10.1.patch delete mode 100644 0019-libmultipath-don-t-print-error-message-if-WATCHDOG_U.patch delete mode 100644 0020-libmultipath-reduce-log-level-of-map-X-has-multiple-.patch delete mode 100644 0021-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch delete mode 100644 0022-libmultipath-add-condition-for-enqueueing-path-to-io.patch delete mode 100644 0023-Additional-NEWS.md-updates-for-0.10.1.patch delete mode 100644 0024-libmultipath-fix-handling-of-pp-pgindex.patch delete mode 100644 0025-libmultipath-make-pgcmp-detect-if-map-is-missing-a-p.patch delete mode 100644 0026-libmultipath-trigger-uevents-upon-map-creation-in-do.patch delete mode 100644 0027-multipathd-trigger-uevents-upon-map-removal-in-coale.patch delete mode 100644 0028-libmultipath-Don-t-skip-set_path_max_sectors_kb.patch delete mode 100644 0029-libmultipath-stop-static-analyzer-complaint-in-init_.patch delete mode 100644 0030-libmultipath-be-lenient-in-allowing-the-alua-based-p.patch delete mode 100644 0031-Update-NEWS.md-for-0.10.2.patch delete mode 100644 0032-GitHub-Workflows-fix-abi-stable.yaml-for-pull-reques.patch diff --git a/.gitignore b/.gitignore index 908094d..8cd21df 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ multipath-tools-091027.tar.gz /multipath-tools-0.9.8.tgz /multipath-tools-0.9.9.tgz /multipath-tools-0.10.0.tgz +/multipath-tools-0.11.1.tgz diff --git a/0001-GitHub-workflows-use-upload-download-artifact-v4.patch b/0001-GitHub-workflows-use-upload-download-artifact-v4.patch deleted file mode 100644 index c8247ca..0000000 --- a/0001-GitHub-workflows-use-upload-download-artifact-v4.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 13 Sep 2024 09:09:19 +0200 -Subject: [PATCH] GitHub workflows: use {upload,download}-artifact@v4 - -The @v1 releases are deprecated. -https://github.blog/changelog/2024-02-13-deprecation-notice-v1-and-v2-of-the-artifact-actions/ - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/workflows/abi.yaml | 6 ++++-- - .github/workflows/foreign.yaml | 15 +++++++-------- - .github/workflows/native.yaml | 5 +++-- - 3 files changed, 14 insertions(+), 12 deletions(-) - -diff --git a/.github/workflows/abi.yaml b/.github/workflows/abi.yaml -index 393322e5..dce09f5c 100644 ---- a/.github/workflows/abi.yaml -+++ b/.github/workflows/abi.yaml -@@ -45,10 +45,11 @@ jobs: - - name: create ABI - run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) abi.tar.gz - - name: save ABI -- uses: actions/upload-artifact@v1 -+ uses: actions/upload-artifact@v4 - with: - name: abi - path: abi -+ overwrite: true - - name: compare ABI against reference - id: compare - continue-on-error: true -@@ -56,10 +57,11 @@ jobs: - run: make abi-test - - name: save differences - if: ${{ steps.compare.outcome == 'failure' }} -- uses: actions/upload-artifact@v1 -+ uses: actions/upload-artifact@v4 - with: - name: abi-test - path: abi-test -+ overwrite: true - - - name: fail - # MUST use >- here, otherwise the condition always evaluates to true -diff --git a/.github/workflows/foreign.yaml b/.github/workflows/foreign.yaml -index 9e4d35e0..d68650df 100644 ---- a/.github/workflows/foreign.yaml -+++ b/.github/workflows/foreign.yaml -@@ -36,14 +36,13 @@ jobs: - - name: checkout - uses: actions/checkout@v1 - - name: build -- run: make -j8 -Orecurse test-progs -- - name: create binary archive -- run: make test-progs.tar -+ run: make -j -Orecurse test-progs.tar - - name: upload binary archive -- uses: actions/upload-artifact@v1 -+ uses: actions/upload-artifact@v4 - with: - name: cross-${{ matrix.os }}-${{ matrix.arch }} - path: test-progs.tar -+ overwrite: true - - test: - runs-on: ubuntu-22.04 -@@ -61,11 +60,11 @@ jobs: - run: echo CONTAINER_ARCH="arm/v7" >> $GITHUB_ENV - if: ${{ matrix.arch == 'armhf' }} - - name: download binary archive -- uses: actions/download-artifact@v1 -+ uses: actions/download-artifact@v4 - with: - name: cross-${{ matrix.os }}-${{ matrix.arch }} - - name: unpack binary archive -- run: tar xfv cross-${{ matrix.os }}-${{ matrix.arch }}/test-progs.tar -+ run: tar xfv test-progs.tar - - name: enable foreign arch - uses: dbhi/qus/action@main - - name: run tests -@@ -100,11 +99,11 @@ jobs: - run: echo CONTAINER_ARCH="arm/v7" >> $GITHUB_ENV - if: ${{ matrix.arch == 'armhf' }} - - name: download binary archive -- uses: actions/download-artifact@v1 -+ uses: actions/download-artifact@v4 - with: - name: cross-${{ matrix.os }}-${{ matrix.arch }} - - name: unpack binary archive -- run: tar xfv cross-${{ matrix.os }}-${{ matrix.arch }}/test-progs.tar -+ run: tar xfv test-progs.tar - - name: enable foreign arch - uses: dbhi/qus/action@main - - name: run tests -diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml -index 80ff6df5..500becaa 100644 ---- a/.github/workflows/native.yaml -+++ b/.github/workflows/native.yaml -@@ -57,10 +57,11 @@ jobs: - - name: create binary archive - run: make ${{ env.ARCHIVE_TGT }} - - name: upload binary archive -- uses: actions/upload-artifact@v1 -+ uses: actions/upload-artifact@v4 - with: - name: native-${{ matrix.os }} - path: ${{ env.ARCHIVE_TGT }} -+ overwrite: true - - - name: clean - run: make clean -@@ -98,7 +99,7 @@ jobs: - uses: actions/checkout@v1 - - - name: download binary archive -- uses: actions/download-artifact@v1 -+ uses: actions/download-artifact@v4 - with: - name: native-${{ matrix.os }} - - name: unpack binary archive diff --git a/0001-multipathd-trigger-uevents-for-blacklisted-paths-in-.patch b/0001-multipathd-trigger-uevents-for-blacklisted-paths-in-.patch new file mode 100644 index 0000000..72bcf69 --- /dev/null +++ b/0001-multipathd-trigger-uevents-for-blacklisted-paths-in-.patch @@ -0,0 +1,101 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 23 Jan 2025 22:19:39 +0100 +Subject: [PATCH] multipathd: trigger uevents for blacklisted paths in + reconfigure + +If multipathd has already configured maps, and the user changes the +blacklist or other parameters that cause currently multipathed +devices to be skipped, and then runs "multipathd reconfigure" +or restarts multipathd, multipathd flushes the maps in question, +but doesn't trigger uevents for the now-blacklisted paths. + +This is because the blacklisted paths are removed from the discovered +maps internally when update_pathvec_from_dm() is called through +map_discovery() and update_multipath_table(); when later +trigger_paths_udev_change() is called from coalesce_maps(), the +map contains no paths for which an uevent could be triggered. + +The map_discovery() code flow is special, because we will call +coalesce_paths() afterwards anyway and reconstruct the mpvec. Unlike the +regular code flow, we don't want the maps to be "corrected" in this +case, because the maps discovered here aren't going to be reloaded. +We just want update_pathvec_from_dm() to populate the pathvec. + +Therefore add a new flag DI_DISCOVERY, which is only set when +update_multipath_table() is called from map_discovery(), and if +this flag is set, keep PATHINFO_SKIPPED paths in the map's table in +update_pathvec_from_dm(). Later on, the paths will still be visible +in the old mpp (ompp) in coalesce_maps(), and uevents will be +triggered for them to release them to systemd. + +We can't always do this for PATHINFO_SKIPPED, because in some cases +paths may be accepted in a map first and SKIPPED later (for example if +the WWID wasn't yet available at startup). Therefore the special +case for DI_DISCOVERY is necessary. + +Signed-off-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + libmultipath/discovery.h | 2 ++ + libmultipath/structs_vec.c | 6 +++++- + multipathd/main.c | 2 +- + 3 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h +index 7d42eae5..9824a8d3 100644 +--- a/libmultipath/discovery.h ++++ b/libmultipath/discovery.h +@@ -72,6 +72,7 @@ enum discovery_mode { + DI_BLACKLIST__, + DI_NOIO__, + DI_NOFALLBACK__, ++ DI_DISCOVERY__, + }; + + #define DI_SYSFS (1 << DI_SYSFS__) +@@ -82,6 +83,7 @@ enum discovery_mode { + #define DI_BLACKLIST (1 << DI_BLACKLIST__) + #define DI_NOIO (1 << DI_NOIO__) /* Avoid IO on the device */ + #define DI_NOFALLBACK (1 << DI_NOFALLBACK__) /* do not allow wwid fallback */ ++#define DI_DISCOVERY (1 << DI_DISCOVERY__) /* set only during map discovery */ + + #define DI_ALL (DI_SYSFS | DI_SERIAL | DI_CHECKER | DI_PRIO | \ + DI_WWID) +diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c +index 7a4e3eb0..5ccdaea0 100644 +--- a/libmultipath/structs_vec.c ++++ b/libmultipath/structs_vec.c +@@ -109,6 +109,9 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, + bool mpp_has_wwid; + bool must_reload = false; + bool pg_deleted = false; ++ bool map_discovery = !!(pathinfo_flags & DI_DISCOVERY); ++ ++ pathinfo_flags &= ~DI_DISCOVERY; + + if (!mpp->pg) + return false; +@@ -195,7 +198,8 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, + rc = pathinfo(pp, conf, + DI_SYSFS|DI_WWID|DI_BLACKLIST|DI_NOFALLBACK|pathinfo_flags); + pthread_cleanup_pop(1); +- if (rc != PATHINFO_OK) { ++ if (rc == PATHINFO_FAILED || ++ (rc == PATHINFO_SKIPPED && !map_discovery)) { + condlog(1, "%s: error %d in pathinfo, discarding path", + pp->dev, rc); + vector_del_slot(pgp->paths, j--); +diff --git a/multipathd/main.c b/multipathd/main.c +index 9ed27da0..fb3e44a8 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -1763,7 +1763,7 @@ map_discovery (struct vectors * vecs) + return 1; + + vector_foreach_slot (vecs->mpvec, mpp, i) +- if (update_multipath_table(mpp, vecs->pathvec, 0) != DMP_OK) { ++ if (update_multipath_table(mpp, vecs->pathvec, DI_DISCOVERY) != DMP_OK) { + remove_map(mpp, vecs->pathvec, vecs->mpvec); + i--; + } diff --git a/0002-GitHub-workflows-update-dawidd6-action-download-arti.patch b/0002-GitHub-workflows-update-dawidd6-action-download-arti.patch deleted file mode 100644 index 423bf56..0000000 --- a/0002-GitHub-workflows-update-dawidd6-action-download-arti.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 13 Sep 2024 09:10:38 +0200 -Subject: [PATCH] GitHub workflows: update dawidd6/action-download-artifact - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/workflows/abi.yaml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/.github/workflows/abi.yaml b/.github/workflows/abi.yaml -index dce09f5c..d5f8b477 100644 ---- a/.github/workflows/abi.yaml -+++ b/.github/workflows/abi.yaml -@@ -28,7 +28,7 @@ jobs: - - name: get reference ABI - id: reference - continue-on-error: true -- uses: dawidd6/action-download-artifact@v2 -+ uses: dawidd6/action-download-artifact@v6 - with: - workflow: abi.yaml - branch: ${{ env.ABI_BRANCH }} diff --git a/0002-multipath-tools-fix-compilation-with-latest-userspac.patch b/0002-multipath-tools-fix-compilation-with-latest-userspac.patch new file mode 100644 index 0000000..03d7d9d --- /dev/null +++ b/0002-multipath-tools-fix-compilation-with-latest-userspac.patch @@ -0,0 +1,63 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Mon, 3 Feb 2025 16:43:42 -0500 +Subject: [PATCH] multipath-tools: fix compilation with latest userspace-rcu + code + +starting with version 0.15, userspace-rcu can be compiled with +CONFIG_RCU_USE_ATOMIC_BUILTINS. If it is, then any programs using it +must be compiled with at least the C11 standard. See: +https://github.com/urcu/userspace-rcu/commit/89280d020bf064d1055c360fb9974f128051043f + +To deal with this, check if compiling with gnu99 fails, and if so, +switch to using gnu11. + +Based-on-patch-by: Yaakov Selkowitz +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + Makefile.inc | 2 +- + create-config.mk | 13 +++++++++++++ + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/Makefile.inc b/Makefile.inc +index 729618bd..65f6efc8 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -115,7 +115,7 @@ CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) \ + -DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \ + -DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" -DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \ + -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP +-CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \ ++CFLAGS := -std=$(C_STD) $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \ + -fexceptions + BIN_CFLAGS := -fPIE -DPIE + LIB_CFLAGS := -fPIC +diff --git a/create-config.mk b/create-config.mk +index 8bd2c20c..ab163ed1 100644 +--- a/create-config.mk ++++ b/create-config.mk +@@ -157,6 +157,18 @@ FORTIFY_OPT := $(shell \ + echo "-D_FORTIFY_SOURCE=2"; \ + fi) + ++# Check is you can compile with the urcu.h header, using the C99 standard. ++# If urcu/config-.h defines CONFIG_RCU_USE_ATOMIC_BUILTINS, then anything ++# including urcu.h must be compiled with at least the C11 standard. See: ++# https://github.com/urcu/userspace-rcu/commit/89280d020bf064d1055c360fb9974f128051043f ++C_STD := $(shell \ ++ if printf '$(__HASH__)include \nint main(void) { return 0; }\n' | $(CC) -o /dev/null -c -xc --std=gnu99 - 2>/dev/null; \ ++ then \ ++ echo "gnu99"; \ ++ else \ ++ echo "gnu11"; \ ++ fi) ++ + STACKPROT := + + all: $(TOPDIR)/config.mk +@@ -182,3 +194,4 @@ $(TOPDIR)/config.mk: $(multipathdir)/autoconfig.h + @echo "W_MISSING_INITIALIZERS := $(call TEST_MISSING_INITIALIZERS)" >>$@ + @echo "W_URCU_TYPE_LIMITS := $(call TEST_URCU_TYPE_LIMITS)" >>$@ + @echo "ENABLE_LIBDMMP := $(ENABLE_LIBDMMP)" >>$@ ++ @echo "C_STD := $(C_STD)" >>$@ diff --git a/0003-Github-workflows-native.yml-use-mosteo-actions-docke.patch b/0003-Github-workflows-native.yml-use-mosteo-actions-docke.patch deleted file mode 100644 index 63aa273..0000000 --- a/0003-Github-workflows-native.yml-use-mosteo-actions-docke.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 13 Sep 2024 09:45:25 +0200 -Subject: [PATCH] Github workflows: native.yml: use mosteo-actions/docker-run - -We can't use "container:" any more because upload-artifact@v4 doesn't -work on Debian Jessie. - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/workflows/native.yaml | 45 +++++++++++++++++++++-------------- - 1 file changed, 27 insertions(+), 18 deletions(-) - -diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml -index 500becaa..70d01c55 100644 ---- a/.github/workflows/native.yaml -+++ b/.github/workflows/native.yaml -@@ -35,17 +35,9 @@ jobs: - - debian-bookworm - - fedora-40 - - opensuse-leap -- container: ghcr.io/mwilck/multipath-build-${{ matrix.os }} - steps: - - name: checkout - uses: actions/checkout@v1 -- - name: build and test -- if: ${{ matrix.os != 'debian-jessie' }} -- run: make -j -Orecurse test -- - name: build and test (jessie) -- # On jessie, we use libreadline 5 (no licensing issue) -- if: ${{ matrix.os == 'debian-jessie' }} -- run: make -j -Orecurse READLINE=libreadline test - - - name: set archive name - # Leap containers have cpio but not tar -@@ -54,8 +46,21 @@ jobs: - - name: set archive name - run: echo ARCHIVE_TGT=test-progs.tar >> $GITHUB_ENV - if: ${{ matrix.os != 'opensuse-leap' }} -- - name: create binary archive -- run: make ${{ env.ARCHIVE_TGT }} -+ -+ - name: build and test -+ if: ${{ matrix.os != 'debian-jessie' }} -+ uses: mosteo-actions/docker-run@v1 -+ with: -+ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} -+ command: -j -Orecurse ${{ env.ARCHIVE_TGT }} test -+ - name: build and test (jessie) -+ # On jessie, we use libreadline 5 (no licensing issue) -+ if: ${{ matrix.os == 'debian-jessie' }} -+ uses: mosteo-actions/docker-run@v1 -+ with: -+ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} -+ command: -j -Orecurse READLINE=libreadline ${{ env.ARCHIVE_TGT }} test -+ - - name: upload binary archive - uses: actions/upload-artifact@v4 - with: -@@ -67,14 +72,18 @@ jobs: - run: make clean - - name: clang - if: ${{ matrix.os != 'debian-jessie' }} -- env: -- CC: clang -- run: make -j -Orecurse test -+ uses: mosteo-actions/docker-run@v1 -+ with: -+ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} -+ params: -e CC=clang -+ command: -j -Orecurse test - - name: clang (jessie) - if: ${{ matrix.os == 'debian-jessie' }} -- env: -- CC: clang -- run: make READLINE=libreadline test -+ uses: mosteo-actions/docker-run@v1 -+ with: -+ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} -+ params: -e CC=clang -+ command: -j -Orecurse READLINE=libreadline test - - root-test: - runs-on: ubuntu-22.04 -@@ -103,10 +112,10 @@ jobs: - with: - name: native-${{ matrix.os }} - - name: unpack binary archive -- run: cpio -idv < native-${{ matrix.os }}/test-progs.cpio -+ run: cpio -idv < test-progs.cpio - if: ${{ matrix.os == 'opensuse-leap' }} - - name: unpack binary archive -- run: tar xfmv native-${{ matrix.os }}/test-progs.tar -+ run: tar xfmv test-progs.tar - if: ${{ matrix.os != 'opensuse-leap' }} - - - name: run root tests diff --git a/0003-libmultipath-include-urcu.h-before-urcu-atomic.h.patch b/0003-libmultipath-include-urcu.h-before-urcu-atomic.h.patch new file mode 100644 index 0000000..8da3ce7 --- /dev/null +++ b/0003-libmultipath-include-urcu.h-before-urcu-atomic.h.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Tue, 11 Feb 2025 13:11:03 -0500 +Subject: [PATCH] libmultipath: include urcu.h before urcu/atomic.h + +urcu/atomic.h requires some header files included by urcu.h. Make sure +to include it first. + +Fixes: https://github.com/opensvc/multipath-tools/issues/112 +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + libmultipath/checkers/tur.c | 1 + + libmultipath/lock.h | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/libmultipath/checkers/tur.c b/libmultipath/checkers/tur.c +index e70a2e11..0010acf8 100644 +--- a/libmultipath/checkers/tur.c ++++ b/libmultipath/checkers/tur.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + + #include "checkers.h" +diff --git a/libmultipath/lock.h b/libmultipath/lock.h +index 38473a8c..5f323055 100644 +--- a/libmultipath/lock.h ++++ b/libmultipath/lock.h +@@ -2,6 +2,7 @@ + #define LOCK_H_INCLUDED + + #include ++#include + #include + #include + diff --git a/0004-GitHub-workflows-native.yml-use-extra-job-for-clang.patch b/0004-GitHub-workflows-native.yml-use-extra-job-for-clang.patch deleted file mode 100644 index e6d618c..0000000 --- a/0004-GitHub-workflows-native.yml-use-extra-job-for-clang.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 13 Sep 2024 10:17:17 +0200 -Subject: [PATCH] GitHub workflows: native.yml: use extra job for clang - -Running "make" in a container and "make clean" outside doesn't -work (access right issues). So just use separate jobs. - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/workflows/native.yaml | 18 ++++++++++++++++-- - 1 file changed, 16 insertions(+), 2 deletions(-) - -diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml -index 70d01c55..95b53b87 100644 ---- a/.github/workflows/native.yaml -+++ b/.github/workflows/native.yaml -@@ -68,8 +68,22 @@ jobs: - path: ${{ env.ARCHIVE_TGT }} - overwrite: true - -- - name: clean -- run: make clean -+ clang: -+ runs-on: ubuntu-22.04 -+ strategy: -+ fail-fast: false -+ matrix: -+ os: -+ - debian-jessie -+ - debian-buster -+ - debian-bullseye -+ - debian-bookworm -+ - fedora-40 -+ - opensuse-leap -+ steps: -+ - name: checkout -+ uses: actions/checkout@v1 -+ - - name: clang - if: ${{ matrix.os != 'debian-jessie' }} - uses: mosteo-actions/docker-run@v1 diff --git a/0004-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch b/0004-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch new file mode 100644 index 0000000..8fc3211 --- /dev/null +++ b/0004-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 17 Feb 2025 12:05:03 -0800 +Subject: [PATCH] libmpathutils/uxsock.c: Include string.h for memcpy + +Fixes +uxsock.c:72:2: error: call to undeclared library function 'memcpy' with type 'void *(void *, const void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] + +Signed-off-by: Khem Raj +Cc: Benjamin Marzinski +Cc: Martin Wilck +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmpathutil/uxsock.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libmpathutil/uxsock.c b/libmpathutil/uxsock.c +index 2135476d..a474874e 100644 +--- a/libmpathutil/uxsock.c ++++ b/libmpathutil/uxsock.c +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/0005-GitHub-workflows-native.yaml-make-test-and-archive-s.patch b/0005-GitHub-workflows-native.yaml-make-test-and-archive-s.patch deleted file mode 100644 index cabfbcf..0000000 --- a/0005-GitHub-workflows-native.yaml-make-test-and-archive-s.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 13 Sep 2024 10:30:47 +0200 -Subject: [PATCH] GitHub workflows: native.yaml: make test and archive - separately - -Avoid "text file busy" error on GitHub. - -dmevents-test: Text file busy -Makefile:74: recipe for target 'dmevents.out' failed - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/workflows/native.yaml | 17 +++++++++++++++-- - 1 file changed, 15 insertions(+), 2 deletions(-) - -diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml -index 95b53b87..f06b09df 100644 ---- a/.github/workflows/native.yaml -+++ b/.github/workflows/native.yaml -@@ -52,14 +52,27 @@ jobs: - uses: mosteo-actions/docker-run@v1 - with: - image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} -- command: -j -Orecurse ${{ env.ARCHIVE_TGT }} test -+ command: -j -Orecurse test - - name: build and test (jessie) - # On jessie, we use libreadline 5 (no licensing issue) - if: ${{ matrix.os == 'debian-jessie' }} - uses: mosteo-actions/docker-run@v1 - with: - image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} -- command: -j -Orecurse READLINE=libreadline ${{ env.ARCHIVE_TGT }} test -+ command: -j -Orecurse READLINE=libreadline test -+ -+ - name: create ${{ env.ARCHIVE_TGT }} -+ if: ${{ matrix.os != 'debian-jessie' }} -+ uses: mosteo-actions/docker-run@v1 -+ with: -+ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} -+ command: ${{ env.ARCHIVE_TGT }} -+ - name: create ${{ env.ARCHIVE_TGT }} (jessie) -+ if: ${{ matrix.os == 'debian-jessie' }} -+ uses: mosteo-actions/docker-run@v1 -+ with: -+ image: ghcr.io/mwilck/multipath-build-${{ matrix.os }} -+ command: READLINE=libreadline ${{ env.ARCHIVE_TGT }} - - - name: upload binary archive - uses: actions/upload-artifact@v4 diff --git a/0033-RH-fixup-udev-rules-for-redhat.patch b/0005-RH-fixup-udev-rules-for-redhat.patch similarity index 98% rename from 0033-RH-fixup-udev-rules-for-redhat.patch rename to 0005-RH-fixup-udev-rules-for-redhat.patch index 0645240..0135f49 100644 --- a/0033-RH-fixup-udev-rules-for-redhat.patch +++ b/0005-RH-fixup-udev-rules-for-redhat.patch @@ -15,7 +15,7 @@ Signed-off-by: Benjamin Marzinski 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.inc b/Makefile.inc -index 729618bd..81cb61d2 100644 +index 65f6efc8..c225a1ed 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -34,7 +34,7 @@ endif diff --git a/0006-GitHub-workflows-enable-unit-tests-for-stable-branch.patch b/0006-GitHub-workflows-enable-unit-tests-for-stable-branch.patch deleted file mode 100644 index 4a9b254..0000000 --- a/0006-GitHub-workflows-enable-unit-tests-for-stable-branch.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 14 Nov 2024 16:02:38 +0100 -Subject: [PATCH] GitHub workflows: enable unit tests for stable branches - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/workflows/build-and-unittest.yaml | 2 ++ - .github/workflows/foreign.yaml | 2 ++ - .github/workflows/multiarch-stable.yaml | 2 ++ - .github/workflows/multiarch.yaml | 2 ++ - .github/workflows/native.yaml | 2 ++ - .github/workflows/rolling.yaml | 2 ++ - 6 files changed, 12 insertions(+) - -diff --git a/.github/workflows/build-and-unittest.yaml b/.github/workflows/build-and-unittest.yaml -index a838f9a2..1a727e14 100644 ---- a/.github/workflows/build-and-unittest.yaml -+++ b/.github/workflows/build-and-unittest.yaml -@@ -5,10 +5,12 @@ on: - - master - - queue - - tip -+ - 'stable-*' - pull_request: - branches: - - master - - queue -+ - 'stable-*' - jobs: - jammy: - runs-on: ubuntu-22.04 -diff --git a/.github/workflows/foreign.yaml b/.github/workflows/foreign.yaml -index d68650df..0f80957b 100644 ---- a/.github/workflows/foreign.yaml -+++ b/.github/workflows/foreign.yaml -@@ -5,6 +5,7 @@ on: - - master - - queue - - tip -+ - 'stable-*' - paths: - - '.github/workflows/foreign.yaml' - - '**.h' -@@ -15,6 +16,7 @@ on: - branches: - - master - - queue -+ - 'stable-*' - paths: - - '.github/workflows/foreign.yaml' - - '**.h' -diff --git a/.github/workflows/multiarch-stable.yaml b/.github/workflows/multiarch-stable.yaml -index e51d383c..ffede53d 100644 ---- a/.github/workflows/multiarch-stable.yaml -+++ b/.github/workflows/multiarch-stable.yaml -@@ -5,6 +5,7 @@ on: - - master - - queue - - tip -+ - 'stable-*' - paths: - - '.github/workflows/multiarch-stable.yaml' - - '**.h' -@@ -15,6 +16,7 @@ on: - branches: - - master - - queue -+ - 'stable-*' - paths: - - '.github/workflows/multiarch-stable.yaml' - - '**.h' -diff --git a/.github/workflows/multiarch.yaml b/.github/workflows/multiarch.yaml -index df95a02f..d2b833a4 100644 ---- a/.github/workflows/multiarch.yaml -+++ b/.github/workflows/multiarch.yaml -@@ -5,6 +5,7 @@ on: - - master - - queue - - tip -+ - 'stable-*' - paths: - - '.github/workflows/multiarch.yaml' - - '**.h' -@@ -15,6 +16,7 @@ on: - branches: - - master - - queue -+ - 'stable-*' - paths: - - '.github/workflows/multiarch.yaml' - - '**.h' -diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml -index f06b09df..c9d9df9e 100644 ---- a/.github/workflows/native.yaml -+++ b/.github/workflows/native.yaml -@@ -5,6 +5,7 @@ on: - - master - - queue - - tip -+ - 'stable-*' - paths: - - '.github/workflows/native.yaml' - - '**.h' -@@ -15,6 +16,7 @@ on: - branches: - - master - - queue -+ - 'stable-*' - paths: - - '.github/workflows/native.yaml' - - '**.h' -diff --git a/.github/workflows/rolling.yaml b/.github/workflows/rolling.yaml -index 3536b944..66af7a44 100644 ---- a/.github/workflows/rolling.yaml -+++ b/.github/workflows/rolling.yaml -@@ -5,6 +5,7 @@ on: - - master - - queue - - tip -+ - 'stable-*' - paths: - - '.github/workflows/rolling.yaml' - - '**.h' -@@ -15,6 +16,7 @@ on: - branches: - - master - - queue -+ - 'stable-*' - paths: - - '.github/workflows/rolling.yaml' - - '**.h' diff --git a/0034-RH-Remove-the-property-blacklist-exception-builtin.patch b/0006-RH-Remove-the-property-blacklist-exception-builtin.patch similarity index 100% rename from 0034-RH-Remove-the-property-blacklist-exception-builtin.patch rename to 0006-RH-Remove-the-property-blacklist-exception-builtin.patch diff --git a/0007-GitHub-Workflows-add-abi-check-for-stable-branches.patch b/0007-GitHub-Workflows-add-abi-check-for-stable-branches.patch deleted file mode 100644 index c19980f..0000000 --- a/0007-GitHub-Workflows-add-abi-check-for-stable-branches.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 14 Nov 2024 16:51:05 +0100 -Subject: [PATCH] GitHub Workflows: add abi check for stable branches - -The ABI should never change on a stable branch. This workflow -asserts that. - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/workflows/abi-stable.yaml | 89 +++++++++++++++++++++++++++++++ - 1 file changed, 89 insertions(+) - create mode 100644 .github/workflows/abi-stable.yaml - -diff --git a/.github/workflows/abi-stable.yaml b/.github/workflows/abi-stable.yaml -new file mode 100644 -index 00000000..a6746f23 ---- /dev/null -+++ b/.github/workflows/abi-stable.yaml -@@ -0,0 +1,89 @@ -+name: check-abi for stable branch -+on: -+ push: -+ branches: -+ - 'stable-*' -+ paths: -+ - '.github/workflows/abi-stable.yaml' -+ - '**.h' -+ - '**.c' -+ - '**.version' -+ pull_request: -+ branches: -+ - 'stable-*' -+ workflow_dispatch: -+ -+jobs: -+ reference-abi: -+ runs-on: ubuntu-20.04 -+ steps: -+ - name: get parent tag -+ run: > -+ echo ${{ github.ref }} | -+ sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV -+ - name: assert parent tag -+ run: /bin/false -+ if: ${{ env.PARENT_TAG == '' }} -+ - name: update -+ run: sudo apt-get update -+ - name: dependencies -+ run: > -+ sudo apt-get install --yes gcc -+ gcc make pkg-config abigail-tools -+ libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev -+ libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev -+ - name: checkout ${{ env.PARENT_TAG }} -+ uses: actions/checkout@v4 -+ with: -+ ref: ${{ env.PARENT_TAG }} -+ - name: build ABI for ${{ env.PARENT_TAG }} -+ run: make -j$(grep -c ^processor /proc/cpuinfo) -Orecurse abi -+ - name: save ABI -+ uses: actions/upload-artifact@v4 -+ with: -+ name: multipath-abi-${{ env.PARENT_TAG }} -+ path: abi -+ -+ check-abi: -+ runs-on: ubuntu-20.04 -+ needs: reference-abi -+ steps: -+ - name: get parent tag -+ run: > -+ echo ${{ github.ref }} | -+ sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV -+ - name: assert parent tag -+ run: /bin/false -+ if: ${{ env.PARENT_TAG == '' }} -+ - name: checkout ${{ env.PARENT_TAG }} -+ uses: actions/checkout@v4 -+ with: -+ ref: ${{ env.PARENT_TAG }} -+ - name: download ABI for ${{ env.PARENT_TAG }} -+ id: download_abi -+ uses: actions/download-artifact@v4 -+ with: -+ name: multipath-abi-${{ env.PARENT_TAG }} -+ path: reference-abi -+ - name: update -+ run: sudo apt-get update -+ if: steps.download_abi.outcome != 'success' -+ - name: dependencies -+ run: > -+ sudo apt-get install --yes gcc -+ gcc make pkg-config abigail-tools -+ libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev -+ libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev -+ - name: check ABI of ${{ github.ref }} against ${{ env.PARENT_TAG }} -+ id: check_abi -+ run: make -j$(grep -c ^processor /proc/cpuinfo) -Orecurse abi-test -+ continue-on-error: true -+ - name: save differences -+ if: ${{ steps.check_abi.outcome != 'success' }} -+ uses: actions/upload-artifact@v4 -+ with: -+ name: abi-test -+ path: abi-test -+ - name: fail -+ run: /bin/false -+ if: steps.check_abi.outcome != 'success' diff --git a/0035-RH-don-t-start-without-a-config-file.patch b/0007-RH-don-t-start-without-a-config-file.patch similarity index 96% rename from 0035-RH-don-t-start-without-a-config-file.patch rename to 0007-RH-don-t-start-without-a-config-file.patch index 8a3c5b6..edbc647 100644 --- a/0035-RH-don-t-start-without-a-config-file.patch +++ b/0007-RH-don-t-start-without-a-config-file.patch @@ -22,10 +22,10 @@ Signed-off-by: Benjamin Marzinski 7 files changed, 25 insertions(+) diff --git a/libmultipath/config.c b/libmultipath/config.c -index 226ddecb..588ae9ee 100644 +index 8b424d18..b8317f4d 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c -@@ -962,6 +962,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 226ddecb..588ae9ee 100644 conf->processed_main_config = 1; diff --git a/libmultipath/config.h b/libmultipath/config.h -index 94cdf252..534b6142 100644 +index 5b4ebf8c..2302eacc 100644 --- a/libmultipath/config.h +++ b/libmultipath/config.h @@ -10,6 +10,7 @@ @@ -112,7 +112,7 @@ index 7bc8806e..315884eb 100644 . .\" ---------------------------------------------------------------------------- diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in -index 646001e6..72e44849 100644 +index b6a25b31..3d957733 100644 --- a/multipathd/multipathd.service.in +++ b/multipathd/multipathd.service.in @@ -6,6 +6,7 @@ Wants=systemd-udevd-kernel.socket @MODPROBE_UNIT@ diff --git a/0036-RH-Fix-nvme-function-missing-argument.patch b/0008-RH-Fix-nvme-function-missing-argument.patch similarity index 100% rename from 0036-RH-Fix-nvme-function-missing-argument.patch rename to 0008-RH-Fix-nvme-function-missing-argument.patch diff --git a/0008-libmultipath-dm_get_maps-don-t-bail-out-for-single-m.patch b/0008-libmultipath-dm_get_maps-don-t-bail-out-for-single-m.patch deleted file mode 100644 index 88122b0..0000000 --- a/0008-libmultipath-dm_get_maps-don-t-bail-out-for-single-m.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Tue, 12 Nov 2024 13:06:10 +0100 -Subject: [PATCH] libmultipath: dm_get_maps(): don't bail out for single-map - failures - -dm_get_maps() traverses the entire list of dm maps. We shouldn't -give up just because probing a single map failed. - -Fixes: bf3a4ad ("libmultipath: simplify dm_get_maps()") -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - libmultipath/devmapper.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c -index c497c225..52bfe9ce 100644 ---- a/libmultipath/devmapper.c -+++ b/libmultipath/devmapper.c -@@ -1262,10 +1262,8 @@ int dm_get_maps(vector mp) - } - vector_set_slot(mp, mpp); - break; -- case DMP_NO_MATCH: -- break; - default: -- return 1; -+ break; - } - next = names->next; - names = (void *) names + next; diff --git a/0009-11-dm-mpath.rules.in-import-DM_COLDPLUG_SUSPENDED-on.patch b/0009-11-dm-mpath.rules.in-import-DM_COLDPLUG_SUSPENDED-on.patch deleted file mode 100644 index b380f75..0000000 --- a/0009-11-dm-mpath.rules.in-import-DM_COLDPLUG_SUSPENDED-on.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 31 Oct 2024 12:08:08 +0100 -Subject: [PATCH] 11-dm-mpath.rules.in: import DM_COLDPLUG_SUSPENDED only once - -We import DM_COLDPLUG_SUSPENDED in all code flows below mpath_coldplug_end. -Clarify this in the code. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index 30647b99..67838261 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -24,12 +24,13 @@ ENV{DM_UDEV_RULES_VSN}=="1|2", ENV{.DM_SUSPENDED}!="1", ENV{DISK_RO}!="1", \ - ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="", GOTO="scan_import" - LABEL="mpath_coldplug_end" - -+IMPORT{db}="DM_COLDPLUG_SUSPENDED" -+ - # If this uevent didn't come from dm, don't try to update the - # device state - # Note that .MPATH_DEVICE_READY_OLD=="" here. Thus we won't activate the - # device below at mpath_is_ready, which is correct. - ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \ -- IMPORT{db}="DM_COLDPLUG_SUSPENDED", \ - GOTO="check_mpath_ready" - - ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" -@@ -67,7 +68,6 @@ LABEL="check_mpath_unchanged" - # A previous coldplug event occurred while the device was suspended. - # Activation might have been partially skipped. Activate the device now, - # i.e. disable the MPATH_UNCHANGED logic and set DM_ACTIVATION=1. --IMPORT{db}="DM_COLDPLUG_SUSPENDED" - ENV{DM_COLDPLUG_SUSPENDED}=="1", ENV{.DM_SUSPENDED}!="1", \ - ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0", \ - PROGRAM="@SYSDIR_BIN@/logger -t 11-dm-mpath.rules -p daemon.notice \"Forcing activation of previously suspended device\"", \ diff --git a/0037-RH-use-rpm-optflags-if-present.patch b/0009-RH-use-rpm-optflags-if-present.patch similarity index 92% rename from 0037-RH-use-rpm-optflags-if-present.patch rename to 0009-RH-use-rpm-optflags-if-present.patch index 66d14bc..1b96a3a 100644 --- a/0037-RH-use-rpm-optflags-if-present.patch +++ b/0009-RH-use-rpm-optflags-if-present.patch @@ -7,14 +7,13 @@ Use the passed in optflags when compiling as an RPM, and keep the default flags as close as possible to the current fedora flags, while still being generic. -Co-authored-by: Yaakov Selkowitz Signed-off-by: Benjamin Marzinski --- Makefile.inc | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Makefile.inc b/Makefile.inc -index 81cb61d2..a5024bb7 100644 +index c225a1ed..7774f1f4 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -99,28 +99,39 @@ SYSTEMD_LIBDEPS := $(if $(SYSTEMD),$(if $(shell test $(SYSTEMD) -gt 209 && echo @@ -53,9 +52,9 @@ index 81cb61d2..a5024bb7 100644 -DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \ -DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" -DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \ -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP --CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \ +-CFLAGS := -std=$(C_STD) $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \ - -fexceptions -+CFLAGS := -std=gnu11 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe ++CFLAGS := -std=$(C_STD) $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe BIN_CFLAGS := -fPIE -DPIE LIB_CFLAGS := -fPIC SHARED_FLAGS := -shared diff --git a/0010-11-dm-mpath.rules.in-handle-inactive-suspended-devic.patch b/0010-11-dm-mpath.rules.in-handle-inactive-suspended-devic.patch deleted file mode 100644 index f34e699..0000000 --- a/0010-11-dm-mpath.rules.in-handle-inactive-suspended-devic.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 31 Oct 2024 12:59:03 +0100 -Subject: [PATCH] 11-dm-mpath.rules.in: handle inactive suspended devices - correctly - -Since b22c273 ("11-dm-mpath.rules: Don't force activation while device is -suspended"), we've handled the case where a device is suspended while -an uevent is processed (e.g. because multipathd is reloading the -map again at the same time). But we were missing the case where -The device had never been initialized before. If .MPATH_DEVICE_READY_OLD -was empty, we'd jump to scan_import without setting MPATH_DEVICE_READY -to 0. This can cause a device not to be fully activated at boot time, -because in follow-up uevents we'd assume that the device had already -been set up. - -Treat the case in which an uevent is processed for a previously not -fully set-up, suspended device like other situations where we set -MPATH_DEVICE_READY to 0. - -Fixes: b22c273 ("11-dm-mpath.rules: Don't force activation while device is -suspended") -Reviewed-by: Benjamin Marzinski - -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index 67838261..20f8c6ac 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -35,6 +35,13 @@ ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \ - - ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" - -+# If the device wasn't ready previously and is currently suspended, -+# we have to postpone the activation until the next event. -+# In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the -+# MPATH_UNCHANGED logic will cause later rules to skipped in the next event. -+ENV{.MPATH_DEVICE_READY_OLD}!="1", ENV{.DM_SUSPENDED}=="1", \ -+ ENV{MPATH_DEVICE_READY}="0", GOTO="check_mpath_unchanged" -+ - # multipath sets DM_SUBSYSTEM_UDEV_FLAG2 when it reloads a - # table with no active devices. If this happens, mark the - # device not ready -@@ -106,14 +113,10 @@ GOTO="scan_import" - LABEL="mpath_is_ready" - - # If the device comes back online, set DM_ACTIVATION so that --# upper layers do a rescan. If the device is currently suspended, --# we have to postpone the activation until the next event. --# In this case, we have to set MPATH_DEVICE_READY=0; otherwise, the --# MPATH_UNCHANGED logic will cause later rules to skipped in the next event. --ENV{.MPATH_DEVICE_READY_OLD}!="0", GOTO="scan_import" --ENV{.DM_SUSPENDED}=="1", ENV{MPATH_DEVICE_READY}="0", GOTO="scan_import" -- --ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" -+# upper layers will do a rescan. Don't do this if .MPATH_DEVICE_READY_OLD -+# is just empty (see comment above the DM_COOKIE test above). -+ENV{.MPATH_DEVICE_READY_OLD}=="0", \ -+ ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" - - # The code to check multipath state ends here. We need to set - # properties and symlinks regardless whether the map is usable or diff --git a/0038-RH-add-mpathconf.patch b/0010-RH-add-mpathconf.patch similarity index 99% rename from 0038-RH-add-mpathconf.patch rename to 0010-RH-add-mpathconf.patch index 103ca55..c587841 100644 --- a/0038-RH-add-mpathconf.patch +++ b/0010-RH-add-mpathconf.patch @@ -23,10 +23,10 @@ Signed-off-by: Benjamin Marzinski create mode 100644 multipath/mpathconf.8 diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt -index 4ac57510..3602a071 100644 +index 7843c380..ab5259cf 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt -@@ -126,9 +126,11 @@ Marzinski +@@ -127,9 +127,11 @@ Marzinski misdetection mpath mpathb @@ -38,7 +38,7 @@ index 4ac57510..3602a071 100644 multipathc multipathd multipathed -@@ -146,6 +148,7 @@ ontap +@@ -147,6 +149,7 @@ ontap OOM opensvc OPTFLAGS @@ -47,10 +47,10 @@ index 4ac57510..3602a071 100644 partx pathgroup diff --git a/libmultipath/config.c b/libmultipath/config.c -index 588ae9ee..3cb8449c 100644 +index b8317f4d..0bbaa981 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c -@@ -964,6 +964,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."); diff --git a/0011-11-dm-mpath.rules.in-clarify-DM_ACTIVATION-logic.patch b/0011-11-dm-mpath.rules.in-clarify-DM_ACTIVATION-logic.patch deleted file mode 100644 index cb129bf..0000000 --- a/0011-11-dm-mpath.rules.in-clarify-DM_ACTIVATION-logic.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 31 Oct 2024 13:11:21 +0100 -Subject: [PATCH] 11-dm-mpath.rules.in: clarify DM_ACTIVATION logic - -Our code is always setting MPATH_UNCHANGED and DM_ACTIVATION in -pairs. While DM_ACTIVATION is a global DM property, MPATH_UNCHANGED -is owned by us. Just set MPATH_UNCHANGED, and adapt DM_ACTIVATION -when necessary just in one place. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 21 ++++++++++++--------- - 1 file changed, 12 insertions(+), 9 deletions(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index 20f8c6ac..a2655cb2 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -74,25 +74,25 @@ LABEL="check_mpath_unchanged" - - # A previous coldplug event occurred while the device was suspended. - # Activation might have been partially skipped. Activate the device now, --# i.e. disable the MPATH_UNCHANGED logic and set DM_ACTIVATION=1. -+# i.e. disable the MPATH_UNCHANGED logic. - ENV{DM_COLDPLUG_SUSPENDED}=="1", ENV{.DM_SUSPENDED}!="1", \ -- ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0", \ -+ ENV{MPATH_UNCHANGED}="0", \ - PROGRAM="@SYSDIR_BIN@/logger -t 11-dm-mpath.rules -p daemon.notice \"Forcing activation of previously suspended device\"", \ - GOTO="check_mpath_ready" - - # DM_SUBSYSTEM_UDEV_FLAG0 is the "RELOAD" flag for multipath subsystem. --# Drop the DM_ACTIVATION flag here as mpath reloads tables if any of its -+# Set the MPATH_UNCHANGED flag here as mpath reloads tables if any of its - # paths are lost/recovered. For any stack above the mpath device, this is not - # something that should be reacted upon since it would be useless extra work. - # It's exactly mpath's job to provide *seamless* device access to any of the - # paths that are available underneath. - ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", \ -- ENV{DM_ACTIVATION}="0", ENV{MPATH_UNCHANGED}="1" -+ ENV{MPATH_UNCHANGED}="1" - --# For path failed or reinstated events, unset DM_ACTIVATION. -+# For path failed or reinstated events, set MPATH_UNCHANGED. - # This is similar to the DM_SUBSYSTEM_UDEV_FLAG0 case above. - ENV{DM_ACTION}=="PATH_FAILED|PATH_REINSTATED", \ -- ENV{DM_ACTIVATION}="0", ENV{MPATH_UNCHANGED}="1" -+ ENV{MPATH_UNCHANGED}="1" - - LABEL="check_mpath_ready" - -@@ -112,11 +112,10 @@ GOTO="scan_import" - - LABEL="mpath_is_ready" - --# If the device comes back online, set DM_ACTIVATION so that -+# If the device comes back online, clear MPATH_UNCHANGED so that - # upper layers will do a rescan. Don't do this if .MPATH_DEVICE_READY_OLD - # is just empty (see comment above the DM_COOKIE test above). --ENV{.MPATH_DEVICE_READY_OLD}=="0", \ -- ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" -+ENV{.MPATH_DEVICE_READY_OLD}=="0", ENV{MPATH_UNCHANGED}="0" - - # The code to check multipath state ends here. We need to set - # properties and symlinks regardless whether the map is usable or -@@ -146,6 +145,10 @@ IMPORT{db}="ID_PART_GPT_AUTO_ROOT" - - LABEL="import_end" - -+# If MPATH_UNCHANGED is set, adapt DM_ACTIVATION. -+ENV{MPATH_UNCHANGED}=="0", ENV{DM_ACTIVATION}="1" -+ENV{MPATH_UNCHANGED}=="1", ENV{DM_ACTIVATION}="0" -+ - # Reset previous DM_COLDPLUG_SUSPENDED if activation happens now - ENV{.DM_SUSPENDED}!="1", ENV{DM_ACTIVATION}=="1", ENV{DM_COLDPLUG_SUSPENDED}="" - diff --git a/0039-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch b/0011-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch similarity index 97% rename from 0039-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch rename to 0011-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch index 4e781fa..612d876 100644 --- a/0039-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +++ b/0011-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch @@ -138,14 +138,14 @@ index b88e9a4c..edd742aa 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 72e44849..69a6c39d 100644 +index 3d957733..7ef6e99e 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=-@BINDIR@/multipath -A ExecStart=@BINDIR@/multipathd -d -s ExecReload=@BINDIR@/multipathd reconfigure - TasksMax=infinity + Restart=on-failure diff --git a/0012-11-dm-mpath-rules.in-skip-one-.DM_NOSCAN-check.patch b/0012-11-dm-mpath-rules.in-skip-one-.DM_NOSCAN-check.patch deleted file mode 100644 index cb1620a..0000000 --- a/0012-11-dm-mpath-rules.in-skip-one-.DM_NOSCAN-check.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Sun, 3 Nov 2024 23:04:08 +0100 -Subject: [PATCH] 11-dm-mpath-rules.in: skip one .DM_NOSCAN check - -We set .DM_NOSCAN above where we set DM_UDEV_DISABLE_OTHER_RULES_FLAG, too. If -the latter isn't set, .DM_NOSCAN can't be set. Skip the redundant test. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index a2655cb2..79227bec 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -132,7 +132,7 @@ ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="import_end" - ENV{DM_UDEV_RULES_VSN}!="1|2", GOTO="import_end" - - # Don't import the properties from db if we will run blkid later. --ENV{.DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end" - - IMPORT{db}="ID_FS_TYPE" - IMPORT{db}="ID_FS_USAGE" diff --git a/0040-RH-reset-default-find_mutipaths-value-to-off.patch b/0012-RH-reset-default-find_mutipaths-value-to-off.patch similarity index 100% rename from 0040-RH-reset-default-find_mutipaths-value-to-off.patch rename to 0012-RH-reset-default-find_mutipaths-value-to-off.patch diff --git a/0013-11-dm-mpath.rules.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch b/0013-11-dm-mpath.rules.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch deleted file mode 100644 index 36cd91d..0000000 --- a/0013-11-dm-mpath.rules.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Sun, 3 Nov 2024 23:07:23 +0100 -Subject: [PATCH] 11-dm-mpath.rules.in: set .DM_NOSCAN if MPATH_UNCHANGED is - set - -When multipath reloads a device or fails or restores a path, the udev -rules disable LVM scanning, but since .DM_NOSCAN isn't set, blkid is -still run on the device. When multipath devices that are set to -queue_if_no_path lose all their paths at close to the same time, udev -workers can hang trying to run blkid. The blkid results shouldn't -change when multipathd is adding, removing, failing or reinstating -paths, aside from avoiding hanging udev processes, we're skipping -unnecessary work. - -Hence, set .DM_NOSCAN if MPATH_UNCHANGED is set, to avoid blkid from -being called in 13-dm.rules. - -Suggested-by: Benjamin Marzinski -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - multipath/11-dm-mpath.rules.in | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in -index 79227bec..a816edbf 100644 ---- a/multipath/11-dm-mpath.rules.in -+++ b/multipath/11-dm-mpath.rules.in -@@ -145,9 +145,11 @@ IMPORT{db}="ID_PART_GPT_AUTO_ROOT" - - LABEL="import_end" - --# If MPATH_UNCHANGED is set, adapt DM_ACTIVATION. -+# If MPATH_UNCHANGED is set, adapt DM_ACTIVATION and DM_NOSCAN. -+# .DM_NOSCAN controls whether blkid will be run in 13-dm-disk.rules; -+# we don't want to do that if MPATH_UNCHANGED is 1. - ENV{MPATH_UNCHANGED}=="0", ENV{DM_ACTIVATION}="1" --ENV{MPATH_UNCHANGED}=="1", ENV{DM_ACTIVATION}="0" -+ENV{MPATH_UNCHANGED}=="1", ENV{DM_ACTIVATION}="0", ENV{.DM_NOSCAN}="1" - - # Reset previous DM_COLDPLUG_SUSPENDED if activation happens now - ENV{.DM_SUSPENDED}!="1", ENV{DM_ACTIVATION}=="1", ENV{DM_COLDPLUG_SUSPENDED}="" diff --git a/0041-RH-attempt-to-get-ANA-info-via-sysfs-first.patch b/0013-RH-attempt-to-get-ANA-info-via-sysfs-first.patch similarity index 100% rename from 0041-RH-attempt-to-get-ANA-info-via-sysfs-first.patch rename to 0013-RH-attempt-to-get-ANA-info-via-sysfs-first.patch diff --git a/0042-RH-make-parse_vpd_pg83-match-scsi_id-output.patch b/0014-RH-make-parse_vpd_pg83-match-scsi_id-output.patch similarity index 94% rename from 0042-RH-make-parse_vpd_pg83-match-scsi_id-output.patch rename to 0014-RH-make-parse_vpd_pg83-match-scsi_id-output.patch index 0d5baa3..3243375 100644 --- a/0042-RH-make-parse_vpd_pg83-match-scsi_id-output.patch +++ b/0014-RH-make-parse_vpd_pg83-match-scsi_id-output.patch @@ -14,10 +14,10 @@ Signed-off-by: Benjamin Marzinski 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c -index 5043330c..e14507e8 100644 +index b5851561..a3cc6e83 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c -@@ -1221,13 +1221,9 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, +@@ -1219,13 +1219,9 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, good_len = 8; break; case 2: @@ -33,7 +33,7 @@ index 5043330c..e14507e8 100644 good_len = 8; break; default: -@@ -1245,10 +1241,6 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, +@@ -1243,10 +1239,6 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, break; case 0x8: /* SCSI Name: Prio 3 */ diff --git a/0014-libmultipath-don-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch b/0014-libmultipath-don-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch deleted file mode 100644 index b7ae3c4..0000000 --- a/0014-libmultipath-don-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 7 Nov 2024 22:07:03 +0100 -Subject: [PATCH] libmultipath: don't set dev_loss_tmo to 0 for - NO_PATH_RETRY_FAIL - -If pp->dev_loss is DEV_LOSS_TMO_UNSET and min_dev_loss is 0 (which is -the case if no_path_retry is NO_PATH_RETRY_FAIL or NO_PATH_RETRY_UNDEF), -we will set pp->dev_loss to 0, which is wrong. Fix it. - -Fixes: 058b5f5 ("libmultipath: fix dev_loss_tmo even if not set in configuration") -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmultipath/discovery.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c -index e94705bf..5043330c 100644 ---- a/libmultipath/discovery.c -+++ b/libmultipath/discovery.c -@@ -942,7 +942,7 @@ sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp) - continue; - } - -- if (pp->dev_loss == DEV_LOSS_TMO_UNSET) -+ if (pp->dev_loss == DEV_LOSS_TMO_UNSET && min_dev_loss != 0) - pp->dev_loss = min_dev_loss; - else if (pp->dev_loss < min_dev_loss) { - pp->dev_loss = min_dev_loss; diff --git a/0043-RH-add-scsi-device-handlers-to-modules-load.d.patch b/0015-RH-add-scsi-device-handlers-to-modules-load.d.patch similarity index 96% rename from 0043-RH-add-scsi-device-handlers-to-modules-load.d.patch rename to 0015-RH-add-scsi-device-handlers-to-modules-load.d.patch index ef0ee42..97fb4df 100644 --- a/0043-RH-add-scsi-device-handlers-to-modules-load.d.patch +++ b/0015-RH-add-scsi-device-handlers-to-modules-load.d.patch @@ -11,7 +11,7 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc -index a5024bb7..834b63b9 100644 +index 7774f1f4..0e836f0a 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -16,7 +16,7 @@ READLINE := diff --git a/0015-multipathd-fix-deferred_failback_tick-for-reload-rem.patch b/0015-multipathd-fix-deferred_failback_tick-for-reload-rem.patch deleted file mode 100644 index f775e85..0000000 --- a/0015-multipathd-fix-deferred_failback_tick-for-reload-rem.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Mon, 14 Oct 2024 23:28:30 -0400 -Subject: [PATCH] multipathd: fix deferred_failback_tick for reload removes - -If reload_and_sync_map() removes the multipath device, -deferred_failback_tick() needs to decrement the counter so that it -doesn't skip the following device. - -Reviewed-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - multipathd/main.c | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/multipathd/main.c b/multipathd/main.c -index 1b7fd04f..e4ef9a1d 100644 ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -2080,9 +2080,12 @@ deferred_failback_tick (struct vectors *vecs) - - if (!mpp->failback_tick && - need_switch_pathgroup(mpp, &need_reload)) { -- if (need_reload) -- reload_and_sync_map(mpp, vecs); -- else -+ if (need_reload) { -+ if (reload_and_sync_map(mpp, vecs) == 2) { -+ /* multipath device removed */ -+ i--; -+ } -+ } else - switch_pathgroup(mpp); - } - } diff --git a/0044-RH-compile-with-libreadline-support.patch b/0016-RH-compile-with-libreadline-support.patch similarity index 96% rename from 0044-RH-compile-with-libreadline-support.patch rename to 0016-RH-compile-with-libreadline-support.patch index 50781c3..e7579b0 100644 --- a/0044-RH-compile-with-libreadline-support.patch +++ b/0016-RH-compile-with-libreadline-support.patch @@ -12,7 +12,7 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc -index 834b63b9..c482a181 100644 +index 0e836f0a..e1d3fcd1 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -12,7 +12,7 @@ diff --git a/0016-multipathd-fix-an-unsigned-int-ovwerflow.patch b/0016-multipathd-fix-an-unsigned-int-ovwerflow.patch deleted file mode 100644 index 12c9a51..0000000 --- a/0016-multipathd-fix-an-unsigned-int-ovwerflow.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 13 Nov 2024 16:19:49 +0100 -Subject: [PATCH] multipathd: fix an unsigned int ovwerflow - -Reported by coverity: "i--" may cause an underflow, which will again -cause an overflow when the loop continues. Use a signed int for -loops like this to make coverity happy. - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - multipathd/main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/multipathd/main.c b/multipathd/main.c -index e4ef9a1d..3fb623fd 100644 ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -2068,7 +2068,7 @@ static void - deferred_failback_tick (struct vectors *vecs) - { - struct multipath * mpp; -- unsigned int i; -+ int i; - bool need_reload; - - vector_foreach_slot (vecs->mpvec, mpp, i) { diff --git a/0045-RH-Add-mpathcleanup.patch b/0017-RH-Add-mpathcleanup.patch similarity index 100% rename from 0045-RH-Add-mpathcleanup.patch rename to 0017-RH-Add-mpathcleanup.patch diff --git a/0017-libmpathutil-avoid-Wcast-function-type-mismatch-erro.patch b/0017-libmpathutil-avoid-Wcast-function-type-mismatch-erro.patch deleted file mode 100644 index 64b90d7..0000000 --- a/0017-libmpathutil-avoid-Wcast-function-type-mismatch-erro.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 6 Nov 2024 22:17:16 +0100 -Subject: [PATCH] libmpathutil: avoid -Wcast-function-type-mismatch error with - clang 19 - -Avoid the following error with clang 19: - -msort.c:268:27: error: cast from '__compar_fn_t' (aka 'int (*)(const void *, const void *)') to '__compar_d_fn_t' (aka 'int (*)(const void *, const void *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch] - 268 | return msort_r (b, n, s, (__compar_d_fn_t)cmp, NULL); - | ^~~~~~~~~~~~~~~~~~~~ - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - libmpathutil/msort.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/libmpathutil/msort.c b/libmpathutil/msort.c -index 50f799d9..9df7b267 100644 ---- a/libmpathutil/msort.c -+++ b/libmpathutil/msort.c -@@ -259,9 +259,12 @@ msort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, void *arg) - * If this is safe for them, it should be for us, too. - */ - #pragma GCC diagnostic push --#if __GNUC__ >= 8 -+#if __GNUC__ >= 8 || __clang_major__ >= 19 - #pragma GCC diagnostic ignored "-Wcast-function-type" - #endif -+#if __clang_major__ >= 19 -+#pragma GCC diagnostic ignored "-Wcast-function-type-mismatch" -+#endif - void - msort (void *b, size_t n, size_t s, __compar_fn_t cmp) - { diff --git a/0018-Update-NEWS.md-for-0.10.1.patch b/0018-Update-NEWS.md-for-0.10.1.patch deleted file mode 100644 index 601b6e5..0000000 --- a/0018-Update-NEWS.md-for-0.10.1.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 14 Nov 2024 17:59:14 +0100 -Subject: [PATCH] Update NEWS.md for 0.10.1 - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - NEWS.md | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/NEWS.md b/NEWS.md -index 69acda47..b740efb1 100644 ---- a/NEWS.md -+++ b/NEWS.md -@@ -1,5 +1,28 @@ - # multipath-tools Release Notes - -+## multipath-tools 0.10.1, 2024/11 -+ -+This is the first bug fix release on the `stable-0.10.y` branch. It contains -+bug fixes from 0.11.0, and some CI-related fixes. -+ -+### Bug fixes -+ -+* Fixed the problem that multipathd wouldn't start on systems with certain types -+ of device mapper devices, in particular devices with multiple DM targets. -+ The problem was introduced in 0.10.0. -+ Fixes [#102](https://github.com/opensvc/multipath-tools/issues/102). -+* Fixed a corner case in the udev rules which could cause a device not to be -+ activated during boot if a cold plug uevent is processed for a previously -+ not configured multipath map while this map was suspended. This problem existed -+ since 0.9.8. -+* Fixed the problem that devices with `no_path_retry fail` and no setting -+ for `dev_loss_tmo` might get the `dev_loss_tmo` set to 0, causing the -+ device to be deleted immediately in the event of a transport disruption. -+ This bug was introduced in 0.9.6. -+* Fixed the problem that, if there were multiple maps with deferred failback -+ (`failback` value > 0 in `multipath.conf`), some maps might fail back later -+ than configured. The problem existed since 0.9.6. -+ - ## multipath-tools 0.10.0, 2024/08 - - ### User-Visible Changes diff --git a/0019-libmultipath-don-t-print-error-message-if-WATCHDOG_U.patch b/0019-libmultipath-don-t-print-error-message-if-WATCHDOG_U.patch deleted file mode 100644 index 18fb614..0000000 --- a/0019-libmultipath-don-t-print-error-message-if-WATCHDOG_U.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 14 Nov 2024 15:20:24 +0100 -Subject: [PATCH] libmultipath: don't print error message if WATCHDOG_USEC is 0 - -WATCHDOG_USEC may be set to 0, which means that the watchdog -is disabled in systemd. - -Fixes: 9366cfb ("multipathd: Implement systemd watchdog integration") -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmultipath/config.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/libmultipath/config.c b/libmultipath/config.c -index 0e3a5cc1..226ddecb 100644 ---- a/libmultipath/config.c -+++ b/libmultipath/config.c -@@ -865,6 +865,9 @@ static void set_max_checkint_from_watchdog(struct config *conf) - unsigned long checkint; - - if (envp && sscanf(envp, "%lu", &checkint) == 1) { -+ if (checkint == 0) -+ /* watchdog disabled */ -+ return; - /* Value is in microseconds */ - checkint /= 1000000; - if (checkint < 1 || checkint > UINT_MAX) { diff --git a/0020-libmultipath-reduce-log-level-of-map-X-has-multiple-.patch b/0020-libmultipath-reduce-log-level-of-map-X-has-multiple-.patch deleted file mode 100644 index 7467627..0000000 --- a/0020-libmultipath-reduce-log-level-of-map-X-has-multiple-.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Mon, 25 Nov 2024 18:01:32 +0100 -Subject: [PATCH] libmultipath: reduce log level of "map X has multiple - targets" - -On systems with LVM volumes, "multipath -ll" will spit out lots of messages -like - - libmp_mapinfo: map vg-lv0 has multiple targets - -which is irritating. Reduce the log level of these messages to 3, as they -are harmless most of the time. - -This is a backport of e8949c2 ("libmultipath: reduce log level of -libmp_mapinfo() messages") from the master branch. We can't apply exactly -the same fix because the stable branch is missing 8c772d3 ("libmultipath: -check DM UUID earlier in libmp_mapinfo__"). - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - libmultipath/devmapper.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c -index 52bfe9ce..fe5637b3 100644 ---- a/libmultipath/devmapper.c -+++ b/libmultipath/devmapper.c -@@ -718,7 +718,7 @@ static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma - if (info.target || info.status || info.size || flags & MAPINFO_TGT_TYPE__) { - if (dm_get_next_target(dmt, NULL, &start, &length, - &target_type, ¶ms) != NULL) { -- condlog(2, "%s: map %s has multiple targets", fname__, map_id); -+ condlog(3, "%s: map %s has multiple targets", fname__, map_id); - return DMP_NOT_FOUND; - } - if (!params) { diff --git a/0021-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch b/0021-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch deleted file mode 100644 index 2610c6d..0000000 --- a/0021-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Wed, 8 Jan 2025 19:06:53 -0500 -Subject: [PATCH] libmultipath/foreign: fix memory leak in nvme foreign handler - -_find_controllers() needs to free the udev device if it doesn't get -added to a path. Otherwise it can leak memory whenever check_foreign() -is called, causing multipathd's memory usage to continually grow. - -Fixes: 7b47762 ("libmultipath: nvme: fix path detection for kernel 4.16") -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -(cherry picked from commit 5a3d334e416a4a35ee88d7b8f1433ff7f57923ad) ---- - libmultipath/foreign/nvme.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c -index 0b7f4eab..cde660ce 100644 ---- a/libmultipath/foreign/nvme.c -+++ b/libmultipath/foreign/nvme.c -@@ -675,7 +675,8 @@ static void _find_controllers(struct context *ctx, struct nvme_map *map) - pthread_cleanup_push_cast(free_scandir_result, &sr); - for (i = 0; i < r; i++) { - char *fn = di[i]->d_name; -- struct udev_device *ctrl, *udev; -+ struct udev_device *ctrl; -+ struct udev_device *udev __attribute__((cleanup(cleanup_udev_device))) = NULL; - - if (safe_snprintf(pathbuf + n, sizeof(pathbuf) - n, "/%s", fn)) - continue; -@@ -719,11 +720,11 @@ static void _find_controllers(struct context *ctx, struct nvme_map *map) - continue; - - path->gen.ops = &nvme_path_ops; -- path->udev = udev; -+ path->udev = steal_ptr(udev); - path->seen = true; - path->map = map; - path->ctl = udev_device_get_parent_with_subsystem_devtype -- (udev, "nvme", NULL); -+ (path->udev, "nvme", NULL); - if (path->ctl == NULL) { - condlog(1, "%s: %s: failed to get controller for %s", - __func__, THIS, fn); -@@ -744,7 +745,7 @@ static void _find_controllers(struct context *ctx, struct nvme_map *map) - } - vector_set_slot(&map->pgvec, &path->pg); - condlog(3, "%s: %s: new path %s added to %s", -- __func__, THIS, udev_device_get_sysname(udev), -+ __func__, THIS, udev_device_get_sysname(path->udev), - udev_device_get_sysname(map->udev)); - } - pthread_cleanup_pop(1); diff --git a/0022-libmultipath-add-condition-for-enqueueing-path-to-io.patch b/0022-libmultipath-add-condition-for-enqueueing-path-to-io.patch deleted file mode 100644 index cf8d80a..0000000 --- a/0022-libmultipath-add-condition-for-enqueueing-path-to-io.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: chenrenhui -Date: Fri, 10 Jan 2025 14:38:16 +0800 -Subject: [PATCH] libmultipath: add condition for enqueueing path to io error - check - -In function io_err_stat_handle_pathfail(), path->io_err_dis_reinstate_time -is set to 0 to enqueue path to io error check as soon as possible. But -multipathd can not do it within marginal_path_err_recheck_gap_time seconds -after power-on, because curr_time is less than -marginal_path_err_recheck_gap_time. - -To handle the early marginal path, we can enqueue path when -io_err_dis_reinstate_time is 0. - -Signed-off-by: chenrenhui -Reviewed-by: Benjamin Marzinski -Reviewed-by: Martin Wilck - -> - -(cherry picked from commit a1e3cf2d42cc4bab10753e466c8adb7efa83c99e) -Signed-off-by: Benjamin Marzinski ---- - libmultipath/io_err_stat.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c -index 4996c0b0..879c310a 100644 ---- a/libmultipath/io_err_stat.c -+++ b/libmultipath/io_err_stat.c -@@ -367,7 +367,8 @@ int need_io_err_check(struct path *pp) - return 1; - get_monotonic_time(&curr_time); - if ((curr_time.tv_sec - pp->io_err_dis_reinstate_time) > -- pp->mpp->marginal_path_err_recheck_gap_time) { -+ pp->mpp->marginal_path_err_recheck_gap_time || -+ pp->io_err_dis_reinstate_time == 0) { - io_err_stat_log(4, "%s: reschedule checking after %d seconds", - pp->dev, - pp->mpp->marginal_path_err_recheck_gap_time); diff --git a/0023-Additional-NEWS.md-updates-for-0.10.1.patch b/0023-Additional-NEWS.md-updates-for-0.10.1.patch deleted file mode 100644 index 1093bd0..0000000 --- a/0023-Additional-NEWS.md-updates-for-0.10.1.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 17 Jan 2025 22:38:26 +0100 -Subject: [PATCH] Additional NEWS.md updates for 0.10.1 - -Signed-off-by: Benjamin Marzinski ---- - .github/actions/spelling/expect.txt | 4 ++-- - NEWS.md | 8 ++++++++ - 2 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt -index 934f582e..000d5ebb 100644 ---- a/.github/actions/spelling/expect.txt -+++ b/.github/actions/spelling/expect.txt -@@ -184,7 +184,6 @@ sas - sbp - scsi - sda --sdc - setmarginal - setprkey - setprstatus -@@ -205,11 +204,11 @@ suse - svg - switchgroup - sys -+SYSDIR - sysfs - sysinit - tcp - terabytes --SYSDIR - TESTDEPS - testname - tgill -@@ -231,6 +230,7 @@ unsetprkey - unsetprstatus - unspec - usb -+USEC - userdata - userspace - usr -diff --git a/NEWS.md b/NEWS.md -index b740efb1..3c51553e 100644 ---- a/NEWS.md -+++ b/NEWS.md -@@ -22,6 +22,14 @@ bug fixes from 0.11.0, and some CI-related fixes. - * Fixed the problem that, if there were multiple maps with deferred failback - (`failback` value > 0 in `multipath.conf`), some maps might fail back later - than configured. The problem existed since 0.9.6. -+* Removed a warning message that multipathd would print if systemd's -+ `WATCHDOG_USEC` environment variable had the value "0", which means that the -+ watchdog is simply disabled. This (minor) problem existed since 0.4.9. -+* Fixed a memory leak in the nvme foreign library. The bug existed since -+ 0.7.8. -+* Fixed a problem in the marginal path detection algorithm that could cause -+ the io error check for a recently failed path to be delayed. This bug -+ existed since 0.7.4. - - ## multipath-tools 0.10.0, 2024/08 - diff --git a/0024-libmultipath-fix-handling-of-pp-pgindex.patch b/0024-libmultipath-fix-handling-of-pp-pgindex.patch deleted file mode 100644 index a9da346..0000000 --- a/0024-libmultipath-fix-handling-of-pp-pgindex.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Mon, 25 Nov 2024 13:11:07 +0100 -Subject: [PATCH] libmultipath: fix handling of pp->pgindex - -pp->pgindex is set in disassemble_map() when a map is parsed. -There are various possiblities for this index to become invalid. -pp->pgindex is only used in enable_group() and followover_should_fallback(), -and both callers take no action if it is 0, which is the right -thing to do if we don't know the path's pathgroup. - -Make sure pp->pgindex is reset to 0 in various places: -- when it's orphaned, -- before (re)grouping paths, -- when we detect a bad mpp assignment in update_pathvec_from_dm(). -- when a pathgroup is deleted in update_pathvec_from_dm(). In this - case, pgindex needs to be invalidated for all paths in all pathgroups - after the one that was deleted. - -The hunk in group_paths is mostly redundant with the hunk in free_pgvec(), but -because we're looping over pg->paths in the former and over pg->pgp in -the latter, I think it's better too play safe. - -Fixes: 99db1bd ("[multipathd] re-enable disabled PG when at least one path is up") -Fixes: https://github.com/opensvc/multipath-tools/issues/105 -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -(cherry picked from commit cd912cffa2797a18c47426c816afa8eb2eae5b22) -(cherry picked from commit 714c20bebba6911255a527d937e7a62764ffe338) -Signed-off-by: Benjamin Marzinski ---- - libmultipath/pgpolicies.c | 6 ++++++ - libmultipath/structs.c | 12 +++++++++++- - libmultipath/structs_vec.c | 15 +++++++++++++++ - 3 files changed, 32 insertions(+), 1 deletion(-) - -diff --git a/libmultipath/pgpolicies.c b/libmultipath/pgpolicies.c -index edc3c611..23ef2bdc 100644 ---- a/libmultipath/pgpolicies.c -+++ b/libmultipath/pgpolicies.c -@@ -127,6 +127,8 @@ fail: - int group_paths(struct multipath *mp, int marginal_pathgroups) - { - vector normal, marginal; -+ struct path *pp; -+ int i; - - if (!mp->pg) - mp->pg = vector_alloc(); -@@ -138,6 +140,10 @@ int group_paths(struct multipath *mp, int marginal_pathgroups) - if (!mp->pgpolicyfn) - goto fail; - -+ /* Reset pgindex, we're going to invalidate it */ -+ vector_foreach_slot(mp->paths, pp, i) -+ pp->pgindex = 0; -+ - if (!marginal_pathgroups || - split_marginal_paths(mp->paths, &normal, &marginal) != 0) { - if (mp->pgpolicyfn(mp, mp->paths) != 0) -diff --git a/libmultipath/structs.c b/libmultipath/structs.c -index 61c8f32c..48517252 100644 ---- a/libmultipath/structs.c -+++ b/libmultipath/structs.c -@@ -239,8 +239,18 @@ free_pgvec (vector pgvec, enum free_path_mode free_paths) - if (!pgvec) - return; - -- vector_foreach_slot(pgvec, pgp, i) -+ vector_foreach_slot(pgvec, pgp, i) { -+ -+ /* paths are going to be re-grouped, reset pgindex */ -+ if (free_paths != FREE_PATHS) { -+ struct path *pp; -+ int j; -+ -+ vector_foreach_slot(pgp->paths, pp, j) -+ pp->pgindex = 0; -+ } - free_pathgroup(pgp, free_paths); -+ } - - vector_free(pgvec); - } -diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index 5df495b3..9dc5a5ca 100644 ---- a/libmultipath/structs_vec.c -+++ b/libmultipath/structs_vec.c -@@ -108,6 +108,7 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, - struct config *conf; - bool mpp_has_wwid; - bool must_reload = false; -+ bool pg_deleted = false; - - if (!mpp->pg) - return false; -@@ -125,6 +126,10 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, - - vector_foreach_slot(pgp->paths, pp, j) { - -+ /* A pathgroup has been deleted before. Invalidate pgindex */ -+ if (pg_deleted) -+ pp->pgindex = 0; -+ - if (pp->mpp && pp->mpp != mpp) { - condlog(0, "BUG: %s: found path %s which is already in %s", - mpp->alias, pp->dev, pp->mpp->alias); -@@ -139,6 +144,13 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, - must_reload = true; - dm_fail_path(mpp->alias, pp->dev_t); - vector_del_slot(pgp->paths, j--); -+ /* -+ * pp->pgindex has been set in disassemble_map(), -+ * which has probably been called just before for -+ * mpp. So he pgindex relates to mpp and may be -+ * wrong for pp->mpp. Invalidate it. -+ */ -+ pp->pgindex = 0; - continue; - } - pp->mpp = mpp; -@@ -237,6 +249,8 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, - vector_del_slot(mpp->pg, i--); - free_pathgroup(pgp, KEEP_PATHS); - must_reload = true; -+ /* Invalidate pgindex for all other pathgroups */ -+ pg_deleted = true; - } - mpp->need_reload = mpp->need_reload || must_reload; - return must_reload; -@@ -354,6 +368,7 @@ void orphan_path(struct path *pp, const char *reason) - { - condlog(3, "%s: orphan path, %s", pp->dev, reason); - pp->mpp = NULL; -+ pp->pgindex = 0; - uninitialize_path(pp); - } - diff --git a/0025-libmultipath-make-pgcmp-detect-if-map-is-missing-a-p.patch b/0025-libmultipath-make-pgcmp-detect-if-map-is-missing-a-p.patch deleted file mode 100644 index b2b9e48..0000000 --- a/0025-libmultipath-make-pgcmp-detect-if-map-is-missing-a-p.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Mon, 25 Nov 2024 15:18:15 +0100 -Subject: [PATCH] libmultipath: make pgcmp detect if map is missing a path - group - -The previous algorithm didn't detect the case case where cpgp -contained a path that was not contained in pgp. Fix this. - -Cherry-picked from d4b35f61cb75c6e9b289e56c98457fc04ce4835e -Fixes: 90773ba ("libmultipath: resolve hash collisions in pgcmp()") -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - libmultipath/configure.c | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/libmultipath/configure.c b/libmultipath/configure.c -index a7257981..e86c1fd5 100644 ---- a/libmultipath/configure.c -+++ b/libmultipath/configure.c -@@ -426,6 +426,11 @@ compute_pgid(struct pathgroup * pgp) - pgp->id ^= (long)pp; - } - -+static void cleanup_bitfield(struct bitfield **p) -+{ -+ free(*p); -+} -+ - static int - pgcmp (struct multipath * mpp, struct multipath * cmpp) - { -@@ -433,16 +438,25 @@ pgcmp (struct multipath * mpp, struct multipath * cmpp) - struct pathgroup * pgp; - struct pathgroup * cpgp; - int r = 0; -+ struct bitfield *bf __attribute__((cleanup(cleanup_bitfield))) = NULL; - - if (!mpp) - return 0; - -+ if (VECTOR_SIZE(mpp->pg) != VECTOR_SIZE(cmpp->pg)) -+ return 1; -+ -+ bf = alloc_bitfield(VECTOR_SIZE(cmpp->pg)); -+ if (!bf) -+ return 1; -+ - vector_foreach_slot (mpp->pg, pgp, i) { - compute_pgid(pgp); - - vector_foreach_slot (cmpp->pg, cpgp, j) { - if (pgp->id == cpgp->id && - !pathcmp(pgp, cpgp)) { -+ set_bit_in_bitfield(j, bf); - r = 0; - break; - } -@@ -451,6 +465,10 @@ pgcmp (struct multipath * mpp, struct multipath * cmpp) - if (r) - return r; - } -+ vector_foreach_slot (cmpp->pg, cpgp, j) { -+ if (!is_bit_set_in_bitfield(j, bf)) -+ return 1; -+ } - return r; - } - diff --git a/0026-libmultipath-trigger-uevents-upon-map-creation-in-do.patch b/0026-libmultipath-trigger-uevents-upon-map-creation-in-do.patch deleted file mode 100644 index bd3a7a4..0000000 --- a/0026-libmultipath-trigger-uevents-upon-map-creation-in-do.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Tue, 26 Nov 2024 22:37:20 +0100 -Subject: [PATCH] libmultipath: trigger uevents upon map creation in domap() - -If map creation succeeds, previously not multipathed devices are -now multipathed. udev may not have noticed this yet, thus trigger -path uevents to make it aware of the situation. Likewise, if -creating a map fails, the paths in question were likely considered -multipath members by udev, too. They will now be marked as failed, -so trigger an event in this situation as well. - -Fixes: https://github.com/opensvc/multipath-tools/issues/103 -Suggested-by: Benjamin Marzinski -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -(cherry picked from commit 98b3a7bd9ed2a89f068fe40c253843cf78261905) -Signed-off-by: Benjamin Marzinski ---- - libmultipath/configure.c | 11 ++++------- - libmultipath/devmapper.c | 9 +++------ - 2 files changed, 7 insertions(+), 13 deletions(-) - -diff --git a/libmultipath/configure.c b/libmultipath/configure.c -index e86c1fd5..d9fac384 100644 ---- a/libmultipath/configure.c -+++ b/libmultipath/configure.c -@@ -581,8 +581,6 @@ trigger_paths_udev_change(struct multipath *mpp, bool is_mpath) - vector_foreach_slot(pgp->paths, pp, j) - trigger_path_udev_change(pp, is_mpath); - } -- -- mpp->needs_paths_uevent = 0; - } - - static int sysfs_set_max_sectors_kb(struct multipath *mpp) -@@ -954,10 +952,10 @@ int domap(struct multipath *mpp, char *params, int is_daemon) - * succeeded - */ - mpp->force_udev_reload = 0; -- if (mpp->action == ACT_CREATE && -- (remember_wwid(mpp->wwid) == 1 || -- mpp->needs_paths_uevent)) -+ if (mpp->action == ACT_CREATE) { -+ remember_wwid(mpp->wwid); - trigger_paths_udev_change(mpp, true); -+ } - if (!is_daemon) { - /* multipath client mode */ - dm_switchgroup(mpp->alias, mpp->bestpg); -@@ -982,8 +980,7 @@ int domap(struct multipath *mpp, char *params, int is_daemon) - } - dm_setgeometry(mpp); - return DOMAP_OK; -- } else if (r == DOMAP_FAIL && mpp->action == ACT_CREATE && -- mpp->needs_paths_uevent) -+ } else if (r == DOMAP_FAIL && mpp->action == ACT_CREATE) - trigger_paths_udev_change(mpp, false); - - return DOMAP_FAIL; -diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c -index fe5637b3..a0070c56 100644 ---- a/libmultipath/devmapper.c -+++ b/libmultipath/devmapper.c -@@ -536,7 +536,7 @@ static uint16_t build_udev_flags(const struct multipath *mpp, int reload) - MPATH_UDEV_RELOAD_FLAG : 0); - } - --int dm_addmap_create (struct multipath *mpp, char * params) -+int dm_addmap_create (struct multipath *mpp, char *params) - { - int ro; - uint16_t udev_flags = build_udev_flags(mpp, 0); -@@ -546,9 +546,7 @@ int dm_addmap_create (struct multipath *mpp, char * params) - - if (dm_addmap(DM_DEVICE_CREATE, TGT_MPATH, mpp, params, ro, - udev_flags)) { -- if (unmark_failed_wwid(mpp->wwid) == -- WWID_FAILED_CHANGED) -- mpp->needs_paths_uevent = 1; -+ unmark_failed_wwid(mpp->wwid); - return 1; - } - /* -@@ -566,8 +564,7 @@ int dm_addmap_create (struct multipath *mpp, char * params) - break; - } - } -- if (mark_failed_wwid(mpp->wwid) == WWID_FAILED_CHANGED) -- mpp->needs_paths_uevent = 1; -+ mark_failed_wwid(mpp->wwid); - return 0; - } - diff --git a/0027-multipathd-trigger-uevents-upon-map-removal-in-coale.patch b/0027-multipathd-trigger-uevents-upon-map-removal-in-coale.patch deleted file mode 100644 index f43ca0c..0000000 --- a/0027-multipathd-trigger-uevents-upon-map-removal-in-coale.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Wed, 27 Nov 2024 20:39:50 +0100 -Subject: [PATCH] multipathd: trigger uevents upon map removal in - coalesce_maps() - -... if a map has been flushed. In this case, we know that the -the paths haven't been multipathed by coalesce_paths() because of the current -configuration (failure to create the map can't be the reason if the map -exists in coalesce_maps()). Make sure udev sees the paths which have -been released from the map as non-multipath. - -Note that this is the only case where maps are flushed where it is correct -to trigger paths uevents. In other cases, e.g. after a "remove map" CLI -command, the configuration is unchanged and if we triggered an uevent, -the map would be re-created by multipathd when the uevent arrived. - -Signed-off-by: Martin Wilck -Reviewed-by: Benjamin Marzinski -(cherry picked from commit ad3ea472b587c0c20d2100331b5c66f8602f8414) -Signed-off-by: Benjamin Marzinski ---- - multipathd/main.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/multipathd/main.c b/multipathd/main.c -index 3fb623fd..4b089c0e 100644 ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -794,8 +794,10 @@ coalesce_maps(struct vectors *vecs, vector nmpv) - vector_del_slot(ompv, i); - i--; - } -- else -+ else { - condlog(2, "%s devmap removed", ompp->alias); -+ trigger_paths_udev_change(ompp, false); -+ } - } else if (reassign_maps) { - condlog(3, "%s: Reassign existing device-mapper" - " devices", ompp->alias); diff --git a/0028-libmultipath-Don-t-skip-set_path_max_sectors_kb.patch b/0028-libmultipath-Don-t-skip-set_path_max_sectors_kb.patch deleted file mode 100644 index 6c001f5..0000000 --- a/0028-libmultipath-Don-t-skip-set_path_max_sectors_kb.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Wed, 4 Dec 2024 22:56:36 -0500 -Subject: [PATCH] libmultipath: Don't skip set_path_max_sectors_kb() - -If a multipath device already has need_reload set when a path is -adopted, it won't call set_path_max_sectors_kb() because of -short-circuit evaluation. This isn't what's intended. - -Fixes: e5e20c7b ("libmultipath: set max_sectors_kb in adopt_paths()") -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -(cherry picked from commit f5c0c4b25c5eaac87b78e6e0c8d52b0828c29893) ---- - libmultipath/structs_vec.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index 9dc5a5ca..683ab473 100644 ---- a/libmultipath/structs_vec.c -+++ b/libmultipath/structs_vec.c -@@ -349,8 +349,7 @@ int adopt_paths(vector pathvec, struct multipath *mpp, - */ - if (!current_mpp || - !mp_find_path_by_devt(current_mpp, pp->dev_t)) -- mpp->need_reload = mpp->need_reload || -- set_path_max_sectors_kb(pp, mpp->max_sectors_kb); -+ mpp->need_reload = set_path_max_sectors_kb(pp, mpp->max_sectors_kb) || mpp->need_reload; - } - - pp->mpp = mpp; diff --git a/0029-libmultipath-stop-static-analyzer-complaint-in-init_.patch b/0029-libmultipath-stop-static-analyzer-complaint-in-init_.patch deleted file mode 100644 index e293a0e..0000000 --- a/0029-libmultipath-stop-static-analyzer-complaint-in-init_.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Wed, 22 Jan 2025 22:16:42 -0500 -Subject: [PATCH] libmultipath: stop static analyzer complaint in init_foreign - -This change doesn't actually fix anything. The code was already safe. - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -(cherry picked from commit 85ec51e7930b4cadfbc12718afa91ce3a4adf4b5) ---- - libmultipath/foreign.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c -index 28d1b115..af5b0ed3 100644 ---- a/libmultipath/foreign.c -+++ b/libmultipath/foreign.c -@@ -129,7 +129,7 @@ static void free_pre(void *arg) - static int _init_foreign(const char *enable) - { - char pathbuf[PATH_MAX]; -- struct dirent **di; -+ struct dirent **di = NULL; - struct scandir_result sr; - int r, i; - regex_t *enable_re = NULL; diff --git a/0030-libmultipath-be-lenient-in-allowing-the-alua-based-p.patch b/0030-libmultipath-be-lenient-in-allowing-the-alua-based-p.patch deleted file mode 100644 index 06a1b0f..0000000 --- a/0030-libmultipath-be-lenient-in-allowing-the-alua-based-p.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Wed, 22 Jan 2025 22:16:43 -0500 -Subject: [PATCH] libmultipath: be lenient in allowing the alua-based - pgpolicies - -multipath wouldn't autodetect the GROUP_BY_PRIO path grouping policy or -allow the GROUP_BY_TPG policy if there was a path that didn't have its -prioritizer selected (for instance because multipathd was reconfigured -while it was offline). To avoid this, make verify_alua_prio() assume an -alua multipath device if all the paths with a prioritizer selected -(there must be at least one) use an alua-based prioritizer. - -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck -(cherry picked from commit b47a577998eaff203018a00b57ba5e3674645848) ---- - libmultipath/propsel.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c -index a3fce203..c09a0619 100644 ---- a/libmultipath/propsel.c -+++ b/libmultipath/propsel.c -@@ -255,14 +255,18 @@ verify_alua_prio(struct multipath *mp) - { - int i; - struct path *pp; -+ bool assume_alua = false; - - vector_foreach_slot(mp->paths, pp, i) { - const char *name = prio_name(&pp->prio); -+ if (!prio_selected(&pp->prio)) -+ continue; - if (strncmp(name, PRIO_ALUA, PRIO_NAME_LEN) && - strncmp(name, PRIO_SYSFS, PRIO_NAME_LEN)) - return false; -+ assume_alua = true; - } -- return true; -+ return assume_alua; - } - - int select_detect_pgpolicy(struct config *conf, struct multipath *mp) diff --git a/0031-Update-NEWS.md-for-0.10.2.patch b/0031-Update-NEWS.md-for-0.10.2.patch deleted file mode 100644 index fd31420..0000000 --- a/0031-Update-NEWS.md-for-0.10.2.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Fri, 24 Jan 2025 20:03:15 +0100 -Subject: [PATCH] Update NEWS.md for 0.10.2 - -Signed-off-by: Benjamin Marzinski ---- - .github/actions/spelling/expect.txt | 2 ++ - NEWS.md | 23 ++++++++++++++++++++++- - 2 files changed, 24 insertions(+), 1 deletion(-) - -diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt -index 000d5ebb..4ac57510 100644 ---- a/.github/actions/spelling/expect.txt -+++ b/.github/actions/spelling/expect.txt -@@ -11,6 +11,7 @@ ata - autoconfig - autodetected - autoresize -+backported - barbie - BINDIR - blkid -@@ -122,6 +123,7 @@ Lun - lvm - lvmteam - Marzinski -+misdetection - mpath - mpathb - mpathpersist -diff --git a/NEWS.md b/NEWS.md -index 3c51553e..1b239ffa 100644 ---- a/NEWS.md -+++ b/NEWS.md -@@ -1,6 +1,27 @@ - # multipath-tools Release Notes - --## multipath-tools 0.10.1, 2024/11 -+## multipath-tools 0.10.2, 2025/02 -+ -+This release contains backported bug fixes from the stable-0.11.y branch. -+ -+### Bug fixes -+ -+* Fix multipathd crash because of invalid path group index value, for example -+ if an invalid path device was removed from a map. -+ Fixes [#105](https://github.com/opensvc/multipath-tools/issues/105). -+* Make sure maps are reloaded in the path checker loop after detecting an -+ inconsistent or wrong kernel state (e.g. missing or falsely mapped path -+ device). Wrongly mapped paths will be unmapped and released to the system. -+ Fixes another issue reported in -+ [#105](https://github.com/opensvc/multipath-tools/issues/105). -+* Fix the problem that `group_by_tpg` might be disabled if one or more -+ paths were offline during initial configuration. -+* Fix possible misdetection of changed pathgroups in a map. -+* Fix the problem that if a map was scheduled to be reloaded already, -+ `max_sectors_kb` might not be set on a path device that -+ was being added to a multipath map. This problem was introduced in 0.9.9. -+ -+## multipath-tools 0.10.1, 2025/01 - - This is the first bug fix release on the `stable-0.10.y` branch. It contains - bug fixes from 0.11.0, and some CI-related fixes. diff --git a/0032-GitHub-Workflows-fix-abi-stable.yaml-for-pull-reques.patch b/0032-GitHub-Workflows-fix-abi-stable.yaml-for-pull-reques.patch deleted file mode 100644 index 3ddab39..0000000 --- a/0032-GitHub-Workflows-fix-abi-stable.yaml-for-pull-reques.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Sat, 25 Jan 2025 00:49:19 +0100 -Subject: [PATCH] GitHub Workflows: fix abi-stable.yaml for pull request - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - .github/workflows/abi-stable.yaml | 16 ++++++++++++---- - 1 file changed, 12 insertions(+), 4 deletions(-) - -diff --git a/.github/workflows/abi-stable.yaml b/.github/workflows/abi-stable.yaml -index a6746f23..472914ce 100644 ---- a/.github/workflows/abi-stable.yaml -+++ b/.github/workflows/abi-stable.yaml -@@ -15,12 +15,16 @@ on: - - jobs: - reference-abi: -- runs-on: ubuntu-20.04 -+ runs-on: ubuntu-22.04 - steps: - - name: get parent tag - run: > - echo ${{ github.ref }} | - sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV -+ if: ${{ github.event_name == 'push' }} -+ - name: get parent tag -+ run: echo PARENT_TAG=${{ github.base_ref }} >> $GITHUB_ENV -+ if: ${{ github.event_name == 'pull_request' }} - - name: assert parent tag - run: /bin/false - if: ${{ env.PARENT_TAG == '' }} -@@ -45,20 +49,24 @@ jobs: - path: abi - - check-abi: -- runs-on: ubuntu-20.04 -+ runs-on: ubuntu-22.04 - needs: reference-abi - steps: - - name: get parent tag - run: > - echo ${{ github.ref }} | - sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' >> $GITHUB_ENV -+ if: ${{ github.event_name == 'push' }} -+ - name: get parent tag -+ run: echo PARENT_TAG=${{ github.base_ref }} >> $GITHUB_ENV -+ if: ${{ github.event_name == 'pull_request' }} - - name: assert parent tag - run: /bin/false - if: ${{ env.PARENT_TAG == '' }} -- - name: checkout ${{ env.PARENT_TAG }} -+ - name: checkout ${{ github.base_ref }} - uses: actions/checkout@v4 - with: -- ref: ${{ env.PARENT_TAG }} -+ ref: ${{ github.base_ref }} - - name: download ABI for ${{ env.PARENT_TAG }} - id: download_abi - uses: actions/download-artifact@v4 diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 8e469ab..2de9457 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath -Version: 0.10.0 -Release: 5%{?dist} +Version: 0.11.1 +Release: 1%{?dist} Summary: Tools to manage multipath devices using device-mapper # readline uses GPL-3.0-only License: GPL-2.0-only AND GPL-3.0-only @@ -8,54 +8,26 @@ 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.10.0.tar.gz -o multipath-tools-0.10.0.tgz -Source0: multipath-tools-0.10.0.tgz +# curl -L https://github.com/opensvc/multipath-tools/archive/0.11.1.tar.gz -o multipath-tools-0.11.1.tgz +Source0: multipath-tools-0.11.1.tgz Source1: multipath.conf -Patch0001: 0001-GitHub-workflows-use-upload-download-artifact-v4.patch -Patch0002: 0002-GitHub-workflows-update-dawidd6-action-download-arti.patch -Patch0003: 0003-Github-workflows-native.yml-use-mosteo-actions-docke.patch -Patch0004: 0004-GitHub-workflows-native.yml-use-extra-job-for-clang.patch -Patch0005: 0005-GitHub-workflows-native.yaml-make-test-and-archive-s.patch -Patch0006: 0006-GitHub-workflows-enable-unit-tests-for-stable-branch.patch -Patch0007: 0007-GitHub-Workflows-add-abi-check-for-stable-branches.patch -Patch0008: 0008-libmultipath-dm_get_maps-don-t-bail-out-for-single-m.patch -Patch0009: 0009-11-dm-mpath.rules.in-import-DM_COLDPLUG_SUSPENDED-on.patch -Patch0010: 0010-11-dm-mpath.rules.in-handle-inactive-suspended-devic.patch -Patch0011: 0011-11-dm-mpath.rules.in-clarify-DM_ACTIVATION-logic.patch -Patch0012: 0012-11-dm-mpath-rules.in-skip-one-.DM_NOSCAN-check.patch -Patch0013: 0013-11-dm-mpath.rules.in-set-.DM_NOSCAN-if-MPATH_UNCHANG.patch -Patch0014: 0014-libmultipath-don-t-set-dev_loss_tmo-to-0-for-NO_PATH.patch -Patch0015: 0015-multipathd-fix-deferred_failback_tick-for-reload-rem.patch -Patch0016: 0016-multipathd-fix-an-unsigned-int-ovwerflow.patch -Patch0017: 0017-libmpathutil-avoid-Wcast-function-type-mismatch-erro.patch -Patch0018: 0018-Update-NEWS.md-for-0.10.1.patch -Patch0019: 0019-libmultipath-don-t-print-error-message-if-WATCHDOG_U.patch -Patch0020: 0020-libmultipath-reduce-log-level-of-map-X-has-multiple-.patch -Patch0021: 0021-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch -Patch0022: 0022-libmultipath-add-condition-for-enqueueing-path-to-io.patch -Patch0023: 0023-Additional-NEWS.md-updates-for-0.10.1.patch -Patch0024: 0024-libmultipath-fix-handling-of-pp-pgindex.patch -Patch0025: 0025-libmultipath-make-pgcmp-detect-if-map-is-missing-a-p.patch -Patch0026: 0026-libmultipath-trigger-uevents-upon-map-creation-in-do.patch -Patch0027: 0027-multipathd-trigger-uevents-upon-map-removal-in-coale.patch -Patch0028: 0028-libmultipath-Don-t-skip-set_path_max_sectors_kb.patch -Patch0029: 0029-libmultipath-stop-static-analyzer-complaint-in-init_.patch -Patch0030: 0030-libmultipath-be-lenient-in-allowing-the-alua-based-p.patch -Patch0031: 0031-Update-NEWS.md-for-0.10.2.patch -Patch0032: 0032-GitHub-Workflows-fix-abi-stable.yaml-for-pull-reques.patch -Patch0033: 0033-RH-fixup-udev-rules-for-redhat.patch -Patch0034: 0034-RH-Remove-the-property-blacklist-exception-builtin.patch -Patch0035: 0035-RH-don-t-start-without-a-config-file.patch -Patch0036: 0036-RH-Fix-nvme-function-missing-argument.patch -Patch0037: 0037-RH-use-rpm-optflags-if-present.patch -Patch0038: 0038-RH-add-mpathconf.patch -Patch0039: 0039-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch -Patch0040: 0040-RH-reset-default-find_mutipaths-value-to-off.patch -Patch0041: 0041-RH-attempt-to-get-ANA-info-via-sysfs-first.patch -Patch0042: 0042-RH-make-parse_vpd_pg83-match-scsi_id-output.patch -Patch0043: 0043-RH-add-scsi-device-handlers-to-modules-load.d.patch -Patch0044: 0044-RH-compile-with-libreadline-support.patch -Patch0045: 0045-RH-Add-mpathcleanup.patch +Patch0001: 0001-multipathd-trigger-uevents-for-blacklisted-paths-in-.patch +Patch0002: 0002-multipath-tools-fix-compilation-with-latest-userspac.patch +Patch0003: 0003-libmultipath-include-urcu.h-before-urcu-atomic.h.patch +Patch0004: 0004-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch +Patch0005: 0005-RH-fixup-udev-rules-for-redhat.patch +Patch0006: 0006-RH-Remove-the-property-blacklist-exception-builtin.patch +Patch0007: 0007-RH-don-t-start-without-a-config-file.patch +Patch0008: 0008-RH-Fix-nvme-function-missing-argument.patch +Patch0009: 0009-RH-use-rpm-optflags-if-present.patch +Patch0010: 0010-RH-add-mpathconf.patch +Patch0011: 0011-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +Patch0012: 0012-RH-reset-default-find_mutipaths-value-to-off.patch +Patch0013: 0013-RH-attempt-to-get-ANA-info-via-sysfs-first.patch +Patch0014: 0014-RH-make-parse_vpd_pg83-match-scsi_id-output.patch +Patch0015: 0015-RH-add-scsi-device-handlers-to-modules-load.d.patch +Patch0016: 0016-RH-compile-with-libreadline-support.patch +Patch0017: 0017-RH-Add-mpathcleanup.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -143,7 +115,7 @@ 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.10.0 -p1 +%autosetup -n multipath-tools-0.11.1 -p1 cp %{SOURCE1} . %build @@ -265,6 +237,13 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Thu Feb 27 2025 Benjamin Marzinski - 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 - 0.10.0-5 - Update source to upstream staging branch for 0.10.y (will be 0.10.2 when merged). diff --git a/sources b/sources index da06e16..5eea94e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (multipath-tools-0.10.0.tgz) = 8f545609fa20df7547428f2929571dc0df87c17d9f61f11aad3559446c2e94755e18b1c4b3780b3de92ec2cbc450939ca15a9d6c95551eee4084064d83874b2d +SHA512 (multipath-tools-0.11.1.tgz) = ac6bacd725bc831a140b75a72c81296eb1ed4080fb6350caf6178914d1bdce743705f3bd4e31f318068f6272dc98e12d63ee38228a3521a3d1c7bc8eb30812f9 SHA512 (multipath.conf) = 71953dce5a68adcf60a942305f5a66023e6f4c4baf53b1bfdb4edf65ed5b8e03db804363c36d1dcfd85591f4766f52b515269904c53b84d7b076da0b80b09942 From 9f48ebd2e22ad64a101f59f06a9e8306f6e3b317 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 19:12:54 +0000 Subject: [PATCH 17/19] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- device-mapper-multipath.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 2de9457..232daba 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.11.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tools to manage multipath devices using device-mapper # readline uses GPL-3.0-only License: GPL-2.0-only AND GPL-3.0-only @@ -237,6 +237,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 0.11.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Thu Feb 27 2025 Benjamin Marzinski - 0.11.1-1 - Update source to upstream staging branch for 0.11.1 plus additional stable branch patches. From 3c9f48504bb89ec2a2c84cfffbeaf2f2811fcefd Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Tue, 4 Nov 2025 18:02:43 -0500 Subject: [PATCH 18/19] device-mapper-multipath-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 --- .gitignore | 1 + ... 0001-RH-fixup-udev-rules-for-redhat.patch | 4 +- ...er-uevents-for-blacklisted-paths-in-.patch | 101 ------------------ ...property-blacklist-exception-builtin.patch | 14 +-- ...fix-compilation-with-latest-userspac.patch | 63 ----------- ...RH-don-t-start-without-a-config-file.patch | 24 ++--- ...-include-urcu.h-before-urcu-atomic.h.patch | 40 ------- ...H-Fix-nvme-function-missing-argument.patch | 6 +- ...uxsock.c-Include-string.h-for-memcpy.patch | 29 ----- ... 0005-RH-use-rpm-optflags-if-present.patch | 12 ++- ...hconf.patch => 0006-RH-add-mpathconf.patch | 8 +- ...om-kernel-cmdline-mpath.wwids-with-A.patch | 16 +-- ...-default-find_mutipaths-value-to-off.patch | 8 +- ...empt-to-get-ANA-info-via-sysfs-first.patch | 14 +-- ...-parse_vpd_pg83-match-scsi_id-output.patch | 8 +- ...si-device-handlers-to-modules-load.d.patch | 4 +- ...-RH-compile-with-libreadline-support.patch | 4 +- ...up.patch => 0013-RH-Add-mpathcleanup.patch | 2 +- device-mapper-multipath.spec | 48 +++++---- sources | 2 +- 20 files changed, 91 insertions(+), 317 deletions(-) rename 0005-RH-fixup-udev-rules-for-redhat.patch => 0001-RH-fixup-udev-rules-for-redhat.patch (96%) delete mode 100644 0001-multipathd-trigger-uevents-for-blacklisted-paths-in-.patch rename 0006-RH-Remove-the-property-blacklist-exception-builtin.patch => 0002-RH-Remove-the-property-blacklist-exception-builtin.patch (91%) delete mode 100644 0002-multipath-tools-fix-compilation-with-latest-userspac.patch rename 0007-RH-don-t-start-without-a-config-file.patch => 0003-RH-don-t-start-without-a-config-file.patch (88%) delete mode 100644 0003-libmultipath-include-urcu.h-before-urcu-atomic.h.patch rename 0008-RH-Fix-nvme-function-missing-argument.patch => 0004-RH-Fix-nvme-function-missing-argument.patch (84%) delete mode 100644 0004-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch rename 0009-RH-use-rpm-optflags-if-present.patch => 0005-RH-use-rpm-optflags-if-present.patch (85%) rename 0010-RH-add-mpathconf.patch => 0006-RH-add-mpathconf.patch (99%) rename 0011-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch => 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch (92%) rename 0012-RH-reset-default-find_mutipaths-value-to-off.patch => 0008-RH-reset-default-find_mutipaths-value-to-off.patch (87%) rename 0013-RH-attempt-to-get-ANA-info-via-sysfs-first.patch => 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch (86%) rename 0014-RH-make-parse_vpd_pg83-match-scsi_id-output.patch => 0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch (91%) rename 0015-RH-add-scsi-device-handlers-to-modules-load.d.patch => 0011-RH-add-scsi-device-handlers-to-modules-load.d.patch (89%) rename 0016-RH-compile-with-libreadline-support.patch => 0012-RH-compile-with-libreadline-support.patch (89%) rename 0017-RH-Add-mpathcleanup.patch => 0013-RH-Add-mpathcleanup.patch (98%) diff --git a/.gitignore b/.gitignore index 8cd21df..c297b30 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ multipath-tools-091027.tar.gz /multipath-tools-0.9.9.tgz /multipath-tools-0.10.0.tgz /multipath-tools-0.11.1.tgz +/multipath-tools-0.13.0.tgz diff --git a/0005-RH-fixup-udev-rules-for-redhat.patch b/0001-RH-fixup-udev-rules-for-redhat.patch similarity index 96% rename from 0005-RH-fixup-udev-rules-for-redhat.patch rename to 0001-RH-fixup-udev-rules-for-redhat.patch index 0135f49..ed5b7e9 100644 --- a/0005-RH-fixup-udev-rules-for-redhat.patch +++ b/0001-RH-fixup-udev-rules-for-redhat.patch @@ -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 Date: Thu, 13 Apr 2017 07:22:23 -0500 Subject: [PATCH] RH: fixup udev rules for redhat @@ -15,7 +15,7 @@ Signed-off-by: Benjamin Marzinski 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.inc b/Makefile.inc -index 65f6efc8..c225a1ed 100644 +index 9e3dc466..ead89030 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -34,7 +34,7 @@ endif diff --git a/0001-multipathd-trigger-uevents-for-blacklisted-paths-in-.patch b/0001-multipathd-trigger-uevents-for-blacklisted-paths-in-.patch deleted file mode 100644 index 72bcf69..0000000 --- a/0001-multipathd-trigger-uevents-for-blacklisted-paths-in-.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Thu, 23 Jan 2025 22:19:39 +0100 -Subject: [PATCH] multipathd: trigger uevents for blacklisted paths in - reconfigure - -If multipathd has already configured maps, and the user changes the -blacklist or other parameters that cause currently multipathed -devices to be skipped, and then runs "multipathd reconfigure" -or restarts multipathd, multipathd flushes the maps in question, -but doesn't trigger uevents for the now-blacklisted paths. - -This is because the blacklisted paths are removed from the discovered -maps internally when update_pathvec_from_dm() is called through -map_discovery() and update_multipath_table(); when later -trigger_paths_udev_change() is called from coalesce_maps(), the -map contains no paths for which an uevent could be triggered. - -The map_discovery() code flow is special, because we will call -coalesce_paths() afterwards anyway and reconstruct the mpvec. Unlike the -regular code flow, we don't want the maps to be "corrected" in this -case, because the maps discovered here aren't going to be reloaded. -We just want update_pathvec_from_dm() to populate the pathvec. - -Therefore add a new flag DI_DISCOVERY, which is only set when -update_multipath_table() is called from map_discovery(), and if -this flag is set, keep PATHINFO_SKIPPED paths in the map's table in -update_pathvec_from_dm(). Later on, the paths will still be visible -in the old mpp (ompp) in coalesce_maps(), and uevents will be -triggered for them to release them to systemd. - -We can't always do this for PATHINFO_SKIPPED, because in some cases -paths may be accepted in a map first and SKIPPED later (for example if -the WWID wasn't yet available at startup). Therefore the special -case for DI_DISCOVERY is necessary. - -Signed-off-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - libmultipath/discovery.h | 2 ++ - libmultipath/structs_vec.c | 6 +++++- - multipathd/main.c | 2 +- - 3 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h -index 7d42eae5..9824a8d3 100644 ---- a/libmultipath/discovery.h -+++ b/libmultipath/discovery.h -@@ -72,6 +72,7 @@ enum discovery_mode { - DI_BLACKLIST__, - DI_NOIO__, - DI_NOFALLBACK__, -+ DI_DISCOVERY__, - }; - - #define DI_SYSFS (1 << DI_SYSFS__) -@@ -82,6 +83,7 @@ enum discovery_mode { - #define DI_BLACKLIST (1 << DI_BLACKLIST__) - #define DI_NOIO (1 << DI_NOIO__) /* Avoid IO on the device */ - #define DI_NOFALLBACK (1 << DI_NOFALLBACK__) /* do not allow wwid fallback */ -+#define DI_DISCOVERY (1 << DI_DISCOVERY__) /* set only during map discovery */ - - #define DI_ALL (DI_SYSFS | DI_SERIAL | DI_CHECKER | DI_PRIO | \ - DI_WWID) -diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index 7a4e3eb0..5ccdaea0 100644 ---- a/libmultipath/structs_vec.c -+++ b/libmultipath/structs_vec.c -@@ -109,6 +109,9 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, - bool mpp_has_wwid; - bool must_reload = false; - bool pg_deleted = false; -+ bool map_discovery = !!(pathinfo_flags & DI_DISCOVERY); -+ -+ pathinfo_flags &= ~DI_DISCOVERY; - - if (!mpp->pg) - return false; -@@ -195,7 +198,8 @@ static bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, - rc = pathinfo(pp, conf, - DI_SYSFS|DI_WWID|DI_BLACKLIST|DI_NOFALLBACK|pathinfo_flags); - pthread_cleanup_pop(1); -- if (rc != PATHINFO_OK) { -+ if (rc == PATHINFO_FAILED || -+ (rc == PATHINFO_SKIPPED && !map_discovery)) { - condlog(1, "%s: error %d in pathinfo, discarding path", - pp->dev, rc); - vector_del_slot(pgp->paths, j--); -diff --git a/multipathd/main.c b/multipathd/main.c -index 9ed27da0..fb3e44a8 100644 ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -1763,7 +1763,7 @@ map_discovery (struct vectors * vecs) - return 1; - - vector_foreach_slot (vecs->mpvec, mpp, i) -- if (update_multipath_table(mpp, vecs->pathvec, 0) != DMP_OK) { -+ if (update_multipath_table(mpp, vecs->pathvec, DI_DISCOVERY) != DMP_OK) { - remove_map(mpp, vecs->pathvec, vecs->mpvec); - i--; - } diff --git a/0006-RH-Remove-the-property-blacklist-exception-builtin.patch b/0002-RH-Remove-the-property-blacklist-exception-builtin.patch similarity index 91% rename from 0006-RH-Remove-the-property-blacklist-exception-builtin.patch rename to 0002-RH-Remove-the-property-blacklist-exception-builtin.patch index a74e6c2..b8e580a 100644 --- a/0006-RH-Remove-the-property-blacklist-exception-builtin.patch +++ b/0002-RH-Remove-the-property-blacklist-exception-builtin.patch @@ -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 Date: Wed, 2 Jul 2014 12:49:53 -0500 Subject: [PATCH] RH: Remove the property blacklist exception builtin @@ -42,10 +42,10 @@ index 17e1b54a..10d13e98 100644 udev_device_get_properties_list_entry(udev)) { diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in -index 4388baad..af9fbb96 100644 +index 3c9ae097..ba291e11 100644 --- a/multipath/multipath.conf.5.in +++ b/multipath/multipath.conf.5.in -@@ -1469,9 +1469,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 4388baad..af9fbb96 100644 . .RS .PP -@@ -1482,10 +1487,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 4388baad..af9fbb96 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; diff --git a/0002-multipath-tools-fix-compilation-with-latest-userspac.patch b/0002-multipath-tools-fix-compilation-with-latest-userspac.patch deleted file mode 100644 index 03d7d9d..0000000 --- a/0002-multipath-tools-fix-compilation-with-latest-userspac.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Mon, 3 Feb 2025 16:43:42 -0500 -Subject: [PATCH] multipath-tools: fix compilation with latest userspace-rcu - code - -starting with version 0.15, userspace-rcu can be compiled with -CONFIG_RCU_USE_ATOMIC_BUILTINS. If it is, then any programs using it -must be compiled with at least the C11 standard. See: -https://github.com/urcu/userspace-rcu/commit/89280d020bf064d1055c360fb9974f128051043f - -To deal with this, check if compiling with gnu99 fails, and if so, -switch to using gnu11. - -Based-on-patch-by: Yaakov Selkowitz -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck ---- - Makefile.inc | 2 +- - create-config.mk | 13 +++++++++++++ - 2 files changed, 14 insertions(+), 1 deletion(-) - -diff --git a/Makefile.inc b/Makefile.inc -index 729618bd..65f6efc8 100644 ---- a/Makefile.inc -+++ b/Makefile.inc -@@ -115,7 +115,7 @@ CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) \ - -DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \ - -DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" -DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \ - -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP --CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \ -+CFLAGS := -std=$(C_STD) $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \ - -fexceptions - BIN_CFLAGS := -fPIE -DPIE - LIB_CFLAGS := -fPIC -diff --git a/create-config.mk b/create-config.mk -index 8bd2c20c..ab163ed1 100644 ---- a/create-config.mk -+++ b/create-config.mk -@@ -157,6 +157,18 @@ FORTIFY_OPT := $(shell \ - echo "-D_FORTIFY_SOURCE=2"; \ - fi) - -+# Check is you can compile with the urcu.h header, using the C99 standard. -+# If urcu/config-.h defines CONFIG_RCU_USE_ATOMIC_BUILTINS, then anything -+# including urcu.h must be compiled with at least the C11 standard. See: -+# https://github.com/urcu/userspace-rcu/commit/89280d020bf064d1055c360fb9974f128051043f -+C_STD := $(shell \ -+ if printf '$(__HASH__)include \nint main(void) { return 0; }\n' | $(CC) -o /dev/null -c -xc --std=gnu99 - 2>/dev/null; \ -+ then \ -+ echo "gnu99"; \ -+ else \ -+ echo "gnu11"; \ -+ fi) -+ - STACKPROT := - - all: $(TOPDIR)/config.mk -@@ -182,3 +194,4 @@ $(TOPDIR)/config.mk: $(multipathdir)/autoconfig.h - @echo "W_MISSING_INITIALIZERS := $(call TEST_MISSING_INITIALIZERS)" >>$@ - @echo "W_URCU_TYPE_LIMITS := $(call TEST_URCU_TYPE_LIMITS)" >>$@ - @echo "ENABLE_LIBDMMP := $(ENABLE_LIBDMMP)" >>$@ -+ @echo "C_STD := $(C_STD)" >>$@ diff --git a/0007-RH-don-t-start-without-a-config-file.patch b/0003-RH-don-t-start-without-a-config-file.patch similarity index 88% rename from 0007-RH-don-t-start-without-a-config-file.patch rename to 0003-RH-don-t-start-without-a-config-file.patch index edbc647..05d4e7a 100644 --- a/0007-RH-don-t-start-without-a-config-file.patch +++ b/0003-RH-don-t-start-without-a-config-file.patch @@ -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 Date: Wed, 15 Oct 2014 10:39:30 -0500 Subject: [PATCH] RH: don't start without a config file @@ -18,7 +18,7 @@ Signed-off-by: Benjamin Marzinski 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 @@ -58,10 +58,10 @@ index 5b4ebf8c..2302eacc 100644 enum devtypes { DEV_NONE, diff --git a/multipath/main.c b/multipath/main.c -index 28e3a055..346acb61 100644 +index f2adcdeb..31012874 100644 --- a/multipath/main.c +++ b/multipath/main.c -@@ -843,11 +843,14 @@ main (int argc, char *argv[]) +@@ -834,11 +834,14 @@ main (int argc, char *argv[]) char *dev = NULL; struct config *conf; bool enable_foreign = false; @@ -76,7 +76,7 @@ index 28e3a055..346acb61 100644 if (init_config(DEFAULT_CONFIGFILE)) exit(RTVL_FAIL); if (atexit(uninit_config)) -@@ -1101,6 +1104,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"); @@ -99,7 +99,7 @@ index 2ac1972f..cc248231 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 7bc8806e..315884eb 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 7bc8806e..315884eb 100644 . .\" ---------------------------------------------------------------------------- diff --git a/multipathd/multipathd.service.in b/multipathd/multipathd.service.in -index b6a25b31..3d957733 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 b6a25b31..3d957733 100644 DefaultDependencies=no Conflicts=shutdown.target Conflicts=initrd-cleanup.service -diff --git a/multipathd/multipathd.socket b/multipathd/multipathd.socket -index 6a62f5fd..263b6b0c 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 diff --git a/0003-libmultipath-include-urcu.h-before-urcu-atomic.h.patch b/0003-libmultipath-include-urcu.h-before-urcu-atomic.h.patch deleted file mode 100644 index 8da3ce7..0000000 --- a/0003-libmultipath-include-urcu.h-before-urcu-atomic.h.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Tue, 11 Feb 2025 13:11:03 -0500 -Subject: [PATCH] libmultipath: include urcu.h before urcu/atomic.h - -urcu/atomic.h requires some header files included by urcu.h. Make sure -to include it first. - -Fixes: https://github.com/opensvc/multipath-tools/issues/112 -Signed-off-by: Benjamin Marzinski -Reviewed-by: Martin Wilck ---- - libmultipath/checkers/tur.c | 1 + - libmultipath/lock.h | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/libmultipath/checkers/tur.c b/libmultipath/checkers/tur.c -index e70a2e11..0010acf8 100644 ---- a/libmultipath/checkers/tur.c -+++ b/libmultipath/checkers/tur.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - #include - - #include "checkers.h" -diff --git a/libmultipath/lock.h b/libmultipath/lock.h -index 38473a8c..5f323055 100644 ---- a/libmultipath/lock.h -+++ b/libmultipath/lock.h -@@ -2,6 +2,7 @@ - #define LOCK_H_INCLUDED - - #include -+#include - #include - #include - diff --git a/0008-RH-Fix-nvme-function-missing-argument.patch b/0004-RH-Fix-nvme-function-missing-argument.patch similarity index 84% rename from 0008-RH-Fix-nvme-function-missing-argument.patch rename to 0004-RH-Fix-nvme-function-missing-argument.patch index 74b7b53..33a8d5f 100644 --- a/0008-RH-Fix-nvme-function-missing-argument.patch +++ b/0004-RH-Fix-nvme-function-missing-argument.patch @@ -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 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 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/nvme/argconfig.h b/libmultipath/nvme/argconfig.h -index e6c54453..0c6c9439 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 diff --git a/0004-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch b/0004-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch deleted file mode 100644 index 8fc3211..0000000 --- a/0004-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 17 Feb 2025 12:05:03 -0800 -Subject: [PATCH] libmpathutils/uxsock.c: Include string.h for memcpy - -Fixes -uxsock.c:72:2: error: call to undeclared library function 'memcpy' with type 'void *(void *, const void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] - -Signed-off-by: Khem Raj -Cc: Benjamin Marzinski -Cc: Martin Wilck -Reviewed-by: Benjamin Marzinski -Signed-off-by: Benjamin Marzinski ---- - libmpathutil/uxsock.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/libmpathutil/uxsock.c b/libmpathutil/uxsock.c -index 2135476d..a474874e 100644 ---- a/libmpathutil/uxsock.c -+++ b/libmpathutil/uxsock.c -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include - #include - #include - #include diff --git a/0009-RH-use-rpm-optflags-if-present.patch b/0005-RH-use-rpm-optflags-if-present.patch similarity index 85% rename from 0009-RH-use-rpm-optflags-if-present.patch rename to 0005-RH-use-rpm-optflags-if-present.patch index 1b96a3a..7a6f57f 100644 --- a/0009-RH-use-rpm-optflags-if-present.patch +++ b/0005-RH-use-rpm-optflags-if-present.patch @@ -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 Date: Wed, 19 Apr 2017 06:10:01 -0500 Subject: [PATCH] RH: use rpm optflags if present @@ -13,10 +13,10 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Makefile.inc b/Makefile.inc -index c225a1ed..7774f1f4 100644 +index ead89030..03aee175 100644 --- a/Makefile.inc +++ b/Makefile.inc -@@ -99,28 +99,39 @@ 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") @@ -50,8 +50,10 @@ index c225a1ed..7774f1f4 100644 -D_FILE_OFFSET_BITS=64 \ -DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(TGTDIR)$(plugindir)\" \ -DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \ - -DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" -DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \ - -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP +@@ -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 diff --git a/0010-RH-add-mpathconf.patch b/0006-RH-add-mpathconf.patch similarity index 99% rename from 0010-RH-add-mpathconf.patch rename to 0006-RH-add-mpathconf.patch index c587841..46f1126 100644 --- a/0010-RH-add-mpathconf.patch +++ b/0006-RH-add-mpathconf.patch @@ -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 Date: Thu, 16 Oct 2014 15:49:01 -0500 Subject: [PATCH] RH: add mpathconf @@ -23,10 +23,10 @@ Signed-off-by: Benjamin Marzinski create mode 100644 multipath/mpathconf.8 diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt -index 7843c380..ab5259cf 100644 +index a5856bcc..5c9113ba 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt -@@ -127,9 +127,11 @@ Marzinski +@@ -131,9 +131,11 @@ Marzinski misdetection mpath mpathb @@ -38,7 +38,7 @@ index 7843c380..ab5259cf 100644 multipathc multipathd multipathed -@@ -147,6 +149,7 @@ ontap +@@ -154,6 +156,7 @@ ontap OOM opensvc OPTFLAGS diff --git a/0011-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch b/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch similarity index 92% rename from 0011-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch rename to 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch index 612d876..cef8b56 100644 --- a/0011-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +++ b/0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch @@ -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 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 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/multipath/main.c b/multipath/main.c -index 346acb61..adc50d69 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 346acb61..adc50d69 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 346acb61..adc50d69 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" -@@ -449,6 +451,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 346acb61..adc50d69 100644 static int configure (struct config *conf, enum mpath_cmds cmd, enum devtypes dev_type, char *devpath) -@@ -860,7 +906,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 346acb61..adc50d69 100644 switch(arg) { case 'v': if (!isdigit(optarg[0])) { -@@ -931,6 +977,10 @@ main (int argc, char *argv[]) +@@ -922,6 +968,10 @@ main (int argc, char *argv[]) case 'T': cmd = CMD_DUMP_CONFIG; break; @@ -138,7 +138,7 @@ index b88e9a4c..edd742aa 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 3d957733..7ef6e99e 100644 +index ab166435..1ec08c6e 100644 --- a/multipathd/multipathd.service.in +++ b/multipathd/multipathd.service.in @@ -19,6 +19,7 @@ StartLimitBurst=3 diff --git a/0012-RH-reset-default-find_mutipaths-value-to-off.patch b/0008-RH-reset-default-find_mutipaths-value-to-off.patch similarity index 87% rename from 0012-RH-reset-default-find_mutipaths-value-to-off.patch rename to 0008-RH-reset-default-find_mutipaths-value-to-off.patch index 5789916..fdc90d4 100644 --- a/0012-RH-reset-default-find_mutipaths-value-to-off.patch +++ b/0008-RH-reset-default-find_mutipaths-value-to-off.patch @@ -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 Date: Thu, 7 Jun 2018 17:43:52 -0500 Subject: [PATCH] RH: reset default find_mutipaths value to off @@ -14,7 +14,7 @@ Signed-off-by: Benjamin Marzinski 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h -index 02f7e57c..cd03fd1a 100644 +index 134b690a..e2fe7ac4 100644 --- a/libmultipath/defaults.h +++ b/libmultipath/defaults.h @@ -24,7 +24,7 @@ @@ -27,10 +27,10 @@ index 02f7e57c..cd03fd1a 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 af9fbb96..0c1eff40 100644 +index ba291e11..b8389db3 100644 --- a/multipath/multipath.conf.5.in +++ b/multipath/multipath.conf.5.in -@@ -1226,7 +1226,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 diff --git a/0013-RH-attempt-to-get-ANA-info-via-sysfs-first.patch b/0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch similarity index 86% rename from 0013-RH-attempt-to-get-ANA-info-via-sysfs-first.patch rename to 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch index 1f94eb3..8065e9f 100644 --- a/0013-RH-attempt-to-get-ANA-info-via-sysfs-first.patch +++ b/0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch @@ -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 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 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; diff --git a/0014-RH-make-parse_vpd_pg83-match-scsi_id-output.patch b/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch similarity index 91% rename from 0014-RH-make-parse_vpd_pg83-match-scsi_id-output.patch rename to 0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch index 3243375..f7bca92 100644 --- a/0014-RH-make-parse_vpd_pg83-match-scsi_id-output.patch +++ b/0010-RH-make-parse_vpd_pg83-match-scsi_id-output.patch @@ -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 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 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c -index b5851561..a3cc6e83 100644 +index 31db8758..21cfcc73 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c -@@ -1219,13 +1219,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 b5851561..a3cc6e83 100644 good_len = 8; break; default: -@@ -1243,10 +1239,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 */ diff --git a/0015-RH-add-scsi-device-handlers-to-modules-load.d.patch b/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch similarity index 89% rename from 0015-RH-add-scsi-device-handlers-to-modules-load.d.patch rename to 0011-RH-add-scsi-device-handlers-to-modules-load.d.patch index 97fb4df..3fe7c25 100644 --- a/0015-RH-add-scsi-device-handlers-to-modules-load.d.patch +++ b/0011-RH-add-scsi-device-handlers-to-modules-load.d.patch @@ -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 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 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc -index 7774f1f4..0e836f0a 100644 +index 03aee175..936a622f 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -16,7 +16,7 @@ READLINE := diff --git a/0016-RH-compile-with-libreadline-support.patch b/0012-RH-compile-with-libreadline-support.patch similarity index 89% rename from 0016-RH-compile-with-libreadline-support.patch rename to 0012-RH-compile-with-libreadline-support.patch index e7579b0..0964c42 100644 --- a/0016-RH-compile-with-libreadline-support.patch +++ b/0012-RH-compile-with-libreadline-support.patch @@ -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 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 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc -index 0e836f0a..e1d3fcd1 100644 +index 936a622f..f475f70f 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -12,7 +12,7 @@ diff --git a/0017-RH-Add-mpathcleanup.patch b/0013-RH-Add-mpathcleanup.patch similarity index 98% rename from 0017-RH-Add-mpathcleanup.patch rename to 0013-RH-Add-mpathcleanup.patch index bd2dcd6..d1a8e84 100644 --- a/0017-RH-Add-mpathcleanup.patch +++ b/0013-RH-Add-mpathcleanup.patch @@ -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 Date: Fri, 7 Jul 2023 15:25:59 -0500 Subject: [PATCH] RH: Add mpathcleanup diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 232daba..24b00bd 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath -Version: 0.11.1 -Release: 2%{?dist} +Version: 0.13.0 +Release: 1%{?dist} Summary: Tools to manage multipath devices using device-mapper # readline uses GPL-3.0-only License: GPL-2.0-only AND GPL-3.0-only @@ -8,26 +8,22 @@ 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.11.1.tar.gz -o multipath-tools-0.11.1.tgz -Source0: multipath-tools-0.11.1.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-multipathd-trigger-uevents-for-blacklisted-paths-in-.patch -Patch0002: 0002-multipath-tools-fix-compilation-with-latest-userspac.patch -Patch0003: 0003-libmultipath-include-urcu.h-before-urcu-atomic.h.patch -Patch0004: 0004-libmpathutils-uxsock.c-Include-string.h-for-memcpy.patch -Patch0005: 0005-RH-fixup-udev-rules-for-redhat.patch -Patch0006: 0006-RH-Remove-the-property-blacklist-exception-builtin.patch -Patch0007: 0007-RH-don-t-start-without-a-config-file.patch -Patch0008: 0008-RH-Fix-nvme-function-missing-argument.patch -Patch0009: 0009-RH-use-rpm-optflags-if-present.patch -Patch0010: 0010-RH-add-mpathconf.patch -Patch0011: 0011-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch -Patch0012: 0012-RH-reset-default-find_mutipaths-value-to-off.patch -Patch0013: 0013-RH-attempt-to-get-ANA-info-via-sysfs-first.patch -Patch0014: 0014-RH-make-parse_vpd_pg83-match-scsi_id-output.patch -Patch0015: 0015-RH-add-scsi-device-handlers-to-modules-load.d.patch -Patch0016: 0016-RH-compile-with-libreadline-support.patch -Patch0017: 0017-RH-Add-mpathcleanup.patch +Patch0001: 0001-RH-fixup-udev-rules-for-redhat.patch +Patch0002: 0002-RH-Remove-the-property-blacklist-exception-builtin.patch +Patch0003: 0003-RH-don-t-start-without-a-config-file.patch +Patch0004: 0004-RH-Fix-nvme-function-missing-argument.patch +Patch0005: 0005-RH-use-rpm-optflags-if-present.patch +Patch0006: 0006-RH-add-mpathconf.patch +Patch0007: 0007-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +Patch0008: 0008-RH-reset-default-find_mutipaths-value-to-off.patch +Patch0009: 0009-RH-attempt-to-get-ANA-info-via-sysfs-first.patch +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 # runtime Requires: %{name}-libs = %{version}-%{release} @@ -115,7 +111,7 @@ 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.11.1 -p1 +%autosetup -n multipath-tools-0.13.0 -p1 cp %{SOURCE1} . %build @@ -167,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* @@ -237,6 +234,13 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Tue Nov 4 2025 Benjamin Marzinski - 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 - 0.11.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild diff --git a/sources b/sources index 5eea94e..233c4ea 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (multipath-tools-0.11.1.tgz) = ac6bacd725bc831a140b75a72c81296eb1ed4080fb6350caf6178914d1bdce743705f3bd4e31f318068f6272dc98e12d63ee38228a3521a3d1c7bc8eb30812f9 +SHA512 (multipath-tools-0.13.0.tgz) = 75c84524ee27590b8b751ea500898a44e5ac3d58d55be6bcab919d0d423049db3a4466fcb9135705cf63ba074416973bb651255063269e9f682f11d21ba57e59 SHA512 (multipath.conf) = 71953dce5a68adcf60a942305f5a66023e6f4c4baf53b1bfdb4edf65ed5b8e03db804363c36d1dcfd85591f4766f52b515269904c53b84d7b076da0b80b09942 From d6f2be9e59baa23b2d610a68d3635da3d5b6b991 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Thu, 13 Nov 2025 19:23:18 -0500 Subject: [PATCH 19/19] device-mapper-multipath-0.13.0-2 Move STI tests to TMT --- {tests/.fmf => .fmf}/version | 0 device-mapper-multipath.spec | 5 +++- plans/multipath.fmf | 58 ++++++++++++++++++++++++++++++++++++ tests/provision.fmf | 5 ---- tests/tests.yml | 44 --------------------------- 5 files changed, 62 insertions(+), 50 deletions(-) rename {tests/.fmf => .fmf}/version (100%) create mode 100644 plans/multipath.fmf delete mode 100644 tests/provision.fmf delete mode 100644 tests/tests.yml diff --git a/tests/.fmf/version b/.fmf/version similarity index 100% rename from tests/.fmf/version rename to .fmf/version diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 24b00bd..5d80d4e 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.13.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tools to manage multipath devices using device-mapper # readline uses GPL-3.0-only License: GPL-2.0-only AND GPL-3.0-only @@ -234,6 +234,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Thu Nov 13 2025 Benjamin Marzinski - 0.13.0-2 +- Move STI tests to TMT + * Tue Nov 4 2025 Benjamin Marzinski - 0.13.0-1 - Update source to upstream release 0.13.0 * Previous patches 0001-0004 are included in the tarball diff --git a/plans/multipath.fmf b/plans/multipath.fmf new file mode 100644 index 0000000..876c77a --- /dev/null +++ b/plans/multipath.fmf @@ -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 diff --git a/tests/provision.fmf b/tests/provision.fmf deleted file mode 100644 index 62a6eba..0000000 --- a/tests/provision.fmf +++ /dev/null @@ -1,5 +0,0 @@ ---- - -standard-inventory-qcow2: - qemu: - m: 2G diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 15f26d2..0000000 --- a/tests/tests.yml +++ /dev/null @@ -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