diff mbox series

[v3] multipath: display the correct configuration when dumpping config

Message ID tencent_C349DF9EE757FA8936E17CE2F90388B8B909@qq.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series [v3] multipath: display the correct configuration when dumpping config | expand

Commit Message

303146950@qq.com Aug. 13, 2024, 2:12 a.m. UTC
From: Kou Wenqi <kouwenqi@kylinos.cn>

On Fri, 2024-08-09 at 10:38 +0200, mwilck@suse.com 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@kylinos.cn>
---
 multipath/main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Martin Wilck Aug. 13, 2024, 10:17 a.m. UTC | #1
On Tue, 2024-08-13 at 10:12 +0800, 303146950@qq.com wrote:
> From: Kou Wenqi <kouwenqi@kylinos.cn>
> 
> 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@kylinos.cn>
> 

Reviewed-by: Martin Wilck <mwilck@suse.com>
diff mbox series

Patch

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("");