From 86e230d4a6eec956860f09c0384c608c0bc3466d Mon Sep 17 00:00:00 2001 From: Zhao Hang Date: Thu, 18 Jul 2024 14:10:56 +0800 Subject: [PATCH 1/4] update to device-mapper-multipath-0.8.4-41.src.rpm Signed-off-by: Zhao Hang --- 0001-modify-OPTFLAGS-for-loongarch64.patch | 41 --- ...-support-to-handle-FPIN-Li-events-fo.patch | 300 ++++++++++++++++++ ...sure-to-disable-queueing-if-recovery.patch | 76 +++++ ...c-2.34-commit-5d98a7da-PTHREAD_STACK.patch | 34 -- 2001-modify-OPTFLAGS-for-sw_64.patch | 31 -- device-mapper-multipath.spec | 26 +- 6 files changed, 388 insertions(+), 120 deletions(-) delete mode 100644 0001-modify-OPTFLAGS-for-loongarch64.patch create mode 100644 0136-multipathd-Added-support-to-handle-FPIN-Li-events-fo.patch create mode 100644 0137-multipathd-Make-sure-to-disable-queueing-if-recovery.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 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/0136-multipathd-Added-support-to-handle-FPIN-Li-events-fo.patch b/0136-multipathd-Added-support-to-handle-FPIN-Li-events-fo.patch new file mode 100644 index 0000000..1e593f7 --- /dev/null +++ b/0136-multipathd-Added-support-to-handle-FPIN-Li-events-fo.patch @@ -0,0 +1,300 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Muneendra +Date: Wed, 20 Sep 2023 20:41:15 -0700 +Subject: [PATCH] multipathd: Added support to handle FPIN-Li events for + FC-NVMe + + This patch adds the support to handle FPIN-Li for FC-NVMe. + On receiving the FPIN-Li events this patch moves the devices paths + which are affected due to link integrity to marginal path groups. + The paths which are set to marginal path group will be unset + on receiving the RSCN events + +(mwilck: minor compile fix for 32-bit architectures) + +Signed-off-by: Muneendra +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + multipathd/fpin_handlers.c | 206 +++++++++++++++++++++++++++---------- + 1 file changed, 151 insertions(+), 55 deletions(-) + +diff --git a/multipathd/fpin_handlers.c b/multipathd/fpin_handlers.c +index 599f2893..6b90cded 100644 +--- a/multipathd/fpin_handlers.c ++++ b/multipathd/fpin_handlers.c +@@ -60,18 +60,15 @@ static void _udev_device_unref(void *p) + + + /*set/unset the path state to marginal*/ +-static int fpin_set_pathstate(struct path *pp, bool set) ++static void fpin_set_pathstate(struct path *pp, bool set) + { + const char *action = set ? "set" : "unset"; + +- if (!pp || !pp->mpp || !pp->mpp->alias) +- return -1; +- +- condlog(3, "\n%s: %s marginal path %s (fpin)", +- action, pp->mpp->alias, pp->dev_t); ++ condlog(3, "%s: %s marginal path %s (fpin)", ++ pp->mpp ? pp->mpp->alias : "orphan", action, pp->dev_t); + pp->marginal = set; +- pp->mpp->fpin_must_reload = true; +- return 0; ++ if (pp->mpp) ++ pp->mpp->fpin_must_reload = true; + } + + /* This will unset marginal state of a device*/ +@@ -82,14 +79,14 @@ static void fpin_path_unsetmarginal(char *devname, struct vectors *vecs) + pp = find_path_by_dev(vecs->pathvec, devname); + if (!pp) + pp = find_path_by_devt(vecs->pathvec, devname); +- +- fpin_set_pathstate(pp, false); ++ if (pp) ++ fpin_set_pathstate(pp, false); + } + + /*This will set the marginal state of a device*/ +-static int fpin_path_setmarginal(struct path *pp) ++static void fpin_path_setmarginal(struct path *pp) + { +- return fpin_set_pathstate(pp, true); ++ fpin_set_pathstate(pp, true); + } + + /* Unsets all the devices in the list from marginal state */ +@@ -176,8 +173,8 @@ static void fpin_set_rport_marginal(struct udev_device *rport_dev) + "Marginal", strlen("Marginal")); + } + +-/*Add the marginal devices info into the list*/ +-static void ++/*Add the marginal devices info into the list and return 0 on success*/ ++static int + fpin_add_marginal_dev_info(uint32_t host_num, char *devname) + { + struct marginal_dev_list *newdev = NULL; +@@ -192,65 +189,160 @@ fpin_add_marginal_dev_info(uint32_t host_num, char *devname) + list_add_tail(&(newdev->node), + &fpin_li_marginal_dev_list_head); + pthread_mutex_unlock(&fpin_li_marginal_dev_mutex); +- } ++ } else ++ return -ENOMEM; ++ return 0; + } + + /* +- * This function goes through the vecs->pathvec, and for +- * each path, check that the host number, +- * the target WWPN associated with the path matches +- * with the els wwpn and sets the path and port state to ++ * This function compares Transport Address Controller Port pn, ++ * Host Transport Address Controller Port pn with the els wwpn ,attached_wwpn ++ * and return 1 (match) or 0 (no match) or a negative error code ++ */ ++static int extract_nvme_addresses_chk_path_pwwn(const char *address, ++ uint64_t els_wwpn, uint64_t els_attached_wwpn) ++ ++{ ++ uint64_t traddr; ++ uint64_t host_traddr; ++ ++ /* ++ * Find the position of "traddr=" and "host_traddr=" ++ * and the address will be in the below format ++ * "traddr=nn-0x200400110dff9400:pn-0x200400110dff9400, ++ * host_traddr=nn-0x200400110dff9400:pn-0x200400110dff9400" ++ */ ++ const char *traddr_start = strstr(address, "traddr="); ++ const char *host_traddr_start = strstr(address, "host_traddr="); ++ ++ if (!traddr_start || !host_traddr_start) ++ return -EINVAL; ++ ++ /* Extract traddr pn */ ++ if (sscanf(traddr_start, "traddr=nn-%*[^:]:pn-%" SCNx64, &traddr) != 1) ++ return -EINVAL; ++ ++ /* Extract host_traddr pn*/ ++ if (sscanf(host_traddr_start, "host_traddr=nn-%*[^:]:pn-%" SCNx64, ++ &host_traddr) != 1) ++ return -EINVAL; ++ condlog(4, "traddr 0x%" PRIx64 " hosttraddr 0x%" PRIx64 " els_wwpn 0x%" ++ PRIx64" els_host_traddr 0x%" PRIx64, ++ traddr, host_traddr, ++ els_wwpn, els_attached_wwpn); ++ if ((host_traddr == els_attached_wwpn) && (traddr == els_wwpn)) ++ return 1; ++ return 0; ++} ++ ++/* ++ * This function check that the Transport Address Controller Port pn, ++ * Host Transport Address Controller Port pn associated with the path matches ++ * with the els wwpn ,attached_wwpn and sets the path state to + * Marginal + */ +-static int fpin_chk_wwn_setpath_marginal(uint16_t host_num, struct vectors *vecs, ++static void fpin_check_set_nvme_path_marginal(uint16_t host_num, struct path *pp, ++ uint64_t els_wwpn, uint64_t attached_wwpn) ++{ ++ struct udev_device *ctl = NULL; ++ const char *address = NULL; ++ int ret = 0; ++ ++ ctl = udev_device_get_parent_with_subsystem_devtype(pp->udev, "nvme", NULL); ++ if (ctl == NULL) { ++ condlog(2, "%s: No parent device for ", pp->dev); ++ return; ++ } ++ address = udev_device_get_sysattr_value(ctl, "address"); ++ if (!address) { ++ condlog(2, "%s: unable to get the address ", pp->dev); ++ return; ++ } ++ condlog(4, "\n address %s: dev :%s\n", address, pp->dev); ++ ret = extract_nvme_addresses_chk_path_pwwn(address, els_wwpn, attached_wwpn); ++ if (ret <= 0) ++ return; ++ ret = fpin_add_marginal_dev_info(host_num, pp->dev); ++ if (ret < 0) ++ return; ++ fpin_path_setmarginal(pp); ++} ++ ++/* ++ * This function check the host number, the target WWPN ++ * associated with the path matches with the els wwpn and ++ * sets the path and port state to Marginal ++ */ ++static void fpin_check_set_scsi_path_marginal(uint16_t host_num, struct path *pp, + uint64_t els_wwpn) + { +- struct path *pp; +- struct multipath *mpp; +- int i, k; + char rport_id[42]; + const char *value = NULL; + struct udev_device *rport_dev = NULL; + uint64_t wwpn; + int ret = 0; ++ sprintf(rport_id, "rport-%d:%d-%d", ++ pp->sg_id.host_no, pp->sg_id.channel, pp->sg_id.transport_id); ++ rport_dev = udev_device_new_from_subsystem_sysname(udev, ++ "fc_remote_ports", rport_id); ++ if (!rport_dev) { ++ condlog(2, "%s: No fc_remote_port device for '%s'", pp->dev, ++ rport_id); ++ return; ++ } ++ pthread_cleanup_push(_udev_device_unref, rport_dev); ++ value = udev_device_get_sysattr_value(rport_dev, "port_name"); ++ if (!value) ++ goto unref; ++ ++ wwpn = strtol(value, NULL, 16); ++ /* ++ * If the port wwpn matches sets the path and port state ++ * to marginal ++ */ ++ if (wwpn == els_wwpn) { ++ ret = fpin_add_marginal_dev_info(host_num, pp->dev); ++ if (ret < 0) ++ goto unref; ++ fpin_path_setmarginal(pp); ++ fpin_set_rport_marginal(rport_dev); ++ } ++unref: ++ pthread_cleanup_pop(1); ++ return; ++ ++} ++ ++/* ++ * This function goes through the vecs->pathvec, and for ++ * each path, it checks and sets the path state to marginal ++ * if the path's associated port wwpn ,hostnum matches with ++ * els wwnpn ,attached_wwpn ++ */ ++static int fpin_chk_wwn_setpath_marginal(uint16_t host_num, struct vectors *vecs, ++ uint64_t els_wwpn, uint64_t attached_wwpn) ++{ ++ struct path *pp; ++ struct multipath *mpp; ++ int i, k; ++ int ret = 0; + + pthread_cleanup_push(cleanup_lock, &vecs->lock); + lock(&vecs->lock); + pthread_testcancel(); + + vector_foreach_slot(vecs->pathvec, pp, k) { +- /* Checks the host number and also for the SCSI FCP */ +- if (pp->bus != SYSFS_BUS_SCSI || pp->sg_id.proto_id != SCSI_PROTOCOL_FCP || host_num != pp->sg_id.host_no) ++ if (!pp->mpp) + continue; +- sprintf(rport_id, "rport-%d:%d-%d", +- pp->sg_id.host_no, pp->sg_id.channel, pp->sg_id.transport_id); +- rport_dev = udev_device_new_from_subsystem_sysname(udev, +- "fc_remote_ports", rport_id); +- if (!rport_dev) { +- condlog(2, "%s: No fc_remote_port device for '%s'", pp->dev, +- rport_id); +- continue; +- } +- pthread_cleanup_push(_udev_device_unref, rport_dev); +- value = udev_device_get_sysattr_value(rport_dev, "port_name"); +- if (!value) +- goto unref; +- +- if (value) +- wwpn = strtol(value, NULL, 16); +- /* +- * If the port wwpn matches sets the path and port state +- * to marginal +- */ +- if (wwpn == els_wwpn) { +- ret = fpin_path_setmarginal(pp); +- if (ret < 0) +- goto unref; +- fpin_set_rport_marginal(rport_dev); +- fpin_add_marginal_dev_info(host_num, pp->dev); ++ /*checks if the bus type is nvme and the protocol is FC-NVMe*/ ++ if ((pp->bus == SYSFS_BUS_NVME) && (pp->sg_id.proto_id == NVME_PROTOCOL_FC)) { ++ fpin_check_set_nvme_path_marginal(host_num, pp, els_wwpn, attached_wwpn); ++ } else if ((pp->bus == SYSFS_BUS_SCSI) && ++ (pp->sg_id.proto_id == SCSI_PROTOCOL_FCP) && ++ (host_num == pp->sg_id.host_no)) { ++ /* Checks the host number and also for the SCSI FCP */ ++ fpin_check_set_scsi_path_marginal(host_num, pp, els_wwpn); + } +-unref: +- pthread_cleanup_pop(1); + } + /* walk backwards because update_path_groups() can remove mpp */ + vector_foreach_slot_backwards(vecs->mpvec, mpp, i) { +@@ -279,14 +371,18 @@ fpin_parse_li_els_setpath_marginal(uint16_t host_num, struct fc_tlv_desc *tlv, + struct fc_fn_li_desc *li_desc = (struct fc_fn_li_desc *)tlv; + int count = 0; + int ret = 0; ++ uint64_t attached_wwpn; + + /* Update the wwn to list */ + wwn_count = be32_to_cpu(li_desc->pname_count); +- condlog(4, "Got wwn count as %d\n", wwn_count); ++ attached_wwpn = be64_to_cpu(li_desc->attached_wwpn); ++ condlog(4, "Got wwn count as %d detecting wwn 0x%" PRIx64 ++ " attached_wwpn 0x%" PRIx64 "\n", ++ wwn_count, be64_to_cpu(li_desc->detecting_wwpn), attached_wwpn); + + for (iter = 0; iter < wwn_count; iter++) { + wwpn = be64_to_cpu(li_desc->pname_list[iter]); +- ret = fpin_chk_wwn_setpath_marginal(host_num, vecs, wwpn); ++ ret = fpin_chk_wwn_setpath_marginal(host_num, vecs, wwpn, attached_wwpn); + if (ret < 0) + condlog(2, "failed to set the path marginal associated with wwpn: 0x%" PRIx64 "\n", wwpn); + diff --git a/0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch b/0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch new file mode 100644 index 0000000..1f87568 --- /dev/null +++ b/0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch @@ -0,0 +1,76 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 22 Nov 2023 16:41:22 -0500 +Subject: [PATCH] multipathd: Make sure to disable queueing if recovery has + failed. + +If a multipath device has no_path_retry set to a number and has lost all +paths, gone into recovery mode, and timed out, it will disable +queue_if_no_paths. After that, if the device is reloaded by multipath +outside of multipathd, it will re-enable queuieng on the device. When +multipathd later calls set_no_path_retry() to update the queueing state, +it will not disable queue_if_no_paths, since the device is still in the +recovery state, so it believes no work needs to be done. The device will +remain in the recovery state, with retry_ticks at 0, and queueing +enabled, even though there are no usable paths. + +To fix this, in set_no_path_retry(), if no_path_retry is set to a number +and the device is queueing but it is in recovery mode and out of +retries with no usable paths, manually disable queue_if_no_path. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/structs_vec.c | 26 ++++++++++++++++++++++++-- + 1 file changed, 24 insertions(+), 2 deletions(-) + +diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c +index 9613252f..0304777b 100644 +--- a/libmultipath/structs_vec.c ++++ b/libmultipath/structs_vec.c +@@ -377,8 +377,19 @@ void __set_no_path_retry(struct multipath *mpp, bool check_features) + !mpp->in_recovery) + dm_queue_if_no_path(mpp->alias, 1); + leave_recovery_mode(mpp); +- } else +- enter_recovery_mode(mpp); ++ } else { ++ /* ++ * If in_recovery is set, enter_recovery_mode does ++ * nothing. If the device is already in recovery ++ * mode and has already timed out, manually call ++ * dm_queue_if_no_path to stop it from queueing. ++ */ ++ if ((!mpp->features || is_queueing) && ++ mpp->in_recovery && mpp->retry_tick == 0) ++ dm_queue_if_no_path(mpp->alias, 0); ++ if (pathcount(mpp, PATH_PENDING) == 0) ++ enter_recovery_mode(mpp); ++ } + break; + } + } +@@ -521,6 +532,11 @@ int verify_paths(struct multipath *mpp, struct vectors *vecs) + * -1 (FAIL) : fail_if_no_path + * 0 (UNDEF) : nothing + * >0 : queue_if_no_path enabled, turned off after polling n times ++ * ++ * Since this will only be called when fail_path(), update_multipath(), or ++ * io_err_stat_handle_pathfail() are failing a previously active path, the ++ * device cannot already be in recovery mode, so there will never be a need ++ * to disable queueing here. + */ + void update_queue_mode_del_path(struct multipath *mpp) + { +@@ -534,6 +550,12 @@ void update_queue_mode_del_path(struct multipath *mpp) + condlog(2, "%s: remaining active paths: %d", mpp->alias, active); + } + ++/* ++ * Since this will only be called from check_path() -> reinstate_path() after ++ * the queueing state has been updated in set_no_path_retry, this does not ++ * need to worry about modifying the queueing state except when actually ++ * leaving recovery mode. ++ */ + void update_queue_mode_add_path(struct multipath *mpp) + { + int active = count_active_paths(mpp); 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 49d4700..70e4bff 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,8 +1,7 @@ -%define anolis_release .0.3 Summary: Tools to manage multipath devices using device-mapper Name: device-mapper-multipath Version: 0.8.4 -Release: 39%{anolis_release}%{?dist} +Release: 41%{?dist} License: GPLv2 Group: System Environment/Base URL: http://christophe.varoqui.free.fr/ @@ -147,10 +146,8 @@ Patch00132: 0132-multipathd-make-pr-registration-consistent.patch Patch00133: 0133-libmultipath-make-prflag-an-enum.patch Patch00134: 0134-multipathd-handle-no-active-paths-in-update_map_pr.patch Patch00135: 0135-libmpathpersist-fix-resource-leak-in-update_map_pr.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 +Patch00136: 0136-multipathd-Added-support-to-handle-FPIN-Li-events-fo.patch +Patch00137: 0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -355,14 +352,15 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog -* Mon Jun 24 2024 0.8.4-39.0.3 -- modify OPTFLAGS for sw_64. - -* Tue Mar 19 2024 Weisson 0.8.4-39.0.2 -- cherry-pick `fix the problem comparison of integer expressions of different signedness`. - -* Wed Dec 06 2023 zhangwenlong 0.8.4-39.0.1 -- Add loongarch64 support for device-mapper-multipath +* Fri Jan 5 2024 Benjamin Marzinski 0.8.4-41 +- Add 0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch +- Resolves: RHEL-16563 + +* Thu Nov 2 2023 Benjamin Marzinski 0.8.4-40 +- Add 0136-multipathd-Added-support-to-handle-FPIN-Li-events-fo.patch + * Add support in multipathd for NVMe to listen for FPIN-Li events and + mark effected paths as marginal +- Resolves: RHEL-6677 * Thu Mar 16 2023 Benjamin Marzinski 0.8.4-39 - Add OSCI tests directory -- Gitee From 891f2fc65a03a33aa7252f8b5046bfcd6482c751 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 70e4bff..ccd2487 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: 41%{?dist} +Release: 41%{anolis_release}%{?dist} License: GPLv2 Group: System Environment/Base URL: http://christophe.varoqui.free.fr/ @@ -149,6 +150,8 @@ 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 + # runtime Requires: %{name}-libs = %{version}-%{release} Requires: kpartx = %{version}-%{release} @@ -352,6 +355,9 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Thu Jul 18 2024 zhangwenlong 0.8.4-41.0.1 +- Add loongarch64 support for device-mapper-multipath + * Fri Jan 5 2024 Benjamin Marzinski 0.8.4-41 - Add 0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch - Resolves: RHEL-16563 -- Gitee From 15e6073c7059cf40d40438070be2465a0cf39327 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 ccd2487..6f6a73b 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -151,6 +151,7 @@ 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 # runtime Requires: %{name}-libs = %{version}-%{release} @@ -357,6 +358,7 @@ fi %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) * Fri Jan 5 2024 Benjamin Marzinski 0.8.4-41 - Add 0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch -- Gitee From 2840c80a6701f7e94076606fa7712f7126ac1712 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 6f6a73b..6c2ef6f 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 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} @@ -359,6 +360,7 @@ fi * 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) * Fri Jan 5 2024 Benjamin Marzinski 0.8.4-41 - Add 0137-multipathd-Make-sure-to-disable-queueing-if-recovery.patch -- Gitee