All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <Martin.Wilck@suse.com>
Cc: "dm-devel@redhat.com" <dm-devel@redhat.com>
Subject: Re: [PATCH 2/7] multipathd: fix check_path errors with removed map
Date: Fri, 19 Jun 2020 11:52:36 -0500	[thread overview]
Message-ID: <20200619165236.GP5894@octiron.msp.redhat.com> (raw)
In-Reply-To: <6f9284eeec0dda69e8e4dd4b2858f02d3c31fb8b.camel@suse.com>

On Fri, Jun 19, 2020 at 01:42:47PM +0000, Martin Wilck wrote:
> On Thu, 2020-06-18 at 18:17 -0500, Benjamin Marzinski wrote:
> > On Thu, Jun 18, 2020 at 07:34:38PM +0000, Martin Wilck wrote:
> > > On Wed, 2020-06-17 at 19:24 -0500, Benjamin Marzinski wrote:
> > > > 
> > > >  static void
> > > > @@ -2088,8 +2084,13 @@ check_path (struct vectors * vecs, struct
> > > > path
> > > > * pp, unsigned int ticks)
> > > >  	 * Synchronize with kernel state
> > > >  	 */
> > > >  	if (update_multipath_strings(pp->mpp, vecs->pathvec, 1)) {
> > > > +		struct dm_info info;
> > > >  		condlog(1, "%s: Could not synchronize with kernel
> > > > state",
> > > >  			pp->dev);
> > > > +		if (pp->mpp && pp->mpp->alias &&
> > > > +		    do_dm_get_info(pp->mpp->alias, &info) == 0)
> > > > +			/* multipath device missing. Likely removed */
> > > > +			return 0;
> > > >  		pp->dmstate = PSTATE_UNDEF;
> > > 
> > > It would be more elegant if we could distinguish different failure
> > > modes from update_multipath_strings() directly, without having to
> > > call
> > > do_dm_get_info() again.
> > 
> > Seems reasonable. I'll take a look at that.
> 
> Yet another idea: I just discussed this with Hannes, and he pointed out
> that right below this code, we have
> 
> 	/* if update_multipath_strings orphaned the path, quit early */
> 	if (!pp->mpp)
> 		return 0;
> 
> ... which could have the same effect, if pp->mpp was reloaded. Probably
> that doesn't happen because the pp->mpp dereference is cached in a
> register, but we could simply add a READ_ONCE there.

When update_multipath_strings() calls update_multipath_table() it will
fail because the table no longer exists.  If we differentiate between
a dm error and not finding the map, we can exit early without having to
call do_dm_get_info() again. But right now, if the map is gone, but we
haven't got the uevent removing it, then nothing will clear pp->mpp. If
we did get the uevent, then it must have grabbed the vecs lock. That
better have caused a memory barrier, which will guarantee that
check_path() sees the updated value.

-Ben
 
> Choose what you prefer.
> 
> Regards,
> Martin
> 
> -- 
> Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
> SUSE  Software Solutions Germany GmbH
> HRB 36809, AG Nürnberg GF: Felix
> Imendörffer
> 

  reply	other threads:[~2020-06-19 16:52 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18  0:24 [PATCH 0/7] Fix muitpath/multipathd flush issue Benjamin Marzinski
2020-06-18  0:24 ` [PATCH 1/7] libmultipath: change do_get_info returns Benjamin Marzinski
2020-06-18 15:27   ` Martin Wilck
2020-06-18 23:17     ` Benjamin Marzinski
2020-06-18  0:24 ` [PATCH 2/7] multipathd: fix check_path errors with removed map Benjamin Marzinski
2020-06-18 19:34   ` Martin Wilck
2020-06-18 23:17     ` Benjamin Marzinski
2020-06-19  6:32       ` Hannes Reinecke
2020-06-19 16:30         ` Benjamin Marzinski
2020-06-19 20:03           ` Martin Wilck
2020-06-19 13:42       ` Martin Wilck
2020-06-19 16:52         ` Benjamin Marzinski [this message]
2020-06-19 20:09           ` Martin Wilck
2020-06-18  0:24 ` [PATCH 3/7] libmultipath: make dm_flush_maps only return 0 on success Benjamin Marzinski
2020-06-18 20:29   ` Martin Wilck
2020-06-18  0:24 ` [PATCH 4/7] multipathd: add "del maps" multipathd command Benjamin Marzinski
2020-06-18 20:37   ` Martin Wilck
2020-06-18 23:12     ` Benjamin Marzinski
2020-06-19 13:35       ` Martin Wilck
2020-06-18  0:24 ` [PATCH 5/7] multipath: make flushing maps work like other commands Benjamin Marzinski
2020-06-18 20:38   ` Martin Wilck
2020-06-18  0:24 ` [PATCH 6/7] multipath: delegate flushing maps to multipathd Benjamin Marzinski
2020-06-18 20:40   ` Martin Wilck
2020-06-18  0:24 ` [PATCH 7/7] multipath: add option to skip multipathd delegation Benjamin Marzinski
2020-06-18 20:44   ` Martin Wilck
2020-06-18 23:15     ` Benjamin Marzinski
2020-06-18  9:00 ` [PATCH 0/7] Fix muitpath/multipathd flush issue Martin Wilck
2020-06-18 18:04   ` Benjamin Marzinski
2020-06-18 20:06     ` Martin Wilck
2020-06-18 23:06       ` Benjamin Marzinski
2020-07-01 20:54         ` Martin Wilck
2020-07-02  3:14           ` Benjamin Marzinski
2020-07-02 12:24             ` Martin Wilck
2020-07-02 15:18               ` Benjamin Marzinski
2020-07-02 16:45                 ` Martin Wilck
2020-07-02 19:41                   ` Benjamin Marzinski
2020-07-03 15:12                     ` Martin Wilck
2020-07-03 16:39                       ` Mike Snitzer
2020-07-03 18:50                         ` 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=20200619165236.GP5894@octiron.msp.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=Martin.Wilck@suse.com \
    --cc=dm-devel@redhat.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.