multipath-tools/0050-multipath-display-the-correct-configuration-when-dum.patch
2024-08-26 12:04:50 +08:00

45 lines
1.3 KiB
Diff

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 65f2949..4853d17 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -875,8 +875,6 @@ main (int argc, char *argv[])
if (!conf)
exit(RTVL_FAIL);
multipath_conf = conf;
- conf->retrigger_tries = 0;
- conf->force_sync = 1;
while ((arg = getopt(argc, argv, ":adcChl::FfM:v:p:b:BrR:itTquUwW")) != EOF ) {
switch(arg) {
case 1: printf("optarg : %s\n",optarg);
@@ -1017,6 +1015,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