From 1f02b04a6455530d8f79760b3882a7e80adf15c5 Mon Sep 17 00:00:00 2001 From: anolis-bot Date: Thu, 27 Oct 2022 18:06:18 +0800 Subject: [PATCH 1/2] update to device-mapper-multipath-0.8.4-22.el8_6.2 Signed-off-by: anolis-bot --- 0001-modify-OPTFLAGS-for-loongarch64.patch | 41 ----- ...e-duplicated-multipathd-command-keys.patch | 153 ++++++++++++++++++ device-mapper-multipath.spec | 11 +- dist | 1 + 4 files changed, 159 insertions(+), 47 deletions(-) delete mode 100644 0001-modify-OPTFLAGS-for-loongarch64.patch create mode 100644 0092-multipathd-ignore-duplicated-multipathd-command-keys.patch create mode 100644 dist diff --git a/0001-modify-OPTFLAGS-for-loongarch64.patch b/0001-modify-OPTFLAGS-for-loongarch64.patch deleted file mode 100644 index 736d87e..0000000 --- a/0001-modify-OPTFLAGS-for-loongarch64.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 5b0ad487a46a47784f1d830b4717dcf2aec1854d Mon Sep 17 00:00:00 2001 -From: zhangwenlong -Date: Thu, 23 Sep 2021 08:08:14 +0000 -Subject: [PATCH] modify OPTFLAGS for loongarch64 - ---- - Makefile.inc | 18 +++++++++++++----- - 1 file changed, 13 insertions(+), 5 deletions(-) - -diff --git a/Makefile.inc b/Makefile.inc -index 220009e..1472e4f 100644 ---- a/Makefile.inc -+++ b/Makefile.inc -@@ -106,11 +106,19 @@ ifndef RPM_OPT_FLAGS - else - OPTFLAGS = $(RPM_OPT_FLAGS) - endif --OPTFLAGS += -Werror -Wextra -Wstrict-prototypes -Wformat=2 \ -- -Werror=implicit-int -Werror=implicit-function-declaration \ -- $(WNOCLOBBERED) \ -- -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ -- --param=ssp-buffer-size=4 -+ifeq ($(shell uname -m),loongarch64) -+ OPTFLAGS += -Wextra -Wstrict-prototypes -Wformat=2 \ -+ -Werror=implicit-int -Werror=implicit-function-declaration \ -+ $(WNOCLOBBERED) \ -+ -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ -+ --param=ssp-buffer-size=4 -+else -+ OPTFLAGS += -Werror -Wextra -Wstrict-prototypes -Wformat=2 \ -+ -Werror=implicit-int -Werror=implicit-function-declaration \ -+ $(WNOCLOBBERED) \ -+ -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ -+ --param=ssp-buffer-size=4 -+endif - - CFLAGS := $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \ - -MMD -MP $(CFLAGS) --- -2.27.0 - diff --git a/0092-multipathd-ignore-duplicated-multipathd-command-keys.patch b/0092-multipathd-ignore-duplicated-multipathd-command-keys.patch new file mode 100644 index 0000000..8053b04 --- /dev/null +++ b/0092-multipathd-ignore-duplicated-multipathd-command-keys.patch @@ -0,0 +1,153 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 8 Sep 2022 11:54:49 -0500 +Subject: [PATCH] multipathd: ignore duplicated multipathd command keys + +multipath adds rather than or-s the values of command keys. Fix this. +Also, return an invalid fingerprint if a key is used more than once. + +Signed-off-by: Benjamin Marzinski +--- + multipathd/cli.c | 8 ++-- + multipathd/main.c | 106 +++++++++++++++++++++++----------------------- + 2 files changed, 58 insertions(+), 56 deletions(-) + +diff --git a/multipathd/cli.c b/multipathd/cli.c +index bdc9fb10..a411680e 100644 +--- a/multipathd/cli.c ++++ b/multipathd/cli.c +@@ -336,9 +336,11 @@ fingerprint(vector vec) + if (!vec) + return 0; + +- vector_foreach_slot(vec, kw, i) +- fp += kw->code; +- ++ vector_foreach_slot(vec, kw, i) { ++ if (fp & kw->code) ++ return (uint64_t)-1; ++ fp |= kw->code; ++ } + return fp; + } + +diff --git a/multipathd/main.c b/multipathd/main.c +index eeded52b..6106204d 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -1625,62 +1625,62 @@ uxlsnrloop (void * ap) + /* Tell main thread that thread has started */ + post_config_state(DAEMON_CONFIGURE); + +- set_handler_callback(LIST+PATHS, cli_list_paths); +- set_handler_callback(LIST+PATHS+FMT, cli_list_paths_fmt); +- set_handler_callback(LIST+PATHS+RAW+FMT, cli_list_paths_raw); +- set_handler_callback(LIST+PATH, cli_list_path); +- set_handler_callback(LIST+MAPS, cli_list_maps); +- set_handler_callback(LIST+STATUS, cli_list_status); +- set_unlocked_handler_callback(LIST+DAEMON, cli_list_daemon); +- set_handler_callback(LIST+MAPS+STATUS, cli_list_maps_status); +- set_handler_callback(LIST+MAPS+STATS, cli_list_maps_stats); +- set_handler_callback(LIST+MAPS+FMT, cli_list_maps_fmt); +- set_handler_callback(LIST+MAPS+RAW+FMT, cli_list_maps_raw); +- set_handler_callback(LIST+MAPS+TOPOLOGY, cli_list_maps_topology); +- set_handler_callback(LIST+TOPOLOGY, cli_list_maps_topology); +- set_handler_callback(LIST+MAPS+JSON, cli_list_maps_json); +- set_handler_callback(LIST+MAP+TOPOLOGY, cli_list_map_topology); +- set_handler_callback(LIST+MAP+FMT, cli_list_map_fmt); +- set_handler_callback(LIST+MAP+RAW+FMT, cli_list_map_fmt); +- set_handler_callback(LIST+MAP+JSON, cli_list_map_json); +- set_handler_callback(LIST+CONFIG+LOCAL, cli_list_config_local); +- set_handler_callback(LIST+CONFIG, cli_list_config); +- set_handler_callback(LIST+BLACKLIST, cli_list_blacklist); +- set_handler_callback(LIST+DEVICES, cli_list_devices); +- set_handler_callback(LIST+WILDCARDS, cli_list_wildcards); +- set_handler_callback(RESET+MAPS+STATS, cli_reset_maps_stats); +- set_handler_callback(RESET+MAP+STATS, cli_reset_map_stats); +- set_handler_callback(ADD+PATH, cli_add_path); +- set_handler_callback(DEL+PATH, cli_del_path); +- set_handler_callback(ADD+MAP, cli_add_map); +- set_handler_callback(DEL+MAP, cli_del_map); +- set_handler_callback(DEL+MAPS, cli_del_maps); +- set_handler_callback(SWITCH+MAP+GROUP, cli_switch_group); ++ set_handler_callback(LIST|PATHS, cli_list_paths); ++ set_handler_callback(LIST|PATHS|FMT, cli_list_paths_fmt); ++ set_handler_callback(LIST|PATHS|RAW|FMT, cli_list_paths_raw); ++ set_handler_callback(LIST|PATH, cli_list_path); ++ set_handler_callback(LIST|MAPS, cli_list_maps); ++ set_handler_callback(LIST|STATUS, cli_list_status); ++ set_unlocked_handler_callback(LIST|DAEMON, cli_list_daemon); ++ set_handler_callback(LIST|MAPS|STATUS, cli_list_maps_status); ++ set_handler_callback(LIST|MAPS|STATS, cli_list_maps_stats); ++ set_handler_callback(LIST|MAPS|FMT, cli_list_maps_fmt); ++ set_handler_callback(LIST|MAPS|RAW|FMT, cli_list_maps_raw); ++ set_handler_callback(LIST|MAPS|TOPOLOGY, cli_list_maps_topology); ++ set_handler_callback(LIST|TOPOLOGY, cli_list_maps_topology); ++ set_handler_callback(LIST|MAPS|JSON, cli_list_maps_json); ++ set_handler_callback(LIST|MAP|TOPOLOGY, cli_list_map_topology); ++ set_handler_callback(LIST|MAP|FMT, cli_list_map_fmt); ++ set_handler_callback(LIST|MAP|RAW|FMT, cli_list_map_fmt); ++ set_handler_callback(LIST|MAP|JSON, cli_list_map_json); ++ set_handler_callback(LIST|CONFIG|LOCAL, cli_list_config_local); ++ set_handler_callback(LIST|CONFIG, cli_list_config); ++ set_handler_callback(LIST|BLACKLIST, cli_list_blacklist); ++ set_handler_callback(LIST|DEVICES, cli_list_devices); ++ set_handler_callback(LIST|WILDCARDS, cli_list_wildcards); ++ set_handler_callback(RESET|MAPS|STATS, cli_reset_maps_stats); ++ set_handler_callback(RESET|MAP|STATS, cli_reset_map_stats); ++ set_handler_callback(ADD|PATH, cli_add_path); ++ set_handler_callback(DEL|PATH, cli_del_path); ++ set_handler_callback(ADD|MAP, cli_add_map); ++ set_handler_callback(DEL|MAP, cli_del_map); ++ set_handler_callback(DEL|MAPS, cli_del_maps); ++ set_handler_callback(SWITCH|MAP|GROUP, cli_switch_group); + set_unlocked_handler_callback(RECONFIGURE, cli_reconfigure); +- set_handler_callback(SUSPEND+MAP, cli_suspend); +- set_handler_callback(RESUME+MAP, cli_resume); +- set_handler_callback(RESIZE+MAP, cli_resize); +- set_handler_callback(RELOAD+MAP, cli_reload); +- set_handler_callback(RESET+MAP, cli_reassign); +- set_handler_callback(REINSTATE+PATH, cli_reinstate); +- set_handler_callback(FAIL+PATH, cli_fail); +- set_handler_callback(DISABLEQ+MAP, cli_disable_queueing); +- set_handler_callback(RESTOREQ+MAP, cli_restore_queueing); +- set_handler_callback(DISABLEQ+MAPS, cli_disable_all_queueing); +- set_handler_callback(RESTOREQ+MAPS, cli_restore_all_queueing); ++ set_handler_callback(SUSPEND|MAP, cli_suspend); ++ set_handler_callback(RESUME|MAP, cli_resume); ++ set_handler_callback(RESIZE|MAP, cli_resize); ++ set_handler_callback(RELOAD|MAP, cli_reload); ++ set_handler_callback(RESET|MAP, cli_reassign); ++ set_handler_callback(REINSTATE|PATH, cli_reinstate); ++ set_handler_callback(FAIL|PATH, cli_fail); ++ set_handler_callback(DISABLEQ|MAP, cli_disable_queueing); ++ set_handler_callback(RESTOREQ|MAP, cli_restore_queueing); ++ set_handler_callback(DISABLEQ|MAPS, cli_disable_all_queueing); ++ set_handler_callback(RESTOREQ|MAPS, cli_restore_all_queueing); + set_unlocked_handler_callback(QUIT, cli_quit); + set_unlocked_handler_callback(SHUTDOWN, cli_shutdown); +- set_handler_callback(GETPRSTATUS+MAP, cli_getprstatus); +- set_handler_callback(SETPRSTATUS+MAP, cli_setprstatus); +- set_handler_callback(UNSETPRSTATUS+MAP, cli_unsetprstatus); +- set_handler_callback(FORCEQ+DAEMON, cli_force_no_daemon_q); +- set_handler_callback(RESTOREQ+DAEMON, cli_restore_no_daemon_q); +- set_handler_callback(GETPRKEY+MAP, cli_getprkey); +- set_handler_callback(SETPRKEY+MAP+KEY, cli_setprkey); +- set_handler_callback(UNSETPRKEY+MAP, cli_unsetprkey); +- set_handler_callback(SETMARGINAL+PATH, cli_set_marginal); +- set_handler_callback(UNSETMARGINAL+PATH, cli_unset_marginal); +- set_handler_callback(UNSETMARGINAL+MAP, cli_unset_all_marginal); ++ set_handler_callback(GETPRSTATUS|MAP, cli_getprstatus); ++ set_handler_callback(SETPRSTATUS|MAP, cli_setprstatus); ++ set_handler_callback(UNSETPRSTATUS|MAP, cli_unsetprstatus); ++ set_handler_callback(FORCEQ|DAEMON, cli_force_no_daemon_q); ++ set_handler_callback(RESTOREQ|DAEMON, cli_restore_no_daemon_q); ++ set_handler_callback(GETPRKEY|MAP, cli_getprkey); ++ set_handler_callback(SETPRKEY|MAP|KEY, cli_setprkey); ++ set_handler_callback(UNSETPRKEY|MAP, cli_unsetprkey); ++ set_handler_callback(SETMARGINAL|PATH, cli_set_marginal); ++ set_handler_callback(UNSETMARGINAL|PATH, cli_unset_marginal); ++ set_handler_callback(UNSETMARGINAL|MAP, cli_unset_all_marginal); + + umask(077); + uxsock_listen(&uxsock_trigger, ux_sock, ap); diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index b38b2b3..9493d5e 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,8 +1,7 @@ -%define anolis_release .0.1 Summary: Tools to manage multipath devices using device-mapper Name: device-mapper-multipath Version: 0.8.4 -Release: 22%{anolis_release}%{?dist}.1 +Release: 22%{?dist}.2 License: GPLv2 Group: System Environment/Base URL: http://christophe.varoqui.free.fr/ @@ -103,8 +102,7 @@ Patch00088: 0088-libmultipath-make-helper-function-to-trigger-path-ue.patch Patch00089: 0089-multipathd-trigger-udev-change-on-path-addition.patch Patch00090: 0090-RH-add-support-to-mpathconf-for-setting-arbitrary-de.patch Patch00091: 0091-multipath-tools-update-mpp-force_readonly-in-ev_add_.patch - -Patch00100: 0001-modify-OPTFLAGS-for-loongarch64.patch +Patch00092: 0092-multipathd-ignore-duplicated-multipathd-command-keys.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -306,8 +304,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog -* Thu Aug 4 2022 zhangwenlong 0.8.4-22.0.1.1 -- Add loongarch64 support for device-mapper-multipath +* Thu Oct 13 2022 Benjamin Marzinski 0.8.4-22.2 +- Add 0092-multipathd-ignore-duplicated-multipathd-command-keys.patch +- Resolves: bz #2133994 * Tue Jun 7 2022 Benjamin Marzinski 0.8.4-22.1 - Add 0091-multipath-tools-update-mpp-force_readonly-in-ev_add_.patch diff --git a/dist b/dist new file mode 100644 index 0000000..0ee7539 --- /dev/null +++ b/dist @@ -0,0 +1 @@ +an8_6 -- Gitee From 96856821a22dcb399a7b9cad795278506d739435 Mon Sep 17 00:00:00 2001 From: zhangwenlong Date: Wed, 22 Sep 2021 23:46:15 -0400 Subject: [PATCH 2/2] build: Add loongarch64 support for device-mapper-multipath Signed-off-by: zhangwenlong --- 0001-modify-OPTFLAGS-for-loongarch64.patch | 41 ++++++++++++++++++++++ device-mapper-multipath.spec | 8 ++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0001-modify-OPTFLAGS-for-loongarch64.patch diff --git a/0001-modify-OPTFLAGS-for-loongarch64.patch b/0001-modify-OPTFLAGS-for-loongarch64.patch new file mode 100644 index 0000000..736d87e --- /dev/null +++ b/0001-modify-OPTFLAGS-for-loongarch64.patch @@ -0,0 +1,41 @@ +From 5b0ad487a46a47784f1d830b4717dcf2aec1854d Mon Sep 17 00:00:00 2001 +From: zhangwenlong +Date: Thu, 23 Sep 2021 08:08:14 +0000 +Subject: [PATCH] modify OPTFLAGS for loongarch64 + +--- + Makefile.inc | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git a/Makefile.inc b/Makefile.inc +index 220009e..1472e4f 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -106,11 +106,19 @@ ifndef RPM_OPT_FLAGS + else + OPTFLAGS = $(RPM_OPT_FLAGS) + endif +-OPTFLAGS += -Werror -Wextra -Wstrict-prototypes -Wformat=2 \ +- -Werror=implicit-int -Werror=implicit-function-declaration \ +- $(WNOCLOBBERED) \ +- -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ +- --param=ssp-buffer-size=4 ++ifeq ($(shell uname -m),loongarch64) ++ OPTFLAGS += -Wextra -Wstrict-prototypes -Wformat=2 \ ++ -Werror=implicit-int -Werror=implicit-function-declaration \ ++ $(WNOCLOBBERED) \ ++ -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ ++ --param=ssp-buffer-size=4 ++else ++ OPTFLAGS += -Werror -Wextra -Wstrict-prototypes -Wformat=2 \ ++ -Werror=implicit-int -Werror=implicit-function-declaration \ ++ $(WNOCLOBBERED) \ ++ -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ ++ --param=ssp-buffer-size=4 ++endif + + CFLAGS := $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \ + -MMD -MP $(CFLAGS) +-- +2.27.0 + diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 9493d5e..cb44f39 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,7 +1,8 @@ +%define anolis_release .0.1 Summary: Tools to manage multipath devices using device-mapper Name: device-mapper-multipath Version: 0.8.4 -Release: 22%{?dist}.2 +Release: 22%{anolis_release}%{?dist}.2 License: GPLv2 Group: System Environment/Base URL: http://christophe.varoqui.free.fr/ @@ -104,6 +105,8 @@ Patch00090: 0090-RH-add-support-to-mpathconf-for-setting-arbitrary-de.patch Patch00091: 0091-multipath-tools-update-mpp-force_readonly-in-ev_add_.patch Patch00092: 0092-multipathd-ignore-duplicated-multipathd-command-keys.patch +Patch00100: 0001-modify-OPTFLAGS-for-loongarch64.patch + # runtime Requires: %{name}-libs = %{version}-%{release} Requires: kpartx = %{version}-%{release} @@ -304,6 +307,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Fri Oct 28 2022 zhangwenlong 0.8.4-22.0.1.2 +- Add loongarch64 support for device-mapper-multipath + * Thu Oct 13 2022 Benjamin Marzinski 0.8.4-22.2 - Add 0092-multipathd-ignore-duplicated-multipathd-command-keys.patch - Resolves: bz #2133994 -- Gitee