From: Martin Wilck <mwilck@suse.com>
To: Benjamin Marzinski <bmarzins@redhat.com>, tang.junhui@zte.com.cn
Cc: tang.wenjun3@zte.com.cn, zhang.kai16@zte.com.cn,
dm-devel@redhat.com, bart.vanassche@sandisk.com
Subject: uid_attrs (was Re: [PATCH 04/11] multipathd: add need_do_map to indicate whether need calling domap() in ev_add_path())
Date: Wed, 05 Apr 2017 15:26:06 +0200 [thread overview]
Message-ID: <1491398766.15890.15.camel@suse.com> (raw)
In-Reply-To: <20170117161401.GX2732@octiron.msp.redhat.com>
Hi Ben & Tang,
On Tue, 2017-01-17 at 10:14 -0600, Benjamin Marzinski wrote:
> On Tue, Jan 17, 2017 at 03:28:06PM +0800, tang.junhui@zte.com.cn
> wrote:
> > Hello Ben
> >
> > Thank you for your patience again.
> >
> > I'll modify code according to your suggestion as this:
> > 1) add configuration in the defaults section
> > uid_attrs "sd:ID_SERIAL dasd:ID_UID"
> > it would override any other configurations if this
> > filed is configured and matched;
> >
> > 2) In uevent processing thread, we will assign merge_id
> > according the label in uevents by this configuration;
> >
> > 3) this patch will take back:
> > [PATCH 12/12] libmultipath: use existing wwid when
> > wwid has already been existed in uevent
> >
> > 4) if this field is not configured, only do filtering and
> > no merging works.
> >
> > Please confirm whether this modification is feasible.
>
> Yes. This is perfectly reasonable solution. Thanks for doing all the
> work on this.
I'm sorry to jump upon this old discussion again. I've just recently
realized that with the introduction of "uid_attrs", the section on
"WWID generation" in multipath.conf(5) needs to be corrected. Looking
into that, I find it unfortunate that this new option was introduced.
It makes an already complex configuration exercise even more confusing
(try to rewrite that man page paragraph in an easily understandable way
and I think you'll know what I mean).
>From the end user point of view, "uid_attrs" seems to simply duplicate
the functionality of "uid_attribute", just in more awkward syntax, and
with higher priority. As a side effect, it enables uevent merging,
which is documented in the man page but unexpected from the name of the
option.
I went through Ben's reasoning from Jan 16th again:
> In general, the code to set need_do_map if the wwid and merge_id
> don't
> match only works if either none of the device in a merged set have
> wwids
> that match the merge_id, or if the last device has a wwid that
> matches
> the merge_id. If there are devices with wwids that match the
> merge_id,
> but the last device in the set isn't one of them, then some devices
> will
> not get a multipath device created for them.
>
[...]
The easy way to fix it is to use the other possibility that I
mentioned
> before, which is to not have the merge_id, and just use the udev
> provided wwid, instead of fetching it from pathinfo. Like I
> mentioned,
> if you do this, you want to make sure that you only try to grab the
> wwid
> from the udev events for devices with the correct kernel name:
> ID_SERIAL
> only for "sd.*" devices, and ID_UID only for "dasd.*" devices. I also
> think that this should be configurable.
>
> Otherwise, you can either go through the messy work of calling domap
> correctly when the last device of a set has a wwid that doesn't match
> the merge_id, or we can decide that this won't acutally cause
> problems
> with any known device, and punt fixing it for now. And if it causes
> problems with some future devices, we can deal with it then.
It appears that Tang chose Ben's proposed "easy way" to fix the problem
described. The key point appears to be to "use the udev provided wwid,
instead of fetching it from pathinfo". But the end result may be
confusing for users.
I didn't react at the time, but in hindsight I'd find it much better if
multipath's standard WWID generation procedure had been used for uevent
merging. I admit I don't fully grok why that's harder to implement than
the solution that got merged, probably because I didn't try yet :-)
Anyway, I wonder if it would still be possible to change this at this
point in time (i.e. after "uid_attrs" was merged).
Cheers,
Martin
PS: And while I'm nitpicking anyway: The description of "uid_attrs" in
the man page talks about "type of device", while what's really matched
against is the kernel devnode name such as /dev/sdX or /dev/dasdY. The
reader is left clueless what to do for devices other than sd or dasd (I
suspect that that's actually unsupported, but the man page doesn't say
anything about that).
I can provide a patches for this (and for "WWID generation") but I'd
like to discuss the main topic of this email first.
--
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
next prev parent reply other threads:[~2017-04-05 13:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 5:52 [PATCH 00/11] multipath-tools: improve processing efficiency for addition and deletion of multipath devices tang.junhui
2017-01-12 5:52 ` [PATCH 01/11] libmultipath: add merge_id in "struct uevent" for uevents merging tang.junhui
2017-01-12 5:52 ` [PATCH 02/11] libmultipath: add merge_node for "struct uevent" to record nodes of merged uevents tang.junhui
2017-01-12 5:52 ` [PATCH 03/11] libmultipath: add three list iteration macros tang.junhui
2017-01-12 5:52 ` [PATCH 04/11] multipathd: add need_do_map to indicate whether need calling domap() in ev_add_path() tang.junhui
2017-01-16 21:38 ` Benjamin Marzinski
2017-01-17 7:28 ` tang.junhui
2017-01-17 16:14 ` Benjamin Marzinski
2017-04-05 13:26 ` Martin Wilck [this message]
2017-04-05 18:45 ` uid_attrs (was Re: [PATCH 04/11] multipathd: add need_do_map to indicate whether need calling domap() in ev_add_path()) Benjamin Marzinski
2017-04-05 20:16 ` Martin Wilck
2017-04-05 23:19 ` Benjamin Marzinski
2017-01-12 5:52 ` [PATCH 05/11] multipathd: add need_do_map to indicate whether need calling domap() in ev_remove_path() tang.junhui
2017-01-16 18:18 ` Benjamin Marzinski
2017-01-12 5:52 ` [PATCH 06/11] multipathd: move uev_discard() to uevent.c and change its name to uevent_can_discard() tang.junhui
2017-01-12 5:52 ` [PATCH 07/11] multipathd: move calling filter_devnode() from uev_trigger() " tang.junhui
2017-01-12 5:52 ` [PATCH 08/11] libmultipath: wait one seconds for more uevents in uevent_listen() in uevents burst situations tang.junhui
2017-01-12 5:52 ` [PATCH 09/11] multipathd: merge uevents before proccessing tang.junhui
2017-01-12 5:52 ` [PATCH 10/11] libmultipath: filter " tang.junhui
2017-01-12 5:52 ` [PATCH 11/11] multipathd: proccess merged uevents tang.junhui
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=1491398766.15890.15.camel@suse.com \
--to=mwilck@suse.com \
--cc=bart.vanassche@sandisk.com \
--cc=bmarzins@redhat.com \
--cc=dm-devel@redhat.com \
--cc=tang.junhui@zte.com.cn \
--cc=tang.wenjun3@zte.com.cn \
--cc=zhang.kai16@zte.com.cn \
/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.