From: Martin Wilck <mwilck@suse.com>
To: NeilBrown <neilb@suse.de>
Cc: Peter Rajnoha <prajnoha@redhat.com>,
Jes Sorensen <jsorensen@fb.com>, Coly Li <colyli@suse.com>,
lvm-devel@redhat.com, linux-raid@vger.kernel.org,
dm-devel@redhat.com, Heming Zhao <heming.zhao@suse.com>
Subject: Re: [PATCH] udev-md-raid-assembly.rules: skip if DM_UDEV_DISABLE_OTHER_RULES_FLAG
Date: Wed, 23 Feb 2022 10:47:38 +0100 [thread overview]
Message-ID: <d3aab8f2318f1438a1f0085eddf9713217d52391.camel@suse.com> (raw)
In-Reply-To: <164557016782.28944.17731814770525408828@noble.neil.brown.name>
Hello Neil,
On Wed, 2022-02-23 at 09:49 +1100, NeilBrown wrote:
> >
> > Peter has provided a link to libdevmapper.h in his previous post in
> > this thread. Is this a request for me to include that link in the
> > patch
> > description?
>
> If libdevmapper.h is the best documentation there is for this
> variable,
> then hopefully you can see why it feels to an outsider like a hack.
>
There's also some documentation in the form of comments in the device-
mapper rules files themselves:
https://github.com/lvmteam/lvm2/blob/8dccc2314e2482370bc6e5cf007eb210994abdef/udev/10-dm.rules.in#L137
In general, 10-dm.rules is one of the most extensively commented rule
files. I've always found these comments quite helpful.
> It isn't even immediately clear that the text there is talking about
> environment variables visible in udev.
> If there is an expectation that tools outside of lvm2 will use these,
> then they really should be documented properly. SYSTEMD_READY is
> documented in "man systemd.device". How hard would it be to write a
> "dm-udev" man page which explains all this.
I agree that the documentation could be improved. OTOH, the text in
systemd.device(5) only explains how systemd itself interprets
SYSTEMD_READY. It doesn't say a word about how other udev rules are
supposed to deal with the device. IOW, SYSTEMD_READY is part of an API
between udev rules and systemd, and not between different udev rule
sets.
In particular the "don't probe this iff SYSTEMD_READY==0" semantics
that are frequently used in rules files can't be inferred from this
documentation. It makes sense most of the time, but there are some
cases where it doesn't. Here, we have a case where probing should be
skipped, even though SYSTEMD_READY is not 0.
Regards,
Martin
PS: The big issue remains that there is no "official" API in which udev
rule sets can transport information between each other. I guess the
original idea was that every rule set would be self-contained, which
isn't the case any more. If anyone makes an effort redesign udev, they
should consider creating such an API somehow.
next prev parent reply other threads:[~2022-02-23 9:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 20:59 [PATCH] udev-md-raid-assembly.rules: skip if DM_UDEV_DISABLE_OTHER_RULES_FLAG mwilck
2022-02-16 22:09 ` NeilBrown
2022-02-17 10:58 ` Martin Wilck
2022-02-17 13:09 ` Peter Rajnoha
2022-02-21 23:36 ` NeilBrown
2022-02-22 13:54 ` Martin Wilck
2022-02-22 22:49 ` NeilBrown
2022-02-23 9:47 ` Martin Wilck [this message]
2022-02-28 8:48 ` Martin Wilck
2022-03-18 22:42 ` Martin Wilck
2022-02-28 15:28 ` [dm-devel] " Xiao Ni
2022-03-01 7:53 ` Peter Rajnoha
2022-02-17 13:20 ` Peter Rajnoha
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=d3aab8f2318f1438a1f0085eddf9713217d52391.camel@suse.com \
--to=mwilck@suse.com \
--cc=colyli@suse.com \
--cc=dm-devel@redhat.com \
--cc=heming.zhao@suse.com \
--cc=jsorensen@fb.com \
--cc=linux-raid@vger.kernel.org \
--cc=lvm-devel@redhat.com \
--cc=neilb@suse.de \
--cc=prajnoha@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox