[dm-devel] [PATCH v2] dm init: add dm-mod.waitfor to wait for asynchronously probed block devices

Mike Snitzer snitzer at redhat.com
Thu Dec 1 16:13:04 UTC 2022


On Thu, Dec 01 2022 at  2:28P -0500,
Peter Korsgaard <peter at korsgaard.com> wrote:

> >>>>> "Mike" == Mike Snitzer <snitzer at redhat.com> writes:
> 
> Hi,
> 
>  > On Thu, Nov 24 2022 at  5:35P -0500,
>  > Peter Korsgaard <peter at korsgaard.com> wrote:
> 
>  >> > +	if (waitfor[0])
>  >> > +		DMINFO("all devices available");
>  >> > +
> 
>  > Why 20?  Also, why is waiting indefinitely OK?  Would really like to
>  > hear from other consumers of dm-init that this module param is useful
>  > and needed.
> 
> Mainly because of checkpatch.pl ;) prepare_namespace() uses msleep(5)
> but checkpatch complains about it, so I made it 20 instead. It doesn't
> really matter much, as long as it is small enough to not delay boots too
> much (E.G. this is typically used for embedded system where boot time is
> critical).
> 
> I would say that it DOES make sense to wait forever, similar to how it
> is done in prepare_namespace() when rootwait is passed. This waitfor
> bootargs is used for root-on-dm, so we cannot continue until the
> underlying devices are available.
> 
> As mentioned,
> https://lore.kernel.org/all/20220406154631.277107-1-fabio.aiuto@amarulasolutions.com/
> is an alternatively (less nice) approach to solve the same issue, so yes
> - It is useful and needed.

OK, so it should be easy for others to say so, right?

My hesitation is that it feels like something that could be papering
over device specific issues with their async initialization?  Even if
that is the case, it'd be nice to know _why_ this change is needed.
IMHO, the patch header stops short of offering compelling and informed
justification.

Mike



More information about the dm-devel mailing list