All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: mwilck@suse.com
Cc: dm-devel@redhat.com
Subject: Re: [PATCH 66/74] libmultipath: update_pathvec_from_dm: handle pp->mpp mismatch
Date: Sun, 19 Jul 2020 00:12:00 -0500	[thread overview]
Message-ID: <20200719051200.GX11089@octiron.msp.redhat.com> (raw)
In-Reply-To: <20200709105145.9211-14-mwilck@suse.com>

On Thu, Jul 09, 2020 at 12:51:37PM +0200, mwilck@suse.com wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> Treat this like a WWID mismatch.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  libmultipath/structs_vec.c | 37 +++++++++++++++++++++++--------------
>  1 file changed, 23 insertions(+), 14 deletions(-)
> 
> diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
> index 5dd37d5..8651b98 100644
> --- a/libmultipath/structs_vec.c
> +++ b/libmultipath/structs_vec.c
> @@ -118,6 +118,12 @@ bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp,
>  			goto delete_pg;
>  
>  		vector_foreach_slot(pgp->paths, pp, j) {
> +
> +			if (pp->mpp && pp->mpp != mpp) {
> +				condlog(0, "BUG: %s: found path %s which is already in %s",
> +					mpp->alias, pp->dev, pp->mpp->alias);
> +				goto bad_path;
> +			}
>  			pp->mpp = mpp;
>  
>  			if (pp->udev) {
> @@ -163,25 +169,28 @@ bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp,
>  
>  					condlog(0, "%s: path %s WWID %s doesn't match, removing from map",
>  						mpp->wwid, pp->dev_t, pp->wwid);
> -					/*
> -					 * This path exists, but in the wong map.
> -					 * We can't reload the map from here.
> -					 * Instead, treat this path like "missing udev",
> -					 * which it probably is.
> -					 * check_path() will trigger an uevent
> -					 * and reset pp->tick.
> -					 */
> -					must_reload = true;
> -					pp->mpp = NULL;
> -					dm_fail_path(mpp->alias, pp->dev_t);
> -					vector_del_slot(pgp->paths, j--);
> -					pp->initialized = INIT_MISSING_UDEV;
> -					pp->tick = 1;
> +					goto bad_path;
>  				}
>  				condlog(2, "%s: adding new path %s",
>  					mpp->alias, pp->dev);
>  				store_path(pathvec, pp);
> +
>  			}
> +			continue;
> +
> +		bad_path:
> +			/*
> +			 * This path exists, but in the wrong map.
> +			 * We can't reload the map from here.
> +			 * Instead, treat this path like "missing udev".
> +			 * check_path() will trigger an uevent and reset pp->tick.
> +			 */
> +			must_reload = true;
> +			pp->mpp = NULL;
> +			dm_fail_path(mpp->alias, pp->dev_t);
> +			vector_del_slot(pgp->paths, j--);
> +			pp->initialized = INIT_MISSING_UDEV;
> +			pp->tick = 1;

Is there a reason not to call orphan_path() to clean up things like any
open fd, until we figure out what to do with the path.

>  		}
>  		if (VECTOR_SIZE(pgp->paths) != 0)
>  			continue;
> -- 
> 2.26.2

  reply	other threads:[~2020-07-19  5:12 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09 10:51 [PATCH 00/74] multipath-tools series part V: removed path handling mwilck
2020-07-09 10:51 ` [PATCH 54/74] libmultipath: protect use of pp->udev mwilck
2020-07-09 10:51 ` [PATCH 55/74] libmultipath: add uninitialize_path() mwilck
2020-07-09 10:51 ` [PATCH 56/74] multipath-tools: introduce INIT_REMOVED state mwilck
2020-07-09 10:51 ` [PATCH 57/74] libmultipath: update_mpp_paths(): handle INIT_REMOVED mwilck
2020-07-09 10:51 ` [PATCH 58/74] libmultipath: verify_paths(): don't delete paths from pathvec mwilck
2020-07-09 10:51 ` [PATCH 59/74] libmultipath: sync_paths(): handle INIT_REMOVED mwilck
2020-07-09 10:51 ` [PATCH 60/74] libmultipath: orphan_paths(): delete paths in INIT_REMOVED state mwilck
2020-07-09 10:51 ` [PATCH 61/74] libmultipath: adopt_paths(): skip removed paths mwilck
2020-07-18  4:28   ` Benjamin Marzinski
2020-07-09 10:51 ` [PATCH 62/74] multipathd: ev_remove_path(): use INIT_REMOVED mwilck
2020-07-09 10:51 ` [PATCH 63/74] multipathd: deal with INIT_REMOVED during path addition mwilck
2020-07-18  5:46   ` Benjamin Marzinski
2020-07-09 10:51 ` [PATCH 64/74] multipathd: check_path(): set retrigger_delay if necessary mwilck
2020-07-19  5:07   ` Benjamin Marzinski
2020-08-05 16:37     ` Martin Wilck
2020-07-09 10:51 ` [PATCH 65/74] libmultipath: add update_pathvec_from_dm() mwilck
2020-07-19  4:46   ` Benjamin Marzinski
2020-08-05 20:12     ` Martin Wilck
2020-07-09 10:51 ` [PATCH 66/74] libmultipath: update_pathvec_from_dm: handle pp->mpp mismatch mwilck
2020-07-19  5:12   ` Benjamin Marzinski [this message]
2020-08-05 19:44     ` Martin Wilck
2020-07-09 10:51 ` [PATCH 67/74] libmultipath: disassemble_map(): always search paths by dev_t mwilck
2020-07-09 10:51 ` [PATCH 68/74] libmultipath: disassemble_map(): require non-NULL pathvec mwilck
2020-07-09 10:51 ` [PATCH 69/74] libmultipath: disassemble_map(): get rid of "is_daemon" argument mwilck
2020-07-19  5:26   ` Benjamin Marzinski
2020-08-05 20:05     ` Martin Wilck
2020-08-11  4:56       ` Benjamin Marzinski
2020-07-09 10:51 ` [PATCH 70/74] libmultipath: disassemble_map(): do not change pathvec and WWIDs mwilck
2020-07-09 10:51 ` [PATCH 71/74] multipath: use update_pathvec_from_dm() mwilck
2020-07-20  2:57   ` Benjamin Marzinski
2020-08-05 20:22     ` Martin Wilck
2020-07-09 10:51 ` [PATCH 72/74] libmpathpersist: " mwilck
2020-07-09 10:51 ` [PATCH 73/74] libmultipath: decrease loglevel in store_path() mwilck
2020-07-09 10:51 ` [PATCH 74/74] libmultipath: dmparser: constify function arguments mwilck
2020-07-20 21:19 ` [PATCH 00/74] multipath-tools series part V: removed path handling 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=20200719051200.GX11089@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 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.