Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
afb190ad8d
!219 [sync] PR-213: sync patch multipath-display-the-correct-configuration-when-dum.patch with community
From: @openeuler-sync-bot 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2024-09-10 01:48:11 +00:00
kouwenqi
c69eae4a0c sync patch32 with community
(cherry picked from commit 652302d528ae019d0bb68842561445415da6368d)
2024-08-31 09:38:51 +08:00
openeuler-ci-bot
6ac1654ed0
!209 [sync] PR-205: 【轻量级PR】: Added 'Buildarch: noarch'to the help subpaackage
From: @openeuler-sync-bot 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2024-08-31 01:27:52 +00:00
zhangjiaming
46e4753c6c Added 'Buildarch: noarch' to the help subpackage
(cherry picked from commit e6808228cb93b7e957b225dca632e66e95c3339f)
2024-08-27 09:52:49 +08:00
openeuler-ci-bot
2e152876b1
!203 [sync] PR-201: libmultipath: limit paths that can get wwid from environment
From: @openeuler-sync-bot 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2024-08-12 12:40:36 +00:00
Kou Wenqi
3e26c4a6c1 libmultipath: limit paths that can get wwid from environment
Currently, whenever getting the uid_attribute from the udev database
fails, multipath will try to get it from the environment variables. This
normally isn't a problem, since either multipath -u is getting called
from a uevent and the environment will have the correct value in that
variable, or something else is being run and that variable won't be set.
However, when find_multipaths is configured to "smart", this causes
problems. For maybe devices, multipath needs to get the WWIDs of all the
other block devices, to see if they match the maybe device wwid.  If one
of those devices doesn't have uid_attribute set in its udev database,
multipath will fall back to checking the environment for it, and it will
find that variable set to the WWID of the maybe device that this uevent
is for.  This means that all devices with no WWID will end up appearing
to have the same WWID as the maybe device, causing multipath to
incorrectly claim it.

(cherry picked from commit 07e08e42400b8c37b2dacdc63e8ea4c737cc11b3)
2024-08-12 16:30:50 +08:00
openeuler-ci-bot
3e5b60edaa
!198 [sync] PR-195: multipath: display the correct configuration when dumpping config
From: @openeuler-sync-bot 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2024-08-07 09:00:23 +00:00
Kou Wenqi
fbfe7731b9 multipath: display the correct configuration when dumpping config
"multipath -t" and "multipath -T" might show the wrong
multipathd configuration items "retrigger_tries" and
"force_sync". Make sure they don't.

(cherry picked from commit df7cdf4f6eba3ba27093a67bad278a9ec173899f)
2024-08-07 10:28:52 +08:00
openeuler-ci-bot
b5450f6239
!191 [sync] PR-187: multipath.conf.5: fix the description of prio_args for path_latency prio
From: @openeuler-sync-bot 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2024-08-05 02:44:29 +00:00
Kou Wenqi
983f781b4c multipath.conf.5: fix the description of prio_args for path_latency prio
This aligns the description of prio_args for path_latency prio and
the actual code.

(cherry picked from commit a91d47c1e822753fe9d07b469c16ec55f39929cb)
2024-08-05 10:09:55 +08:00
4 changed files with 167 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From 66e536da13199472a3d5293db561adc8677e6793 Mon Sep 17 00:00:00 2001
From: kouwenqi <kouwenqi@kylinos.cn>
Date: Tue, 4 Jun 2024 11:07:25 +0800
Subject: [PATCH] multipath.conf.5: fix the description of prio_args for
path_latency prio
This aligns the description of prio_args for path_latency prio and
the actual code.
---
multipath/multipath.conf.5 | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
index 284282c..d4fd534 100644
--- a/multipath/multipath.conf.5
+++ b/multipath/multipath.conf.5
@@ -399,11 +399,11 @@ Needs a value of the form "io_num=\fI<20>\fR base_num=\fI<10>\fR"
.TP 8
.I io_num
The number of read IOs sent to the current path continuously, used to calculate the average path latency.
-Valid Values: Integer, [2, 200].
+Valid Values: Integer, [20, 200].
.TP
.I base_num
-The base number value of logarithmic scale, used to partition different priority ranks. Valid Values: Integer,
-[2, 10]. And Max average latency value is 100s, min average latency value is 1us.
+The base number value of logarithmic scale, used to partition different priority ranks. Valid Values:
+Double-precision floating-point, [1.1, 10]. And Max average latency value is 100s, min average latency value is 1us.
For example: If base_num=10, the paths will be grouped in priority groups with path latency <=1us, (1us, 10us],
(10us, 100us], (100us, 1ms], (1ms, 10ms], (10ms, 100ms], (100ms, 1s], (1s, 10s], (10s, 100s], >100s.
.RE
--
2.43.0

View File

