* [PATCH] common/rc: add default _udev_wait timeout
@ 2026-03-19 0:51 David Disseldorp
2026-03-19 15:38 ` Darrick J. Wong
0 siblings, 1 reply; 6+ messages in thread
From: David Disseldorp @ 2026-03-19 0:51 UTC (permalink / raw)
To: fstests; +Cc: Dave Chinner, David Disseldorp
If udevd isn't running then "udevadm wait" loops endlessly. With a
--timeout parameter provided, udevadm (udev-254.27) prints to stderr:
Timed out for waiting devices being initialized.
The error message causes test failure via golden output mismatch and
is easier to debug than an infinite loop.
The timeout parameter is also compatible with existing
args="--removed <dev>" callers.
Signed-off-by: David Disseldorp <ddiss@suse.de>
---
common/rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/rc b/common/rc
index fd4ca964..aade0e5b 100644
--- a/common/rc
+++ b/common/rc
@@ -5544,7 +5544,7 @@ _udev_wait()
if [ -z "$UDEV_WAIT_PROG" ]; then
$UDEV_SETTLE_PROG >/dev/null 2>&1
else
- $UDEV_WAIT_PROG $args
+ $UDEV_WAIT_PROG --timeout 10 $args
fi
}
--
2.51.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] common/rc: add default _udev_wait timeout
2026-03-19 0:51 [PATCH] common/rc: add default _udev_wait timeout David Disseldorp
@ 2026-03-19 15:38 ` Darrick J. Wong
2026-03-19 23:37 ` David Disseldorp
0 siblings, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2026-03-19 15:38 UTC (permalink / raw)
To: David Disseldorp; +Cc: fstests, Dave Chinner
On Thu, Mar 19, 2026 at 11:51:54AM +1100, David Disseldorp wrote:
> If udevd isn't running then "udevadm wait" loops endlessly. With a
> --timeout parameter provided, udevadm (udev-254.27) prints to stderr:
> Timed out for waiting devices being initialized.
If you don't have udevd running, then perhaps we should detect that and
directly call "sleep 10"? Because otherwise...
> The error message causes test failure via golden output mismatch and
> is easier to debug than an infinite loop.
>
> The timeout parameter is also compatible with existing
> args="--removed <dev>" callers.
>
> Signed-off-by: David Disseldorp <ddiss@suse.de>
> ---
> common/rc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/rc b/common/rc
> index fd4ca964..aade0e5b 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -5544,7 +5544,7 @@ _udev_wait()
> if [ -z "$UDEV_WAIT_PROG" ]; then
> $UDEV_SETTLE_PROG >/dev/null 2>&1
> else
> - $UDEV_WAIT_PROG $args
> + $UDEV_WAIT_PROG --timeout 10 $args
...a system running udevd that's taking forever to process rules can hit
this 10 second timeout, at which point the test moves on and might just
fail due to unconfigured /dev nodes.
/methinks this could be done like so:
if [ ! -S /run/udev/control ]; then
sleep 10
elif [ -z "$UDEV_WAIT_PROG" ]; then
...
I don't know if your test setup has prepopulated /dev or if you've a
script that sets up devices, or something else. 10 seconds is just a
copy-paste.
--D
> fi
> }
>
> --
> 2.51.0
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] common/rc: add default _udev_wait timeout
2026-03-19 15:38 ` Darrick J. Wong
@ 2026-03-19 23:37 ` David Disseldorp
2026-03-20 14:44 ` Darrick J. Wong
0 siblings, 1 reply; 6+ messages in thread
From: David Disseldorp @ 2026-03-19 23:37 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: fstests, Dave Chinner
On Thu, 19 Mar 2026 08:38:43 -0700, Darrick J. Wong wrote:
> On Thu, Mar 19, 2026 at 11:51:54AM +1100, David Disseldorp wrote:
> > If udevd isn't running then "udevadm wait" loops endlessly. With a
> > --timeout parameter provided, udevadm (udev-254.27) prints to stderr:
> > Timed out for waiting devices being initialized.
>
> If you don't have udevd running, then perhaps we should detect that and
> directly call "sleep 10"? Because otherwise...
I normally have udevd running, but sometimes mess it up. My latest screw
up came from ommitting a "/run" dir in the initramfs test env, which
causes systemd-udevd to die on "/run/udev" creation. The error message
is hard to spot amoungst the other boot messages...
> > The error message causes test failure via golden output mismatch and
> > is easier to debug than an infinite loop.
> >
> > The timeout parameter is also compatible with existing
> > args="--removed <dev>" callers.
> >
> > Signed-off-by: David Disseldorp <ddiss@suse.de>
> > ---
> > common/rc | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/common/rc b/common/rc
> > index fd4ca964..aade0e5b 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -5544,7 +5544,7 @@ _udev_wait()
> > if [ -z "$UDEV_WAIT_PROG" ]; then
> > $UDEV_SETTLE_PROG >/dev/null 2>&1
> > else
> > - $UDEV_WAIT_PROG $args
> > + $UDEV_WAIT_PROG --timeout 10 $args
>
> ...a system running udevd that's taking forever to process rules can hit
> this 10 second timeout, at which point the test moves on and might just
> fail due to unconfigured /dev nodes.
The 10 seconds is arbitrary. If there's a concern that the timeout will
prematurely fire on a regular systems then I'll gladly raise it up to a
minute or so. I just want to get an explicit failure instead of a
never-ending test.
> /methinks this could be done like so:
>
> if [ ! -S /run/udev/control ]; then
...
That's a good idea as a udevd sanity check. I'll add it to my test env.
Thanks, David
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] common/rc: add default _udev_wait timeout
2026-03-19 23:37 ` David Disseldorp
@ 2026-03-20 14:44 ` Darrick J. Wong
2026-03-23 1:54 ` David Disseldorp
0 siblings, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2026-03-20 14:44 UTC (permalink / raw)
To: David Disseldorp; +Cc: fstests, Dave Chinner
On Fri, Mar 20, 2026 at 10:37:36AM +1100, David Disseldorp wrote:
> On Thu, 19 Mar 2026 08:38:43 -0700, Darrick J. Wong wrote:
>
> > On Thu, Mar 19, 2026 at 11:51:54AM +1100, David Disseldorp wrote:
> > > If udevd isn't running then "udevadm wait" loops endlessly. With a
> > > --timeout parameter provided, udevadm (udev-254.27) prints to stderr:
> > > Timed out for waiting devices being initialized.
> >
> > If you don't have udevd running, then perhaps we should detect that and
> > directly call "sleep 10"? Because otherwise...
>
> I normally have udevd running, but sometimes mess it up. My latest screw
> up came from ommitting a "/run" dir in the initramfs test env, which
> causes systemd-udevd to die on "/run/udev" creation. The error message
> is hard to spot amoungst the other boot messages...
Oh, ok. For some reason I thought you were trying to run fstests
without udev. What if instead ./check looked for udevd and refused to
proceed if it isn't running? AFAIK even the anti-systemd distros ship
eudev.
> > > The error message causes test failure via golden output mismatch and
> > > is easier to debug than an infinite loop.
> > >
> > > The timeout parameter is also compatible with existing
> > > args="--removed <dev>" callers.
> > >
> > > Signed-off-by: David Disseldorp <ddiss@suse.de>
> > > ---
> > > common/rc | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/common/rc b/common/rc
> > > index fd4ca964..aade0e5b 100644
> > > --- a/common/rc
> > > +++ b/common/rc
> > > @@ -5544,7 +5544,7 @@ _udev_wait()
> > > if [ -z "$UDEV_WAIT_PROG" ]; then
> > > $UDEV_SETTLE_PROG >/dev/null 2>&1
> > > else
> > > - $UDEV_WAIT_PROG $args
> > > + $UDEV_WAIT_PROG --timeout 10 $args
> >
> > ...a system running udevd that's taking forever to process rules can hit
> > this 10 second timeout, at which point the test moves on and might just
> > fail due to unconfigured /dev nodes.
>
> The 10 seconds is arbitrary. If there's a concern that the timeout will
> prematurely fire on a regular systems then I'll gladly raise it up to a
> minute or so. I just want to get an explicit failure instead of a
> never-ending test.
<nod>
--D
> > /methinks this could be done like so:
> >
> > if [ ! -S /run/udev/control ]; then
> ...
>
> That's a good idea as a udevd sanity check. I'll add it to my test env.
>
> Thanks, David
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] common/rc: add default _udev_wait timeout
2026-03-20 14:44 ` Darrick J. Wong
@ 2026-03-23 1:54 ` David Disseldorp
2026-03-23 2:03 ` Darrick J. Wong
0 siblings, 1 reply; 6+ messages in thread
From: David Disseldorp @ 2026-03-23 1:54 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: fstests, Dave Chinner
On Fri, 20 Mar 2026 07:44:13 -0700, Darrick J. Wong wrote:
...
> > I normally have udevd running, but sometimes mess it up. My latest screw
> > up came from ommitting a "/run" dir in the initramfs test env, which
> > causes systemd-udevd to die on "/run/udev" creation. The error message
> > is hard to spot amoungst the other boot messages...
>
> Oh, ok. For some reason I thought you were trying to run fstests
> without udev. What if instead ./check looked for udevd and refused to
> proceed if it isn't running? AFAIK even the anti-systemd distros ship
> eudev.
I've added the extra udevd sanity check to my test env, so I shouldn't
need anything in check. I'd expect NFS, SMB, CephFS, etc. may still want
to run without udevd.
> > > > The error message causes test failure via golden output mismatch and
> > > > is easier to debug than an infinite loop.
> > > >
> > > > The timeout parameter is also compatible with existing
> > > > args="--removed <dev>" callers.
> > > >
> > > > Signed-off-by: David Disseldorp <ddiss@suse.de>
> > > > ---
> > > > common/rc | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/common/rc b/common/rc
> > > > index fd4ca964..aade0e5b 100644
> > > > --- a/common/rc
> > > > +++ b/common/rc
> > > > @@ -5544,7 +5544,7 @@ _udev_wait()
> > > > if [ -z "$UDEV_WAIT_PROG" ]; then
> > > > $UDEV_SETTLE_PROG >/dev/null 2>&1
> > > > else
> > > > - $UDEV_WAIT_PROG $args
> > > > + $UDEV_WAIT_PROG --timeout 10 $args
> > >
> > > ...a system running udevd that's taking forever to process rules can hit
> > > this 10 second timeout, at which point the test moves on and might just
> > > fail due to unconfigured /dev nodes.
> >
> > The 10 seconds is arbitrary. If there's a concern that the timeout will
> > prematurely fire on a regular systems then I'll gladly raise it up to a
> > minute or so. I just want to get an explicit failure instead of a
> > never-ending test.
>
> <nod>
I'd still like to see a timeout added, as a failed test (with timeout
msg) is IMO a far better outcome than an endless wait. Any objections if
I send a v2 patch with 60s timeout?
Thanks, David
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] common/rc: add default _udev_wait timeout
2026-03-23 1:54 ` David Disseldorp
@ 2026-03-23 2:03 ` Darrick J. Wong
0 siblings, 0 replies; 6+ messages in thread
From: Darrick J. Wong @ 2026-03-23 2:03 UTC (permalink / raw)
To: David Disseldorp; +Cc: fstests, Dave Chinner
On Mon, Mar 23, 2026 at 12:54:21PM +1100, David Disseldorp wrote:
> On Fri, 20 Mar 2026 07:44:13 -0700, Darrick J. Wong wrote:
> ...
> > > I normally have udevd running, but sometimes mess it up. My latest screw
> > > up came from ommitting a "/run" dir in the initramfs test env, which
> > > causes systemd-udevd to die on "/run/udev" creation. The error message
> > > is hard to spot amoungst the other boot messages...
> >
> > Oh, ok. For some reason I thought you were trying to run fstests
> > without udev. What if instead ./check looked for udevd and refused to
> > proceed if it isn't running? AFAIK even the anti-systemd distros ship
> > eudev.
>
> I've added the extra udevd sanity check to my test env, so I shouldn't
> need anything in check. I'd expect NFS, SMB, CephFS, etc. may still want
> to run without udevd.
<nod>
> > > > > The error message causes test failure via golden output mismatch and
> > > > > is easier to debug than an infinite loop.
> > > > >
> > > > > The timeout parameter is also compatible with existing
> > > > > args="--removed <dev>" callers.
> > > > >
> > > > > Signed-off-by: David Disseldorp <ddiss@suse.de>
> > > > > ---
> > > > > common/rc | 2 +-
> > > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/common/rc b/common/rc
> > > > > index fd4ca964..aade0e5b 100644
> > > > > --- a/common/rc
> > > > > +++ b/common/rc
> > > > > @@ -5544,7 +5544,7 @@ _udev_wait()
> > > > > if [ -z "$UDEV_WAIT_PROG" ]; then
> > > > > $UDEV_SETTLE_PROG >/dev/null 2>&1
> > > > > else
> > > > > - $UDEV_WAIT_PROG $args
> > > > > + $UDEV_WAIT_PROG --timeout 10 $args
> > > >
> > > > ...a system running udevd that's taking forever to process rules can hit
> > > > this 10 second timeout, at which point the test moves on and might just
> > > > fail due to unconfigured /dev nodes.
> > >
> > > The 10 seconds is arbitrary. If there's a concern that the timeout will
> > > prematurely fire on a regular systems then I'll gladly raise it up to a
> > > minute or so. I just want to get an explicit failure instead of a
> > > never-ending test.
> >
> > <nod>
>
> I'd still like to see a timeout added, as a failed test (with timeout
> msg) is IMO a far better outcome than an endless wait. Any objections if
> I send a v2 patch with 60s timeout?
Nope, 60 seconds should be enough for anyone. ;)
--D
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-23 2:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 0:51 [PATCH] common/rc: add default _udev_wait timeout David Disseldorp
2026-03-19 15:38 ` Darrick J. Wong
2026-03-19 23:37 ` David Disseldorp
2026-03-20 14:44 ` Darrick J. Wong
2026-03-23 1:54 ` David Disseldorp
2026-03-23 2:03 ` Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox