[dm-devel] [RFC PATCH] libmultipath: is_path_valid(): check if device is in use
Benjamin Marzinski
bmarzins at redhat.com
Thu Nov 17 21:59:25 UTC 2022
On Thu, Nov 17, 2022 at 09:40:26PM +0100, Martin Wilck wrote:
> On Thu, 2022-11-17 at 12:53 -0600, Benjamin Marzinski wrote:
> > On Wed, Nov 09, 2022 at 10:10:07PM +0100, mwilck at suse.com wrote:
> > > From: Martin Wilck <mwilck at suse.com>
> > >
> > With greedy, we expect that the blacklists must be correctly set up,
> > so
> > we're just slowing things down to deal with people not configuring
> > multipath correctly.
>
> Only in theory. Because of the failed-wwids logic, "greedy" works quite
> well actually, even if the blacklist is not correctly set up.
> With this as a special exception.
>
> > But since I rarely see greedy configurations, I
> > don't really have strong feelings about this trade-off.
>
> I've been wondering whether we could make this depend on a config
> option (yes I know, I've said often that we have too many of them).
> We could also have it depend on "greedy". But it might also be useful
> with "smart" if we have a lot of LUNs.
>
> >
> > More suggestions below.
> >
> > [...]
<snip>
Ooops. I signed my name a bit too high. I had one more suggestion, but
it's basically the same as what you suggest above.
> >
> > -Ben
> >
<snip>
> > > @@ -96,6 +346,9 @@ is_path_valid(const char *name, struct config
> > > *conf, struct path *pp,
> > > return PATH_IS_ERROR;
> > > }
> > >
> > > + if (is_device_in_use(pp->udev) > 0)
> > > + return PATH_IS_NOT_VALID;
> > > +
Here.
> >
> > Can we make this only apply to "greedy"? For "strict", "no" and "yes"
> > this makes the common case slower (you are running multipath on a
> > machine with multipath devices that you've seen before) with no real
> > benefit.
> >
> > It might also be useful to run this check before we return "maybe"
> > for
> > find_multipaths "smart", perhaps as an alternative to the O_EXCL test
> > we
> > currently use.
> >
> > > if (conf->find_multipaths == FIND_MULTIPATHS_GREEDY)
> > > return PATH_IS_VALID;
> > >
More information about the dm-devel
mailing list