All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	device-mapper development <dm-devel@lists.linux.dev>
Subject: Re: [PATCH 6/8] libmultipath: signal multipath UUID device with no table
Date: Thu, 7 Nov 2024 12:42:06 -0500	[thread overview]
Message-ID: <Zyz77iYLXPAfTJSl@redhat.com> (raw)
In-Reply-To: <08ddd03d48938378f6281f14f52dfd8b942f9476.camel@suse.com>

On Wed, Nov 06, 2024 at 05:17:30PM +0100, Martin Wilck wrote:
> On Thu, 2024-10-31 at 14:32 -0400, Benjamin Marzinski wrote:
> > if libmp_mapinfo() is run on a device that has a multipath prefixed
> > DM
> > UUID but no table (either active or inactive), it will now return
> > with a
> > new exit code, DMP_BAD_DEV, to signal that this is an invalid
> > multipath
> > device. Currently all code paths treat this identically to
> > DMP_NOT_FOUND.
> > 
> > Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> > ---
> >  libmultipath/devmapper.c | 18 ++++++++++++++++++
> >  libmultipath/devmapper.h |  5 ++++-
> >  2 files changed, 22 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
> > index 13d8c1e5..6e11d5b5 100644
> > --- a/libmultipath/devmapper.c
> > +++ b/libmultipath/devmapper.c
> > @@ -726,6 +726,22 @@ static int libmp_mapinfo__(int flags, mapid_t
> > id, mapinfo_t info, const char *ma
> >  	}
> >  
> >  	if (info.target || info.status || info.size || flags &
> > MAPINFO_TGT_TYPE__) {
> > +		if (!dmi.live_table) {
> > +			/*
> > +			 * If this is device has a multipath uuid
> > but no
> > +			 * table, flag it, so multipath can clean it
> > up
> > +			 */
> > +			if (flags & MAPINFO_CHECK_UUID &&
> > +			    !dmi.inactive_table) {
> > +				condlog(2, "%s: multipath map %s has
> > no table",
> > +					fname__, map_id);
> > +				return DMP_BAD_DEV;
> 
> 
> What about the case when there's an inactive_table? AFAIU that means
> that a resume operation after a table (re)load failed or was
> interrupted, or that the program that (re)loaded the table (multipathd,
> probably) died before it could resume the table.
> 
> In this case we'd fall through the the "map has no targets" case, but
> shouldn't we also treat it as DMP_BAD_DEV?

This is because I was deleting these devices in patch 8, and I didn't
want to delete devices that where in the process of getting modified by
multipath. The code could still delete devices that were getting created
if it ran during the window between when the dm device gets created, and
a table gets loaded. In that case there would be no table. But there
is another window that happens after this during creation and during
a reload failure, where the device doesn't have an active table but
still has an inactive one. I didn't want to delete devices like this,
since it could effect existing devices. We could, for instance, end up
deleting a device that multipath was currently working on and was about
to clean up itself.

But if we aren't deleting these devices, then yes, it would make more
sense to characterize these as DMP_BAD_DEV.

-Ben

> 
> Martin


  reply	other threads:[~2024-11-07 17:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-31 18:32 [PATCH 0/8] multipath fixes to tableless device handling Benjamin Marzinski
2024-10-31 18:32 ` [PATCH 1/8] multipathd: print an error when failing to connect to multipathd Benjamin Marzinski
2024-10-31 18:32 ` [PATCH 2/8] libmultipath: check DM UUID earlier in libmp_mapinfo__ Benjamin Marzinski
2024-10-31 18:32 ` [PATCH 3/8] libmultipath: Don't fail dm_get_maps for DMP_NOT_FOUND Benjamin Marzinski
2024-10-31 18:32 ` [PATCH 4/8] multipathd.service: restart multipathd on failure Benjamin Marzinski
2024-10-31 18:32 ` [PATCH 5/8] libmultipath: use MAPINFO_CHECK_UUID in dm_get_multipath Benjamin Marzinski
2024-10-31 18:32 ` [PATCH 6/8] libmultipath: signal multipath UUID device with no table Benjamin Marzinski
2024-11-06 16:17   ` Martin Wilck
2024-11-07 17:42     ` Benjamin Marzinski [this message]
2024-10-31 18:33 ` [PATCH 7/8] libmultipath: fix removing device after failed creation Benjamin Marzinski
2024-10-31 18:33 ` [RFC PATCH 8/8] libmultipath: remove devices with no table and multipath DM UUID Benjamin Marzinski
2024-11-06 16:52 ` [PATCH 0/8] multipath fixes to tableless device handling Martin Wilck
2024-11-07 12:20   ` Martin Wilck
2024-11-07 17:43     ` Benjamin Marzinski
2024-11-07 18:02       ` Martin Wilck
2024-11-08 22:08         ` Benjamin Marzinski
2024-11-08 23:03           ` Martin Wilck
2024-11-11 17:17             ` Benjamin Marzinski
2024-11-12  7:46               ` Martin Wilck
2024-11-13  0:07                 ` Benjamin Marzinski
2024-11-06 16:52 ` Martin Wilck
2024-11-06 22:39   ` Martin Wilck
2024-11-07 17:48     ` Benjamin Marzinski
2024-11-07 18:03       ` 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=Zyz77iYLXPAfTJSl@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=martin.wilck@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.