All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Hannes Reinecke <hare@suse.de>,
	Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: dm-devel@redhat.com, Xose Vazquez Perez <xose.vazquez@gmail.com>
Subject: Re: [PATCH v3 10/11] libmultipath: don't try to set hwhandler if it is retained
Date: Thu, 22 Jun 2017 11:58:44 +0200	[thread overview]
Message-ID: <1498125524.6002.6.camel@suse.com> (raw)
In-Reply-To: <6f223a11-a7f0-8194-e634-5cad19baab38@suse.de>

On Thu, 2017-06-22 at 08:21 +0200, Hannes Reinecke wrote:
> On 06/21/2017 05:06 PM, Martin Wilck wrote:
> > Setting a device handler only works if retain_attached_hw_handler
> > is 'no', or if the kernel didn't auto-assign a handler. If this
> > is not the case, don't even attempt to set a different handler.
> > 
> > This requires reading the sysfs "dh_state" path attribute.
> > For internal consistency, this attribute must be updated after
> > domap().
> > 
> > Signed-off-by: Martin Wilck <mwilck@suse.com>
> > ---
> >  libmultipath/configure.c | 52
> > +++++++++++++++++++++++++++++++++++++++++++++++-
> >  libmultipath/discovery.c |  4 ++++
> >  libmultipath/propsel.c   | 15 ++++++++++++++
> >  libmultipath/structs.h   |  2 ++
> >  4 files changed, 72 insertions(+), 1 deletion(-)
> > 
> > [...]
>
> Hmm.
> 
> Not sure if I fully agree with this.
> I do see the need to read 'dh_state' from pathinfo(), just to figure
> out
> if an hardware handler is already loaded.
> 
> But once select_hwhandler is done it's quite pointless to update the
> dh_state; what exactly _would_ be the error action in this case?
> Plus the code detects the failure, but then doesn't do anything with
> it...

My concern was that multipathd might carry along wrong state and
possibly print it in log messages, irritating users. It's true, there
is no reasonable error action, and it's quite a lot of code just for
this minor purpose.

> So, please, if you insist on checking dh_state please implement
> correct
> error action here, like updating the 'hwhandler' value to that found
> in
> dh_state or disabling the hardware handler if it's found to be
> detached.

If it's fine with you and other reviewers, I'll happily remove that
part of the patch, and just keep the part in select_hwhandler().

If we want proper error handling, we'd need to check that the handler
of the loaded map as well as the handlers of all paths are set to the
handler configured in multipathd. Unless I'm mistaken, it isn't
guaranteed that all paths will be using the same handler after a map is
set up.

Besides re-reading the dh_state of all paths, this check would also
require re-reading and disassembling the map, and no reasonable error
action is to be seen other then updating the internal state, lots of
code for almost nothing.

Cheers,
Martin

-- 
Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

  reply	other threads:[~2017-06-22  9:58 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21 15:06 [PATCH v3 00/11] multipath-tools: no_path_retry/queue_if_no_path/hwhandler logic Martin Wilck
2017-06-21 15:06 ` [PATCH v3 01/11] libmultipath: load_config: skip setting unnecessary defaults Martin Wilck
2017-06-22  6:01   ` Hannes Reinecke
2017-06-21 15:06 ` [PATCH v3 02/11] libmultipath: add/remove_feature: use const char* for feature Martin Wilck
2017-06-21 15:06 ` [PATCH v3 03/11] libmultipath: clarify option conflicts for "features" Martin Wilck
2017-06-22  6:02   ` Hannes Reinecke
2017-06-21 15:06 ` [PATCH v3 04/11] libmultipath: merge_hwe: fix queue_if_no_path logic Martin Wilck
2017-06-22  6:04   ` Hannes Reinecke
2017-06-21 15:06 ` [PATCH v3 05/11] libmultipath: assemble_map: " Martin Wilck
2017-06-22  6:05   ` Hannes Reinecke
2017-06-21 15:06 ` [PATCH v3 06/11] multipath.conf.5: document no_path_retry vs. queue_if_no_path Martin Wilck
2017-06-22  6:05   ` Hannes Reinecke
2017-06-21 15:06 ` [PATCH v3 07/11] multipath.conf.5: Remove ??? and other minor fixes Martin Wilck
2017-06-22  6:06   ` Hannes Reinecke
2017-06-21 15:06 ` [PATCH v3 08/11] libmultipath: add deprecated warning for some features settings Martin Wilck
2017-06-22  6:06   ` Hannes Reinecke
2017-06-21 15:06 ` [PATCH v3 09/11] libmultipath: retain_attached_hw_handler obsolete with 4.3+ Martin Wilck
2017-06-22  6:07   ` Hannes Reinecke
2017-06-21 15:06 ` [PATCH v3 10/11] libmultipath: don't try to set hwhandler if it is retained Martin Wilck
2017-06-22  6:21   ` Hannes Reinecke
2017-06-22  9:58     ` Martin Wilck [this message]
2017-06-21 15:06 ` [PATCH v3 11/11] libmultipath: don't [un]set queue_if_no_path after domap Martin Wilck
2017-06-22  6:23   ` Hannes Reinecke
2017-06-22  9:34     ` Martin Wilck
2017-06-22 19:21     ` Benjamin Marzinski
2017-06-22 20:44       ` Martin Wilck
2017-06-21 15:15 ` [PATCH v3 00/11] multipath-tools: no_path_retry/queue_if_no_path/hwhandler logic 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=1498125524.6002.6.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.de \
    --cc=xose.vazquez@gmail.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.