From: "Benjamin Marzinski" <bmarzins@redhat.com>
To: Martin Wilck <mwilck@suse.com>
Cc: dm-devel@redhat.com
Subject: Re: [PATCH 3/7] multipathd: print error message if checkint is not initialized
Date: Fri, 26 Oct 2018 13:55:17 -0500 [thread overview]
Message-ID: <20181026185517.GH7100@octiron.msp.redhat.com> (raw)
In-Reply-To: <20181023220552.1306-4-mwilck@suse.com>
On Wed, Oct 24, 2018 at 12:05:48AM +0200, Martin Wilck wrote:
> This is just a safety measure in case I overlooked something wrt
> the checkint initialization. It could be reverted once we know the
> error message isn't triggered.
>
Reviewed-by: Benjamin Marzinsk <bmarzins@redhat.com>
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
> libmultipath/defaults.h | 1 +
> libmultipath/dict.c | 14 ++++++++++++--
> libmultipath/structs.c | 1 +
> multipathd/main.c | 6 ++++++
> 4 files changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
> index 7f3839fc..65769398 100644
> --- a/libmultipath/defaults.h
> +++ b/libmultipath/defaults.h
> @@ -46,6 +46,7 @@
> #define DEFAULT_UNKNOWN_FIND_MULTIPATHS_TIMEOUT 1
> #define DEFAULT_ALL_TG_PT ALL_TG_PT_OFF
>
> +#define CHECKINT_UNDEF (~0U)
> #define DEFAULT_CHECKINT 5
> #define MAX_CHECKINT(a) (a << 2)
>
> diff --git a/libmultipath/dict.c b/libmultipath/dict.c
> index c3f5a6e6..a81c051f 100644
> --- a/libmultipath/dict.c
> +++ b/libmultipath/dict.c
> @@ -264,7 +264,17 @@ snprint_mp_ ## option (struct config *conf, char * buff, int len, \
> return function (buff, len, mpe->option); \
> }
>
> -declare_def_handler(checkint, set_int)
> +static int checkint_handler(struct config *conf, vector strvec)
> +{
> + int rc = set_int(strvec, &conf->checkint);
> +
> + if (rc)
> + return rc;
> + if (conf->checkint == CHECKINT_UNDEF)
> + conf->checkint--;
> + return 0;
> +}
> +
> declare_def_snprint(checkint, print_int)
>
> declare_def_handler(max_checkint, set_int)
> @@ -1563,7 +1573,7 @@ init_keywords(vector keywords)
> {
> install_keyword_root("defaults", NULL);
> install_keyword("verbosity", &def_verbosity_handler, &snprint_def_verbosity);
> - install_keyword("polling_interval", &def_checkint_handler, &snprint_def_checkint);
> + install_keyword("polling_interval", &checkint_handler, &snprint_def_checkint);
> install_keyword("max_polling_interval", &def_max_checkint_handler, &snprint_def_max_checkint);
> install_keyword("reassign_maps", &def_reassign_maps_handler, &snprint_def_reassign_maps);
> install_keyword("multipath_dir", &def_multipath_dir_handler, &snprint_def_multipath_dir);
> diff --git a/libmultipath/structs.c b/libmultipath/structs.c
> index caa178a6..fee899bd 100644
> --- a/libmultipath/structs.c
> +++ b/libmultipath/structs.c
> @@ -100,6 +100,7 @@ alloc_path (void)
> pp->fd = -1;
> pp->tpgs = TPGS_UNDEF;
> pp->priority = PRIO_UNDEF;
> + pp->checkint = CHECKINT_UNDEF;
> checker_clear(&pp->checker);
> dm_path_to_gen(pp)->ops = &dm_gen_path_ops;
> pp->hwe = vector_alloc();
> diff --git a/multipathd/main.c b/multipathd/main.c
> index 3464ebfa..083abf28 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c
> @@ -1840,6 +1840,12 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
> max_checkint = conf->max_checkint;
> verbosity = conf->verbosity;
> put_multipath_config(conf);
> +
> + if (pp->checkint == CHECKINT_UNDEF) {
> + condlog(0, "%s: BUG: checkint is not set", pp->dev);
> + pp->checkint = checkint;
> + };
> +
> if (!pp->mpp && pp->initialized == INIT_MISSING_UDEV) {
> if (pp->retriggers < retrigger_tries) {
> condlog(2, "%s: triggering change event to reinitialize",
> --
> 2.19.1
next prev parent reply other threads:[~2018-10-26 18:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-23 22:05 [PATCH 0/7] multipathd: make uxlsnr errors really fatal Martin Wilck
2018-10-23 22:05 ` [PATCH 1/7] libmultipath: set pp->checkint in store_pathinfo() Martin Wilck
2018-10-26 18:53 ` Benjamin Marzinski
2018-10-23 22:05 ` [PATCH 2/7] multipathd: remove init_path_check_interval() Martin Wilck
2018-10-26 18:53 ` Benjamin Marzinski
2018-10-23 22:05 ` [PATCH 3/7] multipathd: print error message if checkint is not initialized Martin Wilck
2018-10-26 18:55 ` Benjamin Marzinski [this message]
2018-10-23 22:05 ` [PATCH 4/7] multipathd: open client socket early Martin Wilck
2018-10-26 18:57 ` Benjamin Marzinski
2018-10-23 22:05 ` [PATCH 5/7] multipathd: set DAEMON_CONFIGURE from uxlsnr thread Martin Wilck
2018-10-26 20:19 ` Benjamin Marzinski
2018-10-30 16:55 ` Martin Wilck
2018-10-23 22:05 ` [PATCH 6/7] multipathd: make DAEMON_SHUTDOWN a terminal state Martin Wilck
2018-10-26 20:50 ` Benjamin Marzinski
2018-10-23 22:05 ` [PATCH 7/7] multipathd: only grab conf once for filter_path() Martin Wilck
2018-10-26 20:50 ` Benjamin Marzinski
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=20181026185517.GH7100@octiron.msp.redhat.com \
--to=bmarzins@redhat.com \
--cc=dm-devel@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox