From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: "martin.petersen@oracle.com" <martin.petersen@oracle.com>,
Hannes Reinecke <hare@suse.com>, "hch@lst.de" <hch@lst.de>,
"dgilbert@interlog.com" <dgilbert@interlog.com>,
"dm-devel@redhat.com" <dm-devel@redhat.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
"systemd-devel@lists.freedesktop.org"
<systemd-devel@lists.freedesktop.org>
Subject: Re: RFC: one more time: SCSI device identification
Date: Thu, 22 Apr 2021 11:14:20 -0500 [thread overview]
Message-ID: <20210422161420.GF20773@octiron.msp.redhat.com> (raw)
In-Reply-To: <685c40341d2ddef2fe5a54dd656d10104b0c1bfa.camel@suse.com>
On Thu, Apr 22, 2021 at 09:07:15AM +0000, Martin Wilck wrote:
> On Wed, 2021-04-21 at 22:46 -0400, Martin K. Petersen wrote:
> >
> > Martin,
> >
> > > Hm, it sounds intriguing, but it has issues in its own right. For
> > > years to come, user space will have to probe whether these attribute
> > > exist, and fall back to the current ones ("wwid", "vpd_pg83")
> > > otherwise. So user space can't be simplified any time soon. Speaking
> > > for an important user space consumer of WWIDs (multipathd), I doubt
> > > that this would improve matters for us. We'd be happy if the kernel
> > > could just pick the "best" designator for us. But I understand that
> > > the kernel can't guarantee a good choice (user space can't either).
> >
> > But user space can be adapted at runtime to pick one designator over
> > the
> > other (ha!).
>
> And that's exactly the problem. Effectively, all user space relies on
> udev today, because that's where this "adaptation" is taking place. It
> happens
>
> 1) either in systemd's scsi_id built-in
> (https://github.com/systemd/systemd/blob/7feb1dd6544d1bf373dbe13dd33cf563ed16f891/src/udev/scsi_id/scsi_serial.c#L37)
> 2) or in the udev rules coming with sg3_utils
> (https://github.com/hreinecke/sg3_utils/blob/master/scripts/55-scsi-sg3_id.rules)
>
> 1) is just as opaque and un-"adaptable" as the kernel, and the logic is
> suboptimal. 2) is of course "adaptable", but that's a problem in
> practice, if udev fails to provide a WWID. multipath-tools go through
> various twists for this case to figure out "fallback" WWIDs, guessing
> whether that "fallback" matches what udev would have returned if it had
> worked.
>
> That's the gist of it - the general frustration about udev among some
> of its heaviest users (talk to the LVM2 maintainers).
>
> I suppose 99.9% of users never bother with customizing the udev rules.
> IOW, these users might as well just use a kernel-provided value. But
> the remaining 0.1% causes headaches for user-space applications, which
> can't make solid assumptions about the rules. Thus, in a way, the
> flexibility of the rules does more harm than it helps.
>
> > We could do that in the kernel too, of course, but I'm afraid what
> > the
> > resulting BLIST changes would end up looking like over time.
>
> That's something we want to avoid, sure.
>
> But we can actually combine both approaches. If "wwid" yields a good
> value most of the time (which is true IMO), we could make user space
> rely on it by default, and make it possible to set an udev property
> (e.g. ENV{ID_LEGACY}="1") to tell udev rules to determine WWID
> differently. User-space apps like multipath could check the ID_LEGACY
> property to determine whether or not reading the "wwid" attribute would
> be consistent with udev. That would simplify matters a lot for us (Ben,
> do you agree?), without the need of adding endless BLIST entries.
>
Yeah, as long as ID_LEGACY was changed in a careful manner, so WWIDs
didn't simply change without warning because of an upgrade, a path out
of this complexity is a definitely helpful.
-Ben
>
> > I am also very concerned about changing what the kernel currently
> > exports in a given variable like "wwid". A seemingly innocuous change
> > to
> > the reported value could lead to a system no longer booting after
> > updating the kernel.
>
> AFAICT, no major distribution uses "wwid" for this purpose (yet). I
> just recently realized that the kernel's ALUA code refers to it. (*)
>
> In a recent discussion with Hannes, the idea came up that the priority
> of "SCSI name string" designators should actually depend on their
> subtype. "naa." name strings should map to the respective NAA
> descriptors, and "eui.", likewise (only "iqn." descriptors have no
> binary counterpart; we thought they should rather be put below NAA,
> prio-wise).
>
> I wonder if you'd agree with a change made that way for "wwid". I
> suppose you don't. I'd then propose to add a new attribute following
> this logic. It could simply be an additional attribute with a different
> name. Or this new attribute could be a property of the block device
> rather than the SCSI device, like NVMe does it
> (/sys/block/nvme0n2/wwid).
>
> I don't like the idea of having separate sysfs attributes for
> designators of different types, that's impractical for user space.
>
> > But taking a step back: Other than "it's not what userland currently
> > does", what specifically is the problem with designator_prio()? We've
> > picked the priority list once and for all. If we promise never to
> > change
> > it, what is the issue?
>
> If the prioritization in kernel and user space was the same, we could
> migrate away from udev more easily without risking boot failure.
>
> Thanks,
> Martin
>
> (*) which is an argument for using "wwid" in user space too - just to
> be consitent with the kernel's internal logic.
>
> --
> Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
> SUSE Software Solutions Germany GmbH
> HRB 36809, AG Nürnberg GF: Felix Imendörffer
>
next prev parent reply other threads:[~2021-04-22 16:14 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-29 9:58 RFC: one more time: SCSI device identification Martin Wilck
2021-04-06 4:47 ` Martin K. Petersen
2021-04-16 23:28 ` Martin Wilck
2021-04-22 2:46 ` Martin K. Petersen
2021-04-22 9:07 ` Martin Wilck
2021-04-22 16:14 ` Benjamin Marzinski [this message]
2021-04-23 1:40 ` Martin K. Petersen
2021-04-23 10:28 ` Martin Wilck
2021-04-26 11:14 ` Antw: [EXT] Re: [systemd-devel] " Ulrich Windl
2021-04-26 13:16 ` Martin Wilck
[not found] ` <b5f288fb43bc79e0206794a901aef5b1761813de.camel@erwinvanlonden.net>
2021-04-27 7:02 ` Antw: [EXT] Re: [dm-devel] " Ulrich Windl
2021-04-27 8:10 ` Martin Wilck
2021-04-27 8:21 ` Hannes Reinecke
2021-04-27 10:52 ` Antw: [EXT] " Ulrich Windl
2021-04-27 20:04 ` Ewan D. Milne
2021-05-04 7:32 ` Hannes Reinecke
[not found] ` <ff5b30ca02ecfad00097ad5f8b84d053514fb61c.camel@erwinvanlonden.net>
2021-04-28 6:34 ` Martin Wilck
2021-04-29 14:47 ` Erwin van Londen
2021-04-27 20:14 ` Ewan D. Milne
2021-04-27 20:33 ` Martin Wilck
2021-04-27 20:41 ` Ewan D. Milne
2021-04-28 6:30 ` [systemd-devel] " Martin Wilck
[not found] ` <455a6e5086831323af86a150d21d5a0a7c2299eb.camel@erwinvanlonden.net>
[not found] ` <ba1ed6166b285d4ccb90f5f17b971983092d382e.camel@redhat.com>
2021-05-03 2:34 ` [dm-devel] " Erwin van Londen
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=20210422161420.GF20773@octiron.msp.redhat.com \
--to=bmarzins@redhat.com \
--cc=dgilbert@interlog.com \
--cc=dm-devel@redhat.com \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=martin.wilck@suse.com \
--cc=systemd-devel@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox