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 0/8] multipath fixes to tableless device handling
Date: Mon, 11 Nov 2024 12:17:17 -0500 [thread overview]
Message-ID: <ZzI8HbwgmBQSLbLk@redhat.com> (raw)
In-Reply-To: <a7b6076cc759383e407ac9e46ff39be14f5a1b6d.camel@suse.com>
On Sat, Nov 09, 2024 at 12:03:33AM +0100, Martin Wilck wrote:
> On Fri, 2024-11-08 at 17:08 -0500, Benjamin Marzinski wrote:
> > On Thu, Nov 07, 2024 at 07:02:11PM +0100, Martin Wilck wrote:
> > > On Thu, 2024-11-07 at 12:43 -0500, Benjamin Marzinski wrote:
> > > > On Thu, Nov 07, 2024 at 01:20:09PM +0100, Martin Wilck wrote:
> > > > >
> > > > > Thinking about it, I believe we should actually accept devices
> > > > > that
> > > > > have an mpath UUID and an empty table, and add them to our
> > > > > mpvec.
> > > > > We
> > > > > should treat them like devices that have a multipath target but
> > > > > no
> > > > > path
> > > > > devices. If any matching paths become available, the map will
> > > > > be
> > > > > reloaded and the issue will be fixed. IMO, this is less prone
> > > > > to
> > > > > race
> > > > > conditions than trying to delete and re-add the devices.
> > > >
> > > > I'm not sure off the top of my head how easy it will be to handle
> > > > devices with no dm table at all, but I'll take a look into this.
> > >
> > > I tried this on a system with 0.9.9 yesterday. 0.9.9 will not add
> > > the
> > > map into the mpvec. But in coalesce_paths(), it will just reload
> > > the
> > > map:
> >
> > Given that the code already does the right thing without needing any
> > changes to handle tableless maps makes me feel like just removing the
> > final patch is the best idea.
>
> If we do this, do we still need the special case for DMP_BAD_DEV? IMO
> we just need to make sure that dm_get_maps() doesn't return an error if
> it encounters an empty map.
Depends. If we fail attempting to create a device, we could have raced
with something else attempting to create it. Just checking for
dm_map_present() before we remove the device won't distinguish between
these two cases at all.
On the other hand, there is still a window where the program that we
raced with is in the middle of creating the device, but it doesn't have
a live table yet. In this case, even the DMP_BAD_DEV code won't be able
to distinguish between a map that didn't get created correctly and one
that is in the process of getting created. It would reduce the window
where we could accidentally delete a working device, however.
Since it doesn't add much complexity, I lean towards keeping it, but it
is one more state we need to handle on returns from libmp_mapinfo(), so
I'm open to an argument that it's not worth it.
> > The only issue with the current code is that if you have a device
> > with
> > no table with the UUID of a multipath device but a different name
> > than
> > that multipath device should have, multipath will try to create a new
> > device instead of reload it, and this fails, since the UUID is
> > already
> > in use.
>
> That should be handled in coalesce_paths(). It's basically the scenario
> that occurs if we enable or disable user_friendly names.
Except that we have a mpp for the other device if it has a table. If the
device doesn't have a table, then a mpp isn't created, so
coalesce_paths() doesn't track it. We could add code to create mpps for
these tableless devices, but it's another trade off of added complexity
to handle a rare corner case, and I'm not sure this one is worth it.
-Ben
> > That should probably be handled by making the multipath code pay more
> > attention to the device UUID and less to the device name, but that's
> > work for a different patchset.
>
> Yes, definitely.
>
> Martin
next prev parent reply other threads:[~2024-11-11 17:17 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
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 [this message]
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=ZzI8HbwgmBQSLbLk@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.