From 0802e9dfd27e2333615e8068d7fa55a614bef92e Mon Sep 17 00:00:00 2001 From: Kou Wenqi 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 Reviewed-by: Martin Wilck --- 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