From 9e51978aa403617f0696a9425504f75eaec4af9f Mon Sep 17 00:00:00 2001 From: Kou Wenqi Date: Tue, 1 Jul 2025 16:13:24 +0800 Subject: [PATCH] multipathd: fix map failure counting for no_path_retry > 0 (cherry picked from commit 6124a49d513ac238320b395ca3339a5cb6a5941c) --- ...double-counting-map-failures-for-no_.patch | 38 +++++++++++++++++++ multipath-tools.spec | 6 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 0023-multipathd-Stop-double-counting-map-failures-for-no_.patch diff --git a/0023-multipathd-Stop-double-counting-map-failures-for-no_.patch b/0023-multipathd-Stop-double-counting-map-failures-for-no_.patch new file mode 100644 index 0000000..5683b7e --- /dev/null +++ b/0023-multipathd-Stop-double-counting-map-failures-for-no_.patch @@ -0,0 +1,38 @@ +From aa60bd6ba17f02733e39f6e6120ba5c3e96d035b Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 30 May 2024 12:54:57 -0400 +Subject: [PATCH] multipathd: Stop double counting map failures for + no_path_retry > 0 + +If no_path_retry was greater than 0, multipathd was counting a map +failure when recovery mode was entered, and again when queueing was +disabled. The first one is incorrect, since the map is still queueing. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + libmultipath/structs_vec.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c +index c0c5cc90..ccc4efc7 100644 +--- a/libmultipath/structs_vec.c ++++ b/libmultipath/structs_vec.c +@@ -844,10 +844,13 @@ int verify_paths(struct multipath *mpp) + void update_queue_mode_del_path(struct multipath *mpp) + { + int active = count_active_paths(mpp); ++ bool is_queueing = mpp->features && ++ strstr(mpp->features, "queue_if_no_path"); + + if (active == 0) { + enter_recovery_mode(mpp); +- if (mpp->no_path_retry != NO_PATH_RETRY_QUEUE) ++ if (mpp->no_path_retry == NO_PATH_RETRY_FAIL || ++ (mpp->no_path_retry == NO_PATH_RETRY_UNDEF && !is_queueing)) + mpp->stat_map_failures++; + } + condlog(2, "%s: remaining active paths: %d", mpp->alias, active); +-- +2.43.0 + diff --git a/multipath-tools.spec b/multipath-tools.spec index 909a462..8fd668a 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -1,7 +1,7 @@ #needsrootforbuild Name: multipath-tools Version: 0.9.5 -Release: 7 +Release: 8 Summary: Tools to manage multipath devices with the device-mapper License: GPL-2.0-or-later and LGPL-2.0-only URL: http://christophe.varoqui.free.fr/ @@ -31,6 +31,7 @@ Patch19: 0019-libmultipath-sysfs_set_scsi_tmo-do-nothing-for-ACT_D.patch Patch20: 0020-multipath.conf.5-fix-documentation-for-find_multipat.patch Patch21: 0021-multipath.conf.5-fix-the-description-of-prio_args-fo.patch Patch22: 0022-multipath-display-the-correct-configuration-when-dum.patch +Patch23: 0023-multipathd-Stop-double-counting-map-failures-for-no_.patch BuildRequires: multipath-tools, libcmocka, libcmocka-devel BuildRequires: gcc, libaio-devel, userspace-rcu-devel, device-mapper-devel >= 1.02.89 @@ -185,6 +186,9 @@ fi %changelog +* Tue Jul 1 2025 kouwenqi - 0.9.5-8 +- multipathd: fix map failure counting for no_path_retry > 0 + * Tue Aug 27 2024 kouwenqi - 0.9.5-7 - sync patch22 with community -- Gitee