Compare commits
10 Commits
a34bac7479
...
fa7b26e256
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa7b26e256 | ||
|
|
e6a1e6ede4 | ||
|
|
58e2824056 | ||
|
|
4142437018 | ||
|
|
4cdee0e8e5 | ||
|
|
162cf66748 | ||
|
|
4444f6328e | ||
|
|
586476ba6b | ||
|
|
35ad6d85c1 | ||
|
|
09e7eb51d9 |
@ -1,54 +1,44 @@
|
|||||||
From d03a21a3474993cdf95c73da7ea70308659c3d70 Mon Sep 17 00:00:00 2001
|
From 0802e9dfd27e2333615e8068d7fa55a614bef92e Mon Sep 17 00:00:00 2001
|
||||||
From: Kou Wenqi <kouwenqi@kylinos.cn>
|
From: Kou Wenqi <kouwenqi@kylinos.cn>
|
||||||
Date: Mon, 5 Aug 2024 14:35:06 +0800
|
Date: Tue, 13 Aug 2024 10:12:36 +0800
|
||||||
Subject: [PATCH] multipath: display the correct configuration when dumpping
|
Subject: [PATCH] multipath: display the correct configuration when dumping
|
||||||
config
|
config
|
||||||
|
|
||||||
"multipath -t" and "multipath -T" might show the wrong
|
"multipath -t" and "multipath -T" might show the wrong
|
||||||
multipathd configuration items "retrigger_tries" and
|
multipathd configuration items "retrigger_tries" and
|
||||||
"force_sync". Make sure they don't.
|
"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 | 8 ++++++++
|
multipath/main.c | 7 +++++--
|
||||||
1 file changed, 8 insertions(+)
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/multipath/main.c b/multipath/main.c
|
diff --git a/multipath/main.c b/multipath/main.c
|
||||||
index 3c5a70e..f52430f 100644
|
index 65f2949..4853d17 100644
|
||||||
--- a/multipath/main.c
|
--- a/multipath/main.c
|
||||||
+++ b/multipath/main.c
|
+++ b/multipath/main.c
|
||||||
@@ -866,6 +866,8 @@ main (int argc, char *argv[])
|
@@ -875,8 +875,6 @@ main (int argc, char *argv[])
|
||||||
char *dev = NULL;
|
|
||||||
struct config *conf;
|
|
||||||
int retries = -1;
|
|
||||||
+ int retrigger_tries_ori;
|
|
||||||
+ int force_sync_ori;
|
|
||||||
|
|
||||||
udev = udev_new();
|
|
||||||
logsink = 0;
|
|
||||||
@@ -873,7 +875,9 @@ main (int argc, char *argv[])
|
|
||||||
if (!conf)
|
if (!conf)
|
||||||
exit(RTVL_FAIL);
|
exit(RTVL_FAIL);
|
||||||
multipath_conf = conf;
|
multipath_conf = conf;
|
||||||
+ retrigger_tries_ori = conf->retrigger_tries;
|
- conf->retrigger_tries = 0;
|
||||||
conf->retrigger_tries = 0;
|
- conf->force_sync = 1;
|
||||||
+ force_sync_ori = conf->force_sync;
|
|
||||||
conf->force_sync = 1;
|
|
||||||
while ((arg = getopt(argc, argv, ":adcChl::FfM:v:p:b:BrR:itTquUwW")) != EOF ) {
|
while ((arg = getopt(argc, argv, ":adcChl::FfM:v:p:b:BrR:itTquUwW")) != EOF ) {
|
||||||
switch(arg) {
|
switch(arg) {
|
||||||
@@ -944,10 +948,14 @@ main (int argc, char *argv[])
|
case 1: printf("optarg : %s\n",optarg);
|
||||||
conf->find_multipaths = FIND_MULTIPATHS_GREEDY;
|
@@ -1017,6 +1015,11 @@ main (int argc, char *argv[])
|
||||||
break;
|
|
||||||
case 't':
|
libmp_udev_set_sync_support(1);
|
||||||
+ conf->retrigger_tries = retrigger_tries_ori;
|
|
||||||
+ conf->force_sync = force_sync_ori;
|
+ if (cmd != CMD_DUMP_CONFIG) {
|
||||||
r = dump_config(conf, NULL, NULL) ? RTVL_FAIL : RTVL_OK;
|
+ conf->retrigger_tries = 0;
|
||||||
goto out_free_config;
|
+ conf->force_sync = 1;
|
||||||
case 'T':
|
+ }
|
||||||
cmd = CMD_DUMP_CONFIG;
|
+
|
||||||
+ conf->retrigger_tries = retrigger_tries_ori;
|
if (init_checkers(conf->multipath_dir)) {
|
||||||
+ conf->force_sync = force_sync_ori;
|
condlog(0, "failed to initialize checkers");
|
||||||
break;
|
goto out;
|
||||||
case 'h':
|
|
||||||
usage(argv[0]);
|
|
||||||
--
|
--
|
||||||
2.27.0
|
2.27.0
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,38 @@
|
|||||||
|
From 774b5ad984a9c4f1d8d869d804ad1dc35dab7d8b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||||
|
Date: Wed, 30 Mar 2022 15:14:56 -0500
|
||||||
|
Subject: [PATCH] multipath: return failure on an invalid remove command
|
||||||
|
|
||||||
|
When "multipath -f" is run on a device that doesn't exist or isn't a
|
||||||
|
multipath device, the command will not remove any device, but it will
|
||||||
|
still return success. Multiple functions rely on _dm_flush_map()
|
||||||
|
returning success when called with name that doesn't match any
|
||||||
|
multipath device. So before calling _dm_flush_map(), call dm_is_mpath(),
|
||||||
|
to check if the device exists and is a multipath device, and return
|
||||||
|
failure if it's not.
|
||||||
|
|
||||||
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||||
|
Reviewed-by: Martin Wilck <mwilck@suse.com
|
||||||
|
---
|
||||||
|
multipath/main.c | 5 +++++
|
||||||
|
1 file changed, 5 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/multipath/main.c b/multipath/main.c
|
||||||
|
index f52430f..008de0b 100644
|
||||||
|
--- a/multipath/main.c
|
||||||
|
+++ b/multipath/main.c
|
||||||
|
@@ -1088,6 +1088,11 @@ main (int argc, char *argv[])
|
||||||
|
retries = conf->remove_retries;
|
||||||
|
if (conf->remove == FLUSH_ONE) {
|
||||||
|
if (dev_type == DEV_DEVMAP) {
|
||||||
|
+ if (dm_is_mpath(dev) != 1) {
|
||||||
|
+ condlog(0, "%s is not a multipath device", dev);
|
||||||
|
+ r = RTVL_FAIL;
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
r = dm_suspend_and_flush_map(dev, retries) ?
|
||||||
|
RTVL_FAIL : RTVL_OK;
|
||||||
|
} else
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -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 f1de837..1e3847f 100644
|
||||||
|
--- a/libmultipath/discovery.c
|
||||||
|
+++ b/libmultipath/discovery.c
|
||||||
|
@@ -2000,7 +2000,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 deced7d..3e73d80 100644
|
||||||
|
--- a/libmultipath/structs.h
|
||||||
|
+++ b/libmultipath/structs.h
|
||||||
|
@@ -288,6 +288,7 @@ struct path {
|
||||||
|
int find_multipaths_timeout;
|
||||||
|
int marginal;
|
||||||
|
int vpd_vendor_id;
|
||||||
|
+ 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 008de0b..5f357b5 100644
|
||||||
|
--- a/multipath/main.c
|
||||||
|
+++ b/multipath/main.c
|
||||||
|
@@ -677,6 +677,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
|
||||||
|
|
||||||
33
0053-multipathd-don-t-print-so-many-add-map-messages.patch
Normal file
33
0053-multipathd-don-t-print-so-many-add-map-messages.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
From 5353a851b4ba8a356bf02bf3f1bb903025dbc664 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Kou Wenqi <kouwenqi@kylinos.cn>
|
||||||
|
Date: Fri, 27 Sep 2024 13:37:25 +0800
|
||||||
|
Subject: [PATCH] multipathd: don't print so many add map messages
|
||||||
|
|
||||||
|
Whenever a dm device gets a change uevent, multipathd prints an add map
|
||||||
|
message. This can get confusing for users, so change that message to
|
||||||
|
not print at the default log level.
|
||||||
|
|
||||||
|
commit b429df90b6db4d9544d01d5cd052e83710acaab0 in upstream made the change.
|
||||||
|
However 0008-multipathd-disable-queueing-for-recreated-map-in-uev.patch
|
||||||
|
changed it back.
|
||||||
|
Now fix it.
|
||||||
|
---
|
||||||
|
multipathd/main.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/multipathd/main.c b/multipathd/main.c
|
||||||
|
index 53a7fa2..6a88b10 100644
|
||||||
|
--- a/multipathd/main.c
|
||||||
|
+++ b/multipathd/main.c
|
||||||
|
@@ -674,7 +674,7 @@ uev_add_map (struct uevent * uev, struct vectors * vecs)
|
||||||
|
char *alias;
|
||||||
|
int major = -1, minor = -1, rc;
|
||||||
|
|
||||||
|
- condlog(2, "%s: add map (uevent)", uev->kernel);
|
||||||
|
+ condlog(3, "%s: add map (uevent)", uev->kernel);
|
||||||
|
alias = uevent_get_dm_name(uev);
|
||||||
|
if (!alias) {
|
||||||
|
condlog(3, "%s: No DM_NAME in uevent", uev->kernel);
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: multipath-tools
|
Name: multipath-tools
|
||||||
Version: 0.8.4
|
Version: 0.8.4
|
||||||
Release: 26
|
Release: 31
|
||||||
Summary: Tools to manage multipath devices with the device-mapper
|
Summary: Tools to manage multipath devices with the device-mapper
|
||||||
License: GPL-2.0-or-later and LGPL-2.0-only
|
License: GPL-2.0-or-later and LGPL-2.0-only
|
||||||
URL: http://christophe.varoqui.free.fr/
|
URL: http://christophe.varoqui.free.fr/
|
||||||
@ -60,6 +60,9 @@ Patch47: 0047-libmultipath-sysfs_set_scsi_tmo-do-nothing-for-ACT_D.patch
|
|||||||
Patch48: 0048-multipath.conf.5-fix-documentation-for-find_multipat.patch
|
Patch48: 0048-multipath.conf.5-fix-documentation-for-find_multipat.patch
|
||||||
Patch49: 0049-multipath.conf.5-fix-the-description-of-prio_args-fo.patch
|
Patch49: 0049-multipath.conf.5-fix-the-description-of-prio_args-fo.patch
|
||||||
Patch50: 0050-multipath-display-the-correct-configuration-when-dum.patch
|
Patch50: 0050-multipath-display-the-correct-configuration-when-dum.patch
|
||||||
|
Patch51: 0051-multipath-return-failure-on-an-invalid-remove-comman.patch
|
||||||
|
Patch52: 0052-libmultipath-limit-paths-that-can-get-wwid-from-envi.patch
|
||||||
|
Patch53: 0053-multipathd-don-t-print-so-many-add-map-messages.patch
|
||||||
|
|
||||||
BuildRequires: multipath-tools, libcmocka, libcmocka-devel
|
BuildRequires: multipath-tools, libcmocka, libcmocka-devel
|
||||||
BuildRequires: gcc, libaio-devel, userspace-rcu-devel, device-mapper-devel >= 1.02.89
|
BuildRequires: gcc, libaio-devel, userspace-rcu-devel, device-mapper-devel >= 1.02.89
|
||||||
@ -106,6 +109,7 @@ that are %{name}'s libbmpathpersist and libmpathcmd libraries.
|
|||||||
%package help
|
%package help
|
||||||
Summary: Including man files for multipath-tools.
|
Summary: Including man files for multipath-tools.
|
||||||
Requires: man
|
Requires: man
|
||||||
|
Buildarch: noarch
|
||||||
Provides: device-mapper-multipath-help
|
Provides: device-mapper-multipath-help
|
||||||
Obsoletes: device-mapper-multipath-help
|
Obsoletes: device-mapper-multipath-help
|
||||||
%description help
|
%description help
|
||||||
@ -207,6 +211,21 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Sep 27 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.4-31
|
||||||
|
- multipathd: don't print so many add map messages
|
||||||
|
|
||||||
|
* Tue Aug 27 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.4-30
|
||||||
|
- sync patch50 with community
|
||||||
|
|
||||||
|
* Wed Aug 21 2024 Jiaming Zhang <zhangjiaming@cqsoftware.com.cn> - 0.8.4-29
|
||||||
|
- Added 'Buildarch:noarch' to the help subpackage
|
||||||
|
|
||||||
|
* Thu Aug 8 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.4-28
|
||||||
|
- libmultipath: limit paths that can get wwid from environment
|
||||||
|
|
||||||
|
* Wed Aug 7 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.4-27
|
||||||
|
- multipath: return failure on an invalid remove command
|
||||||
|
|
||||||
* Mon Aug 5 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.4-26
|
* Mon Aug 5 2024 kouwenqi <kouwenqi@kylinos.cn> - 0.8.4-26
|
||||||
- multipath: display the correct configuration when dumpping config
|
- multipath: display the correct configuration when dumpping config
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user