All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: 303146950@qq.com
Cc: dm-devel@lists.linux.dev, mwilck@suse.com,
	Kou Wenqi <kouwenqi@kylinos.cn>
Subject: Re: [PATCH v2] multipath: display the correct configuration when dumpping config
Date: Mon, 24 Jun 2024 12:04:08 -0400	[thread overview]
Message-ID: <ZnmY-Mu2hcmU_4Qm@redhat.com> (raw)
In-Reply-To: <tencent_FE02DEB8FF48DD9EE156F288BCE172E25709@qq.com>

On Mon, Jun 24, 2024 at 09:45:27AM +0800, 303146950@qq.com wrote:
> From: Kou Wenqi <kouwenqi@kylinos.cn>
> 
> "multipath -t" and "multipath -T" might show the wrong
> multipathd configuration items "retrigger_tries" and
> "force_sync". Make sure they don't.
> 
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> Signed-off-by: Kou Wenqi <kouwenqi@kylinos.cn>
> ---
>  multipath/main.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/multipath/main.c b/multipath/main.c
> index ce702e7f..f4abdad0 100644
> --- a/multipath/main.c
> +++ b/multipath/main.c
> @@ -842,6 +842,8 @@ main (int argc, char *argv[])
>  	char *dev = NULL;
>  	struct config *conf;
>  	bool enable_foreign = false;
> +	int retrigger_tries_ori;
> +	int force_sync_ori;
>  
>  	libmultipath_init();
>  	if (atexit(dm_lib_exit) || atexit(libmultipath_exit))
> @@ -852,7 +854,9 @@ main (int argc, char *argv[])
>  	if (atexit(uninit_config))
>  		condlog(1, "failed to register cleanup handler for config: %m");
>  	conf = get_multipath_config();
> +	retrigger_tries_ori = conf->retrigger_tries;
>  	conf->retrigger_tries = 0;
> +	force_sync_ori = conf->force_sync;
>  	conf->force_sync = 1;
>  	if (atexit(cleanup_vecs))
>  		condlog(1, "failed to register cleanup handler for vecs: %m");
> @@ -924,10 +928,14 @@ main (int argc, char *argv[])
>  				conf->find_multipaths = FIND_MULTIPATHS_GREEDY;
>  			break;
>  		case 't':
> +			conf->retrigger_tries = retrigger_tries_ori;
> +			conf->force_sync = force_sync_ori;
>  			r = dump_config(conf, NULL, NULL) ? RTVL_FAIL : RTVL_OK;
>  			goto out;
>  		case 'T':
>  			cmd = CMD_DUMP_CONFIG;
> +			conf->retrigger_tries = retrigger_tries_ori;
> +			conf->force_sync = force_sync_ori;
>  			break;
>  		case 'h':
>  			usage(argv[0]);
> -- 
> 2.27.0
> 


  reply	other threads:[~2024-06-24 16:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24  1:45 [PATCH v2] multipath: display the correct configuration when dumpping config 303146950
2024-06-24 16:04 ` Benjamin Marzinski [this message]
2024-08-09  8:38 ` Martin Wilck
2024-08-13  2:12   ` [PATCH v3] " 303146950
2024-08-13 10:17     ` Martin Wilck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZnmY-Mu2hcmU_4Qm@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=303146950@qq.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=kouwenqi@kylinos.cn \
    --cc=mwilck@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.