All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Alexander Egorenkov <egorenar@linux.ibm.com>
Cc: akpm@linux-foundation.org, bp@alien8.de, corbet@lwn.net,
	gregkh@linuxfoundation.org, jeyu@kernel.org,
	linux-kernel@vger.kernel.org, mcgrof@kernel.org,
	ndesaulniers@google.com, torvalds@linux-foundation.org,
	Bruno Goncalves <bgoncalv@redhat.com>,
	Dave Young <dyoung@redhat.com>
Subject: Re: [PATCH v3 1/2] init/initramfs.c: do unpacking asynchronously
Date: Wed, 28 Jul 2021 13:49:16 +0200	[thread overview]
Message-ID: <6a9819fe-b1cc-63fe-6ab3-32a4fbe7f16f@rasmusvillemoes.dk> (raw)
In-Reply-To: <87sfzyg1x9.fsf@oc8242746057.ibm.com>

On 28/07/2021 12.36, Alexander Egorenkov wrote:
> Rasmus Villemoes <linux@rasmusvillemoes.dk> writes:
> 
>> On 24/07/2021 09.46, Alexander Egorenkov wrote:
>>> Hello,
>>>
>>> since e7cb072eb988 ("init/initramfs.c: do unpacking asynchronously"), we
>>> started seeing the following problem on s390 arch regularly:
>>>
>>> [    5.039734] wait_for_initramfs() called before rootfs_initcalls
>>
>> While that message was added as part of the same patch, it's a red
>> herring: It merely means that something ends up calling usermodehelper
>> (perhaps a request_module) before the init sequence has come around to
>> rootfs_initcalls. At that point, the rootfs is (with or without my async
>> patch) entirely empty, so those usermodehelper calls have always failed
>> with -ENOENT.
>>
>> If you have CONFIG_UEVENT_HELPER=y and CONFIG_UEVENT_HELPER_PATH set to
>> a non-empty string, you can try setting the latter to the empty string.
>> But the message won't go away if it's really a request_module() and not
>> a uevent notification.
>>
> 
> Thanks for the helpful explanation. I disabled UEVENT on my test machine and
> as you said, the message is being triggered by request_module() now.

Yes. But as I've said, the "called before rootfs_initcalls" message is
entirely harmless and not in any way related to whatever problems is
later encountered when the initramfs is actually being decompressed and
extracted.

I have this so far untested patch that I plan on sending, which should
remove that message

diff --git a/init/initramfs.c b/init/initramfs.c
index af27abc59643..51a686a8c929 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -727,6 +727,7 @@ static int __init populate_rootfs(void)
 {
        initramfs_cookie = async_schedule_domain(do_populate_rootfs, NULL,
                                                 &initramfs_domain);
+       usermodehelper_enable();
        if (!initramfs_async)
                wait_for_initramfs();
        return 0;
diff --git a/init/main.c b/init/main.c
index f5b8246e8aa1..d5c5542fe142 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1387,7 +1387,6 @@ static void __init do_basic_setup(void)
        driver_init();
        init_irq_proc();
        do_ctors();
-       usermodehelper_enable();
        do_initcalls();
 }

diff --git a/init/noinitramfs.c b/init/noinitramfs.c
index 3d62b07f3bb9..f1d9e5495cc1 100644
--- a/init/noinitramfs.c
+++ b/init/noinitramfs.c
@@ -18,6 +18,7 @@ static int __init default_rootfs(void)
 {
        int err;

+       usermodehelper_enable();
        err = init_mkdir("/dev", 0755);
        if (err < 0)
                goto out;

because any call of a usermodehelper (be it a uevent hotplug
notification or a request_module) would just return -EBUSY during all
pure_, core_, postcore_, arch_, subsys_ and fs_ initcalls. (It is really
beyond me why rootfs_ initcalls are hidden between fs_ and device_
initcalls).

Currently (with or without my async patch) umh calls from those
initcalls probably return -ENOENT or whatever kernel_execve() returns
when there's no such binary. So if something actually looks at the
return value, the change from -ENOENT to -EBUSY might cause a
regression. But I doubt it.

Rasmus

  reply	other threads:[~2021-07-28 11:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-13 21:25 [PATCH v3 0/2] background initramfs unpacking, and CONFIG_MODPROBE_PATH Rasmus Villemoes
2021-03-13 21:25 ` [PATCH v3 1/2] init/initramfs.c: do unpacking asynchronously Rasmus Villemoes
2021-03-15 20:21   ` Luis Chamberlain
2021-03-15 21:33   ` Andrew Morton
2021-03-15 21:59     ` Rasmus Villemoes
2021-07-24  7:46   ` Alexander Egorenkov
2021-07-26 11:46     ` Rasmus Villemoes
2021-07-27  7:31       ` Bruno Goncalves
2021-07-27 13:54         ` Luis Chamberlain
2021-07-27 14:12           ` Bruno Goncalves
2021-07-27 14:21             ` Luis Chamberlain
2021-07-27 14:27               ` Bruno Goncalves
2021-07-27 14:42                 ` Luis Chamberlain
2021-07-27 14:48                   ` Bruno Goncalves
2021-07-28 10:44                   ` Alexander Egorenkov
2021-07-28 10:38           ` Alexander Egorenkov
2021-07-28 10:36       ` Alexander Egorenkov
2021-07-28 11:49         ` Rasmus Villemoes [this message]
2021-03-13 21:25 ` [PATCH v3 2/2] modules: add CONFIG_MODPROBE_PATH Rasmus Villemoes
2021-03-15 20:06   ` Luis Chamberlain
2021-03-15 20:23 ` [PATCH v3 0/2] background initramfs unpacking, and CONFIG_MODPROBE_PATH Luis Chamberlain

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=6a9819fe-b1cc-63fe-6ab3-32a4fbe7f16f@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=akpm@linux-foundation.org \
    --cc=bgoncalv@redhat.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dyoung@redhat.com \
    --cc=egorenar@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeyu@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [PATCH v3 1/2] init/initramfs.c: do unpacking asynchronously' \
    /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

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.