!166 回合补丁,修复multipath空配置项导致服务启动失败的问题
From: @jinzig Reviewed-by: @swf504 Signed-off-by: @swf504
This commit is contained in:
commit
6dcbdb6201
@ -0,0 +1,38 @@
|
||||
From 749aabd0f5e6d662e552f0d712434696743fe69b Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Fri, 18 Dec 2020 17:06:40 -0600
|
||||
Subject: [PATCH 1/1] libmultipath: ignore multipaths sections without wwid
|
||||
option
|
||||
|
||||
"multipathd show config local" was crashing in find_mp_by_wwid() if
|
||||
the multipath configuration included a multipaths section that did
|
||||
not set a wwid option. There is no reason to keep a mpentry that
|
||||
didn't set its wwid. Remove it in merge_mptable().
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Reviewed-by: Martin Wilck <mwilck@suse.com>
|
||||
---
|
||||
libmultipath/config.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/libmultipath/config.c b/libmultipath/config.c
|
||||
index 9f3cb38d..a643703e 100644
|
||||
--- a/libmultipath/config.c
|
||||
+++ b/libmultipath/config.c
|
||||
@@ -509,6 +509,13 @@ void merge_mptable(vector mptable)
|
||||
int i, j;
|
||||
|
||||
vector_foreach_slot(mptable, mp1, i) {
|
||||
+ /* drop invalid multipath configs */
|
||||
+ if (!mp1->wwid) {
|
||||
+ condlog(0, "multipaths config section missing wwid");
|
||||
+ vector_del_slot(mptable, i--);
|
||||
+ free_mpe(mp1);
|
||||
+ continue;
|
||||
+ }
|
||||
j = i + 1;
|
||||
vector_foreach_slot_after(mptable, mp2, j) {
|
||||
if (strcmp(mp1->wwid, mp2->wwid))
|
||||
--
|
||||
2.27.0
|
||||
|
||||
33
0046-libmultipath-check-for-null-wwid-before-strcmp.patch
Normal file
33
0046-libmultipath-check-for-null-wwid-before-strcmp.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From 0eeaa7d89ff46201aec2211db26ce08021cb292d Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Mon, 4 Jan 2021 21:59:54 -0600
|
||||
Subject: [PATCH 1/1] libmultipath: check for null wwid before strcmp
|
||||
|
||||
Commit 749aabd0 (libmultipath: ignore multipaths sections without wwid
|
||||
option) removed all mpentries with a NULL wwid, but didn't stop strcmp()
|
||||
from being run on them in merge_mptable(). The result of strcmp() with
|
||||
a NULL parameter is undefined, so fix that.
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
|
||||
Reviewed-by: Martin Wilck <mwilck@suse.com>
|
||||
---
|
||||
libmultipath/config.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libmultipath/config.c b/libmultipath/config.c
|
||||
index a643703e..be310159 100644
|
||||
--- a/libmultipath/config.c
|
||||
+++ b/libmultipath/config.c
|
||||
@@ -518,7 +518,7 @@ void merge_mptable(vector mptable)
|
||||
}
|
||||
j = i + 1;
|
||||
vector_foreach_slot_after(mptable, mp2, j) {
|
||||
- if (strcmp(mp1->wwid, mp2->wwid))
|
||||
+ if (!mp2->wwid || strcmp(mp1->wwid, mp2->wwid))
|
||||
continue;
|
||||
condlog(1, "%s: duplicate multipath config section for %s",
|
||||
__func__, mp1->wwid);
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
Name: multipath-tools
|
||||
Version: 0.8.4
|
||||
Release: 21
|
||||
Release: 22
|
||||
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/
|
||||
@ -54,6 +54,8 @@ Patch41: 0041-libmultipath-make-sysfs_is_multipathed-able-to-retur.patch
|
||||
Patch42: 0042-multipath-centralize-validation-code.patch
|
||||
Patch43: 0043-libmultipath-dm_map_present_by_uuid-fix-dm_task_crea.patch
|
||||
Patch44: 0044-multipathd.socket-add-missing-conditions-from-servic.patch
|
||||
Patch45: 0045-libmultipath-ignore-multipaths-sections-without-wwid.patch
|
||||
Patch46: 0046-libmultipath-check-for-null-wwid-before-strcmp.patch
|
||||
|
||||
BuildRequires: multipath-tools, libcmocka, libcmocka-devel
|
||||
BuildRequires: gcc, libaio-devel, userspace-rcu-devel, device-mapper-devel >= 1.02.89
|
||||
@ -201,6 +203,9 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed May 29 2024 jinzhiguang <jinzhiguang@kylinos.cn> - -0.8.4-22
|
||||
- fix multipathd service coredump caused by empty item in multipath.conf
|
||||
|
||||
* Wed May 22 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.4-21
|
||||
- multipathd.socket: add missing conditions from service unit
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user