@ -0,0 +1,44 @@
From 0802e9dfd27e2333615e8068d7fa55a614bef92e Mon Sep 17 00:00:00 2001
From: Kou Wenqi <kouwenqi@kylinos.cn>
Date: Tue, 13 Aug 2024 10:12:36 +0800
Subject: [PATCH] multipath: display the correct configuration when dumping
config
"multipath -t" and "multipath -T" might show the wrong
multipathd configuration items "retrigger_tries" and
"force_sync". Make sure they don't.
Signed-off-by: Kou Wenqi <kouwenqi@kylinos.cn>
Reviewed-by: Martin Wilck <mwilck@suse.com>
---
multipath/main.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/multipath/main.c b/multipath/main.c
index 23182fc..4adf7ee 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -838,8 +838,6 @@ main (int argc, char *argv[])
if (atexit(uninit_config))
condlog(1, "failed to register cleanup handler for config: %m");
conf = get_multipath_config();
- conf->retrigger_tries = 0;
- conf->force_sync = 1;
atexit(cleanup_vecs);
while ((arg = getopt(argc, argv, ":adDcChl::eFfM:v:p:b:BrR:itTquUwW")) != EOF ) {
switch(arg) {
@@ -991,6 +989,11 @@ main (int argc, char *argv[])
libmp_udev_set_sync_support(1);
+ if (cmd != CMD_DUMP_CONFIG) {
+ conf->retrigger_tries = 0;
+ conf->force_sync = 1;
+ }
+
if (init_checkers(conf->multipath_dir)) {
condlog(0, "failed to initialize checkers");
goto out;
--
2.27.0

View File

@ -0,0 +1,69 @@
From 694a29d909268868eb2d855303a0420c2baeffda Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Thu, 9 Feb 2023 11:28:31 -0600
Subject: [PATCH] libmultipath: limit paths that can get wwid from environment
Currently, whenever getting the uid_attribute from the udev database
fails, multipath will try to get it from the environment variables. This
normally isn't a problem, since either multipath -u is getting called
from a uevent and the environment will have the correct value in that
variable, or something else is being run and that variable won't be set.
However, when find_multipaths is configured to "smart", this causes
problems. For maybe devices, multipath needs to get the WWIDs of all the
other block devices, to see if they match the maybe device wwid. If one
of those devices doesn't have uid_attribute set in its udev database,
multipath will fall back to checking the environment for it, and it will
find that variable set to the WWID of the maybe device that this uevent
is for. This means that all devices with no WWID will end up appearing
to have the same WWID as the maybe device, causing multipath to
incorrectly claim it.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
---
libmultipath/discovery.c | 2 +-
libmultipath/structs.h | 1 +
multipath/main.c | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index fb20308..ea0ceef 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -2145,7 +2145,7 @@ get_udev_uid(struct path * pp, char *uid_attribute, struct udev_device *udev)
const char *value;
value = udev_device_get_property_value(udev, uid_attribute);
- if (!value || strlen(value) == 0)
+ if ((!value || strlen(value) == 0) && pp->can_use_env_uid)
value = getenv(uid_attribute);
if (value && strlen(value)) {
len = strlcpy(pp->wwid, value, WWID_SIZE);
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
index ec12660..5fb131b 100644
--- a/libmultipath/structs.h
+++ b/libmultipath/structs.h
@@ -325,6 +325,7 @@ struct path {
int marginal;
int vpd_vendor_id;
int recheck_wwid;
+ bool can_use_env_uid;
/* configlet pointers */
vector hwe;
struct gen_path generic_path;
diff --git a/multipath/main.c b/multipath/main.c
index 2ab302f..7ecbe51 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -607,6 +607,8 @@ check_path_valid(const char *name, struct config *conf, bool is_uevent)
pp = alloc_path();
if (!pp)
return RTVL_FAIL;
+ if (is_uevent)
+ pp->can_use_env_uid = true;
r = is_path_valid(name, conf, pp, is_uevent);
if (r <= PATH_IS_ERROR || r >= PATH_MAX_VALID_RESULT)
--
2.27.0

View File

@ -1,7 +1,7 @@
#needsrootforbuild
Name: multipath-tools
Version: 0.8.7
Release: 13
Release: 18
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/
@ -39,6 +39,9 @@ Patch27: 0027-libmultipath-io_err_stat-call-io_destroy-inside-free.patch
Patch28: 0028-multipathd.socket-add-missing-conditions-from-servic.patch
Patch29: 0029-libmultipath-sysfs_set_scsi_tmo-do-nothing-for-ACT_D.patch
Patch30: 0030-multipath.conf.5-fix-documentation-for-find_multipat.patch
Patch31: 0031-multipath.conf.5-fix-the-description-of-prio_args-fo.patch
Patch32: 0032-multipath-display-the-correct-configuration-when-dum.patch
Patch33: 0033-libmultipath-limit-paths-that-can-get-wwid-from-envi.patch
BuildRequires: multipath-tools, libcmocka, libcmocka-devel
BuildRequires: gcc, libaio-devel, userspace-rcu-devel, device-mapper-devel >= 1.02.89
@ -84,6 +87,7 @@ that are %{name}'s libbmpathpersist and libmpathcmd libraries.
%package help
Summary: Including man files for multipath-tools.
Requires: man
Buildarch: noarch
Provides: device-mapper-multipath-help
Obsoletes: device-mapper-multipath-help
%description help
@ -186,6 +190,21 @@ fi
%changelog
* Tue Aug 27 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.7-18
- sync patch32 with community
* Wed Aug 21 2024 Jiaming Zhang <zhangjiaming@cqsoftware.com.cn> - 0.8.7-17
- Added 'Buildarch:noarch' to the help subpackage
* Thu Aug 8 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.7-16
- libmultipath: limit paths that can get wwid from environment
* Mon Aug 5 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.7-15
- multipath: display the correct configuration when dumpping config
* Fri Aug 2 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.7-14
- multipath.conf.5: fix the description of prio_args for path_latency prio
* Fri Jul 5 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.7-13
- multipath.conf.5: fix documentation for find_multipaths