Re: [PATCH 12/16] multipathd: make cli_handlers check for paths by dev and devt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 14, 2023 at 06:17:18PM +0100, Martin Wilck wrote:
> On Tue, 2023-12-12 at 18:53 -0500, Benjamin Marzinski wrote:
> > Some of the client handlers checked for paths by both dev and devt,
> > but
> > not all. Also, many of the client handlers don't print anything if
> > they
> > failed to find a path. Make all the client handlers which work on
> > path
> > devices use a new function, find_path_by_str(), which will try both
> > methods to find a path, and can print out an error message if none is
> > found.
> > 
> > Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>
> > ---
> >  multipathd/cli_handlers.c | 40 ++++++++++++++++++++-----------------
> > --
> >  1 file changed, 21 insertions(+), 19 deletions(-)
> > 
> > diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
> > index 063a771f..7f550030 100644
> > --- a/multipathd/cli_handlers.c
> > +++ b/multipathd/cli_handlers.c
> > @@ -33,6 +33,20 @@
> >  #include "cli_handlers.h"
> >  #include "devmapper.h"
> >  
> > +static struct path *
> > +find_path_by_str(const struct _vector *pathvec, const char *str,
> > +		  const char *action_str)
> > +{
> > +	struct path *pp;
> > +
> > +	if (!(pp = find_path_by_dev(pathvec, str)))
> > +		pp = find_path_by_devt(pathvec, str);
> 
> I wonder if devt should be tried first. It doesn't make a real
> difference because no real-world devices will have major:minor names,
> and the callers in the old code did it the other way around, too; but
> it would feel more correct to me.

I'm fine with switching the order. Also, I assume you'd like the log
level to be set to 2, right?

-Ben
 
> Other than that, LGTM.
> 
> Regards
> Martin





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux