From: Martin Wilck <email@example.com>
To: LVM general discussion and development
LVM general discussion and development <firstname.lastname@example.org>,
Christian Hesse <email@example.com>
Cc: Heming Zhao <firstname.lastname@example.org>
Subject: Re: [linux-lvm] [PATCH 1/1] pvscan: wait for udevd
Date: Wed, 17 Feb 2021 09:22:52 +0100 [thread overview]
Message-ID: <email@example.com> (raw)
On Wed, 2021-02-17 at 09:49 +0800, firstname.lastname@example.org wrote:
> On 2/11/21 7:16 PM, Christian Hesse wrote:
> > From: Christian Hesse <email@example.com>
> > Running the scan before udevd finished startup may result in
> > failure.
> > This has been reported for Arch Linux  and proper ordering fixes
> > the issue.
> >  https://bugs.archlinux.org/task/69611
> > Signed-off-by: Christian Hesse <firstname.lastname@example.org>
> > ---
> > scripts/lvm2-pvscan.service.in | 1 +
> > 1 file changed, 1 insertion(+)
> > diff --git a/scripts/lvm2-pvscan.service.in b/scripts/lvm2-
> > pvscan.service.in
> > index 09753e8c9..7b4ace551 100644
> > --- a/scripts/lvm2-pvscan.service.in
> > +++ b/scripts/lvm2-pvscan.service.in
> > @@ -4,6 +4,7 @@ Documentation=man:pvscan(8)
> > DefaultDependencies=no
> > StartLimitIntervalSec=0
> > BindsTo=dev-block-%i.device
> > +After=systemd-udevd.service
> > Before=shutdown.target
> > Conflicts=shutdown.target
> I watched a similar issue with lvm2-monitor.service.
> In a very old machine (i586), udevd cost too much time to finish, it
> lvm2-monitor timeout then reported:
> > WARNING: Device /dev/sda not initialized in udev database even
> > after waiting 10000000 microseconds.
> One workable solution is to add "systemd-udev-settle.service"
> (obsoleted) or
> "local-fs.target" in "After" of lvm2-monitor.service.
We have to differentiate here. In our case we had to wait for "systemd-
udev-settle.service". In the arch case, it was only necessary to wait
for systemd-udevd.service itself. "After=systemd-udevd.service" just
means that the daemon is up, it says nothing about any device
initialization being completed.
But in general, I think this needs deeper analysis. Looking at
https://bugs.archlinux.org/task/69611, the workaround appears to have
been found simply by drawing an analogy to a previous similar case.
I'd like to understand what happened on the arch system when the error
occured, and why this simple ordering directive avoided it.
1. How had the offending pvscan process been started? I'd expect that
"pvscan" (unlike "lvm monitor" in our case) was started by an udev
rule. If udevd hadn't started yet, how would that udev rule have be
executed? OTOH, if pvscan had not been started by udev but by another
systemd service, than *that* service would probably need to get the
2. Even without the "After=" directive, I'd assume that pvscan wasn't
started "before" systemd-udevd, but rather "simultaneously" (i.e. in
the same systemd transaction). Thus systemd-udevd should have started
up while pvscan was running, and pvscan should have noticed that udevd
eventually became available. Why did pvscan time out? What was it
waiting for? We know that lvm checks for the existence of
"/run/udev/control", but that should have become avaiable after some
fractions of a second of waiting.
linux-lvm mailing list
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
next prev parent reply other threads:[~2021-02-17 15:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 11:16 [linux-lvm] [PATCH 1/1] pvscan: wait for udevd Christian Hesse
[not found] ` <email@example.com>
2021-02-17 8:22 ` Martin Wilck [this message]
[not found] ` <20210217130329.7de41147@leda>
2021-02-17 13:38 ` Oleksandr Natalenko
2021-02-18 15:19 ` Martin Wilck
2021-02-18 15:30 ` Oleksandr Natalenko
2021-02-19 9:22 ` Martin Wilck
2021-02-19 16:37 ` David Teigland
2021-02-19 22:47 ` Zdenek Kabelac
2021-02-21 20:23 ` Martin Wilck
2021-02-22 9:57 ` Zdenek Kabelac
2021-02-22 13:04 ` Christian Hesse
2021-02-25 16:51 ` Oleksandr Natalenko
2021-02-21 20:26 ` Martin Wilck
2021-02-17 13:49 ` Martin Wilck
2021-02-17 19:11 ` Oleksandr Natalenko
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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;
as well as URLs for NNTP newsgroup(s).