From: Kou Wenqi <kouwenqi@xxxxxxxxxx> On Fri, 2024-08-09 at 10:38 +0200, mwilck@xxxxxxxx wrote: > Thanks for the patch! I'd prefer the following, if you agree. > > diff --git a/multipath/main.c b/multipath/main.c > index 4b19d2e..28e3a05 100644 > --- a/multipath/main.c > +++ b/multipath/main.c > @@ -853,8 +853,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; > if (atexit(cleanup_vecs)) > condlog(1, "failed to register cleanup handler for vecs: %m"); > if (atexit(cleanup_bindings)) > @@ -1001,6 +999,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 ((cmd == CMD_LIST_SHORT || cmd == CMD_LIST_LONG) && enable_foreign) > conf->enable_foreign = strdup(""); Thanks for your review and revised opinion. Here is the new patch. "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@xxxxxxxxxx> --- multipath/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/multipath/main.c b/multipath/main.c index ce702e7f..69552896 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -852,8 +852,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; if (atexit(cleanup_vecs)) condlog(1, "failed to register cleanup handler for vecs: %m"); if (atexit(cleanup_bindings)) @@ -1000,6 +998,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 ((cmd == CMD_LIST_SHORT || cmd == CMD_LIST_LONG) && enable_foreign) conf->enable_foreign = strdup(""); -- 2.27.0