From 759e2aef1bd52c8af3bec0b5dc912c2c4148a4ed Mon Sep 17 00:00:00 2001 From: Jacob Wang Date: Wed, 30 Apr 2025 17:26:17 +0800 Subject: [PATCH 1/4] [BUG]update to device-mapper-multipath-0.8.4-42 to #IC58HE update to device-mapper-multipath-0.8.4-42 for bugfix Signed-off-by: Jacob Wang --- 0001-modify-OPTFLAGS-for-loongarch64.patch | 41 ------------------- ...eign-fix-memory-leak-in-nvme-foreign.patch | 37 +++++++++++++++++ ...c-2.34-commit-5d98a7da-PTHREAD_STACK.patch | 34 --------------- 2001-modify-OPTFLAGS-for-sw_64.patch | 31 -------------- device-mapper-multipath.spec | 15 +++---- dist | 2 +- download | 0 7 files changed, 43 insertions(+), 117 deletions(-) delete mode 100644 0001-modify-OPTFLAGS-for-loongarch64.patch create mode 100644 0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch delete mode 100644 2000-Starting-in-glibc-2.34-commit-5d98a7da-PTHREAD_STACK.patch delete mode 100644 2001-modify-OPTFLAGS-for-sw_64.patch delete mode 100644 download diff --git a/0001-modify-OPTFLAGS-for-loongarch64.patch b/0001-modify-OPTFLAGS-for-loongarch64.patch deleted file mode 100644 index b87ca34..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}\" -DRUNTIME_DIR=\"$(runtimedir)\" \ - -MMD -MP $(CFLAGS) --- -2.27.0 - diff --git a/0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch b/0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch new file mode 100644 index 0000000..7d2c1d3 --- /dev/null +++ b/0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Mon, 6 Jan 2025 19:57: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. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/foreign/nvme.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c +index 5feb1e95..1d48b08d 100644 +--- a/libmultipath/foreign/nvme.c ++++ b/libmultipath/foreign/nvme.c +@@ -697,6 +697,7 @@ static void _find_controllers(struct context *ctx, struct nvme_map *map) + path = _find_path_by_syspath(map, + udev_device_get_syspath(udev)); + if (path != NULL) { ++ udev_device_unref(udev); + path->seen = true; + condlog(4, "%s: %s already known", + __func__, fn); +@@ -704,8 +705,10 @@ static void _find_controllers(struct context *ctx, struct nvme_map *map) + } + + path = calloc(1, sizeof(*path)); +- if (path == NULL) ++ if (path == NULL) { ++ udev_device_unref(udev); + continue; ++ } + + path->gen.ops = &nvme_path_ops; + path->udev = udev; diff --git a/2000-Starting-in-glibc-2.34-commit-5d98a7da-PTHREAD_STACK.patch b/2000-Starting-in-glibc-2.34-commit-5d98a7da-PTHREAD_STACK.patch deleted file mode 100644 index c91fb23..0000000 --- a/2000-Starting-in-glibc-2.34-commit-5d98a7da-PTHREAD_STACK.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0fbe82aec2f920930d8ccbf697b125ccc922631c Mon Sep 17 00:00:00 2001 -From: Weisson -Date: Tue, 17 Oct 2023 17:08:08 +0800 -Subject: [PATCH] Starting in glibc-2.34 (commit 5d98a7da), PTHREAD_STACK_MIN - is defined as sysconf(_SC_THREAD_STACK_MIN) if _GNU_SOURCE is defined. - sysconf() returns a long and can, at least in theory, return -1. This change - causes compilation to fail in setup_thread_attr() due to a comparision with - different signedness, since stacksize is a size_t. - -from upstream: #5d9f01cb6650c5024bf6c70ade7936e9c71ed9b9 - -Signed-off-by: Weisson ---- - libmultipath/util.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libmultipath/util.c b/libmultipath/util.c -index e04d20a..7a5a09b 100644 ---- a/libmultipath/util.c -+++ b/libmultipath/util.c -@@ -279,8 +279,8 @@ setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached) - - ret = pthread_attr_init(attr); - assert(ret == 0); -- if (stacksize < PTHREAD_STACK_MIN) -- stacksize = PTHREAD_STACK_MIN; -+ if (PTHREAD_STACK_MIN > 0 && stacksize < (size_t)PTHREAD_STACK_MIN) -+ stacksize = (size_t)PTHREAD_STACK_MIN; - ret = pthread_attr_setstacksize(attr, stacksize); - assert(ret == 0); - if (detached) { --- -2.31.1 - diff --git a/2001-modify-OPTFLAGS-for-sw_64.patch b/2001-modify-OPTFLAGS-for-sw_64.patch deleted file mode 100644 index f743a1f..0000000 --- a/2001-modify-OPTFLAGS-for-sw_64.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 843b61b784ebc369a0e91bf4b95ccd41d21d8e17 Mon Sep 17 00:00:00 2001 -From: Weisson -Date: Mon, 24 Jun 2024 11:47:17 +0800 -Subject: [PATCH] modify OPTFLAGS for sw_64. - -Signed-off-by: Weisson -Signed-off-by: rpm-build ---- - Makefile.inc | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/Makefile.inc b/Makefile.inc -index cd68e8d..e595e73 100644 ---- a/Makefile.inc -+++ b/Makefile.inc -@@ -119,6 +119,12 @@ ifeq ($(shell uname -m),loongarch64) - $(WNOCLOBBERED) \ - -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ - --param=ssp-buffer-size=4 -+else ifeq ($(shell uname -m),sw_64) -+ 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 \ --- -2.31.1 - diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 6c2ef6f..004b3d4 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: 41%{anolis_release}%{?dist} +Release: 42%{?dist} License: GPLv2 Group: System Environment/Base URL: http://christophe.varoqui.free.fr/ @@ -149,10 +148,7 @@ Patch00134: 0134-multipathd-handle-no-active-paths-in-update_map_pr.patch Patch00135: 0135-libmpathpersist-fix-resource-leak-in-update_map_pr.patch Patch00136: 0136-multipathd-Added-support-to-handle-FPIN-Li-events-fo.patch Patch00137: 0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch - -Patch01000: 0001-modify-OPTFLAGS-for-loongarch64.patch -Patch02000: 2000-Starting-in-glibc-2.34-commit-5d98a7da-PTHREAD_STACK.patch -Patch02001: 2001-modify-OPTFLAGS-for-sw_64.patch +Patch00138: 0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -357,10 +353,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog -* Thu Jul 18 2024 zhangwenlong 0.8.4-41.0.1 -- Add loongarch64 support for device-mapper-multipath -- cherry-pick `fix the problem comparison of integer expressions of different signedness`.(Weisson@linux.alibaba.com) -- modify OPTFLAGS for sw_64.(Weisson@linux.alibaba.com) +* Thu Jan 9 2025 Benjamin Marzinski 0.8.4-42 +- Add 0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch +- Resolves: RHEL-72573 * Fri Jan 5 2024 Benjamin Marzinski 0.8.4-41 - Add 0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch diff --git a/dist b/dist index 9c0e36e..1fe92cf 100644 --- a/dist +++ b/dist @@ -1 +1 @@ -an8 +an8_10 diff --git a/download b/download deleted file mode 100644 index e69de29..0000000 -- Gitee From 6d2a0ce183f0a59a9654d0e296ba2774aa5b83dd Mon Sep 17 00:00:00 2001 From: zhangwenlong Date: Wed, 22 Sep 2021 23:46:15 -0400 Subject: [PATCH 2/4] 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..b87ca34 --- /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}\" -DRUNTIME_DIR=\"$(runtimedir)\" \ + -MMD -MP $(CFLAGS) +-- +2.27.0 + diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 004b3d4..ab804b7 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: 42%{?dist} +Release: 42%{anolis_release}%{?dist} License: GPLv2 Group: System Environment/Base URL: http://christophe.varoqui.free.fr/ @@ -150,6 +151,8 @@ Patch00136: 0136-multipathd-Added-support-to-handle-FPIN-Li-events-fo.patch Patch00137: 0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch Patch00138: 0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch +Patch01000: 0001-modify-OPTFLAGS-for-loongarch64.patch + # runtime Requires: %{name}-libs = %{version}-%{release} Requires: kpartx = %{version}-%{release} @@ -353,6 +356,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Wed Apr 30 2025 zhangwenlong 0.8.4-42.0.1 +- Add loongarch64 support for device-mapper-multipath + * Thu Jan 9 2025 Benjamin Marzinski 0.8.4-42 - Add 0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch - Resolves: RHEL-72573 -- Gitee From 76e94f64573aa880be9cfb19a667093f60ef4139 Mon Sep 17 00:00:00 2001 From: Weisson Date: Tue, 17 Oct 2023 17:29:36 +0800 Subject: [PATCH 3/4] cherry-pick `fix the problem comparison of integer expressions of different signedness`. Starting in glibc-2.34 (commit 5d98a7da), PTHREAD_STACK_MIN is defined as sysconf(_SC_THREAD_STACK_MIN) if _GNU_SOURCE is defined. sysconf() returns a long and can, at least in theory, return -1. This change causes compilation to fail in setup_thread_attr() due to a comparision with different signedness, since stacksize is a size_t. Signed-off-by: Weisson --- ...c-2.34-commit-5d98a7da-PTHREAD_STACK.patch | 34 +++++++++++++++++++ device-mapper-multipath.spec | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 2000-Starting-in-glibc-2.34-commit-5d98a7da-PTHREAD_STACK.patch diff --git a/2000-Starting-in-glibc-2.34-commit-5d98a7da-PTHREAD_STACK.patch b/2000-Starting-in-glibc-2.34-commit-5d98a7da-PTHREAD_STACK.patch new file mode 100644 index 0000000..c91fb23 --- /dev/null +++ b/2000-Starting-in-glibc-2.34-commit-5d98a7da-PTHREAD_STACK.patch @@ -0,0 +1,34 @@ +From 0fbe82aec2f920930d8ccbf697b125ccc922631c Mon Sep 17 00:00:00 2001 +From: Weisson +Date: Tue, 17 Oct 2023 17:08:08 +0800 +Subject: [PATCH] Starting in glibc-2.34 (commit 5d98a7da), PTHREAD_STACK_MIN + is defined as sysconf(_SC_THREAD_STACK_MIN) if _GNU_SOURCE is defined. + sysconf() returns a long and can, at least in theory, return -1. This change + causes compilation to fail in setup_thread_attr() due to a comparision with + different signedness, since stacksize is a size_t. + +from upstream: #5d9f01cb6650c5024bf6c70ade7936e9c71ed9b9 + +Signed-off-by: Weisson +--- + libmultipath/util.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libmultipath/util.c b/libmultipath/util.c +index e04d20a..7a5a09b 100644 +--- a/libmultipath/util.c ++++ b/libmultipath/util.c +@@ -279,8 +279,8 @@ setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached) + + ret = pthread_attr_init(attr); + assert(ret == 0); +- if (stacksize < PTHREAD_STACK_MIN) +- stacksize = PTHREAD_STACK_MIN; ++ if (PTHREAD_STACK_MIN > 0 && stacksize < (size_t)PTHREAD_STACK_MIN) ++ stacksize = (size_t)PTHREAD_STACK_MIN; + ret = pthread_attr_setstacksize(attr, stacksize); + assert(ret == 0); + if (detached) { +-- +2.31.1 + diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index ab804b7..5cd7665 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -152,6 +152,7 @@ Patch00137: 0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch Patch00138: 0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch Patch01000: 0001-modify-OPTFLAGS-for-loongarch64.patch +Patch02000: 2000-Starting-in-glibc-2.34-commit-5d98a7da-PTHREAD_STACK.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -358,6 +359,7 @@ fi %changelog * Wed Apr 30 2025 zhangwenlong 0.8.4-42.0.1 - Add loongarch64 support for device-mapper-multipath +- cherry-pick `fix the problem comparison of integer expressions of different signedness`.(Weisson@linux.alibaba.com) * Thu Jan 9 2025 Benjamin Marzinski 0.8.4-42 - Add 0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch -- Gitee From f2d0e29017a02093afbc3e8a470fe108723fc6c0 Mon Sep 17 00:00:00 2001 From: Weisson Date: Mon, 24 Jun 2024 14:06:28 +0800 Subject: [PATCH 4/4] modify OPTFLAGS for sw_64. Signed-off-by: Weisson --- 2001-modify-OPTFLAGS-for-sw_64.patch | 31 ++++++++++++++++++++++++++++ device-mapper-multipath.spec | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 2001-modify-OPTFLAGS-for-sw_64.patch diff --git a/2001-modify-OPTFLAGS-for-sw_64.patch b/2001-modify-OPTFLAGS-for-sw_64.patch new file mode 100644 index 0000000..f743a1f --- /dev/null +++ b/2001-modify-OPTFLAGS-for-sw_64.patch @@ -0,0 +1,31 @@ +From 843b61b784ebc369a0e91bf4b95ccd41d21d8e17 Mon Sep 17 00:00:00 2001 +From: Weisson +Date: Mon, 24 Jun 2024 11:47:17 +0800 +Subject: [PATCH] modify OPTFLAGS for sw_64. + +Signed-off-by: Weisson +Signed-off-by: rpm-build +--- + Makefile.inc | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/Makefile.inc b/Makefile.inc +index cd68e8d..e595e73 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -119,6 +119,12 @@ ifeq ($(shell uname -m),loongarch64) + $(WNOCLOBBERED) \ + -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ + --param=ssp-buffer-size=4 ++else ifeq ($(shell uname -m),sw_64) ++ 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 \ +-- +2.31.1 + diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 5cd7665..d15e264 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -153,6 +153,7 @@ Patch00138: 0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch Patch01000: 0001-modify-OPTFLAGS-for-loongarch64.patch Patch02000: 2000-Starting-in-glibc-2.34-commit-5d98a7da-PTHREAD_STACK.patch +Patch02001: 2001-modify-OPTFLAGS-for-sw_64.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -360,6 +361,7 @@ fi * Wed Apr 30 2025 zhangwenlong 0.8.4-42.0.1 - Add loongarch64 support for device-mapper-multipath - cherry-pick `fix the problem comparison of integer expressions of different signedness`.(Weisson@linux.alibaba.com) +- modify OPTFLAGS for sw_64.(Weisson@linux.alibaba.com) * Thu Jan 9 2025 Benjamin Marzinski 0.8.4-42 - Add 0138-libmultipath-foreign-fix-memory-leak-in-nvme-foreign.patch -- Gitee