All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Peter Korsgaard <peter@korsgaard.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Mike Snitzer <snitzer@kernel.org>,
	Helen Koike <helen.koike@collabora.com>,
	fabio.aiuto@amarulasolutions.com, dm-devel@redhat.com,
	michael@amarulasolutions.com
Subject: Re: [dm-devel] [PATCH v2] dm init: add dm-mod.waitfor to wait for asynchronously probed block devices
Date: Fri, 2 Dec 2022 01:44:53 -0500	[thread overview]
Message-ID: <Y4me5YOfuXPC/ln5@redhat.com> (raw)
In-Reply-To: <871qpjcc50.fsf@dell.be.48ers.dk>

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

> >>>>> "Mike" == Mike Snitzer <snitzer@redhat.com> writes:
> 
> Hi,
> 
>  >> 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?
> 
> Yes. Fabio, you pointed me to the earlier patch, so you presumably need
> something like this as well, 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.
> 
> Well, it is exactly like the rootwait option we have for normal (non-dm)
> root= handling, so it is for the same use cases / issues.
> 
> A lot of embedded / non-initramfs setups use rootwait today because of
> the async initialization logic. If those setups want to use root-on-dm
> (E.G. for dm-verity) then they need to use this dm_mod.waitfor= instead
> of rootwait.
> 
> rootwait was added by:
> 
> commit cc1ed7542c8c26af0f501da8006b9fce03e9aaca
> Author: Pierre Ossman <drzeus-list@drzeus.cx>
> Date:   Sun Jul 15 23:40:35 2007 -0700
> 
>     init: wait for asynchronously scanned block devices
> 
>     Some buses (e.g.  USB and MMC) do their scanning of devices in the
>     background, causing a race between them and prepare_namespace().  In order
>     to be able to use these buses without an initrd, we now wait for the device
>     specified in root= to actually show up.
> 
>     If the device never shows up than we will hang in an infinite loop.  In
>     order to not mess with setups that reboot on panic, the feature must be
>     turned on via the command line option "rootwait".
> 
>     [bunk@stusta.de: root_wait can become static]
>     Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
>     Cc: Al Viro <viro@zeniv.linux.org.uk>
>     Cc: Christoph Hellwig <hch@lst.de>
>     Signed-off-by: Adrian Bunk <bunk@stusta.de>
>     Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>     Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

OK, I'll accept your patch, but will tweak the DMINFO slightly to look
more like rootwait's pr_info (e.g. "Waiting for device %s..." and such).

I'll also change the msleep(20) to msleep(5) like was introduced with
commit 39a0e975c37de ("init: reduce rootwait polling interval time to
5ms") -- checkpatch be damned. ;)

Thanks,
Mike

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2022-12-02  6:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  6:16 [dm-devel] [PATCH v2] dm init: add dm-mod.waitfor to wait for asynchronously probed block devices Peter Korsgaard
2022-11-24 10:35 ` Peter Korsgaard
2022-11-30 23:07   ` Mike Snitzer
2022-12-01  7:28     ` Peter Korsgaard
2022-12-01 16:13       ` Mike Snitzer
2022-12-01 16:38         ` Peter Korsgaard
2022-12-02  6:44           ` Mike Snitzer [this message]
2022-12-02  6:51             ` Peter Korsgaard

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=Y4me5YOfuXPC/ln5@redhat.com \
    --to=snitzer@redhat.com \
    --cc=corbet@lwn.net \
    --cc=dm-devel@redhat.com \
    --cc=fabio.aiuto@amarulasolutions.com \
    --cc=helen.koike@collabora.com \
    --cc=michael@amarulasolutions.com \
    --cc=peter@korsgaard.com \
    --cc=snitzer@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.