From e9a825c1731802f7811cc3ed32cddf3368f90bd7 Mon Sep 17 00:00:00 2001 From: chenrenhui Date: Thu, 3 Jul 2025 12:47:12 +0000 Subject: [PATCH] libmultipath: set/clear handled flag only in coalesce_paths (cherry picked from commit 5d67882a94e25d7709dd93216f62c9bf2d595d33) --- ...-clear-handled-flag-only-in-coalesce.patch | 55 +++++++++++++++++++ multipath-tools.spec | 6 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 0024-libmultipath-set-clear-handled-flag-only-in-coalesce.patch diff --git a/0024-libmultipath-set-clear-handled-flag-only-in-coalesce.patch b/0024-libmultipath-set-clear-handled-flag-only-in-coalesce.patch new file mode 100644 index 0000000..fa1c952 --- /dev/null +++ b/0024-libmultipath-set-clear-handled-flag-only-in-coalesce.patch @@ -0,0 +1,55 @@ +From 70454b60c85185a256ec518058aab5b91b2cea6b Mon Sep 17 00:00:00 2001 +From: chenrenhui +Date: Thu, 3 Jul 2025 20:23:18 +0800 +Subject: [PATCH] libmultipath: set/clear handled flag only in coalesce_paths + +The handled flag is used to skip the handled path while +coalesce_paths. So we move its set operation from +verify_paths to coalesce_paths, and clear it in the end. + +Signed-off-by: chenrenhui +--- + libmultipath/configure.c | 7 +++++++ + libmultipath/structs_vec.c | 1 - + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/libmultipath/configure.c b/libmultipath/configure.c +index 33ca591..5be1955 100644 +--- a/libmultipath/configure.c ++++ b/libmultipath/configure.c +@@ -1208,6 +1208,8 @@ int coalesce_paths (struct vectors *vecs, vector mpvec, char *refwwid, + } + } + verify_paths(mpp); ++ vector_foreach_slot (mpp->paths, pp2, i) ++ pp2->handled = 1; + + if (cmpp) + mpp->queue_mode = cmpp->queue_mode; +@@ -1284,6 +1286,11 @@ out: + remove_map(mpp, vecs->pathvec, NULL); + vector_free(newmp); + } ++ /* clear handled after coalesce_paths */ ++ vector_foreach_slot (pathvec, pp1, k) ++ if (pp1->handled) ++ pp1->handled = 0; ++ + return ret; + } + +diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c +index 8f441f5..6f47f7c 100644 +--- a/libmultipath/structs_vec.c ++++ b/libmultipath/structs_vec.c +@@ -740,7 +740,6 @@ int verify_paths(struct multipath *mpp) + return 0; + + vector_foreach_slot (mpp->paths, pp, i) { +- pp->handled = 1; + /* + * see if path is in sysfs + */ +-- +2.33.0 + diff --git a/multipath-tools.spec b/multipath-tools.spec index 8fd668a..d9483a9 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -1,7 +1,7 @@ #needsrootforbuild Name: multipath-tools Version: 0.9.5 -Release: 8 +Release: 9 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/ @@ -32,6 +32,7 @@ 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 +Patch24: 0024-libmultipath-set-clear-handled-flag-only-in-coalesce.patch BuildRequires: multipath-tools, libcmocka, libcmocka-devel BuildRequires: gcc, libaio-devel, userspace-rcu-devel, device-mapper-devel >= 1.02.89 @@ -186,6 +187,9 @@ fi %changelog +* Thu Jul 3 2025 chenrenhui - 0.9.5-9 +- libmultipath: set/clear handled flag only in coalesce_paths + * Tue Jul 1 2025 kouwenqi - 0.9.5-8 - multipathd: fix map failure counting for no_path_retry > 0 -- Gitee