From: Andrew Morton <akpm@linux-foundation.org>
To: Harry Austen <hpausten@protonmail.com>
Cc: Huacai Chen <chenhuacai@kernel.org>,
linux-kernel@vger.kernel.org,
Lillian Berry <lillian@star-ark.net>
Subject: Re: [PATCH] init/main.c: prevent warning on lack of default implicit rdinit
Date: Wed, 14 Jan 2026 18:47:47 -0800 [thread overview]
Message-ID: <20260114184747.f08a7b4fcac9ace8a330fdde@linux-foundation.org> (raw)
In-Reply-To: <20260114220139.4685-1-hpausten@protonmail.com>
On Wed, 14 Jan 2026 22:02:27 +0000 Harry Austen <hpausten@protonmail.com> wrote:
> If rdinit was not explicitly provided on cmdline, and default /init does
> not exist, no warning should be printed.
>
> Fixes: 98aa4d5d242d ("init/main.c: add warning when file specified in rdinit is inaccessible")
Details, please? What was wrong about the above commit?
> --- a/init/main.c
> +++ b/init/main.c
> @@ -162,6 +162,7 @@ static size_t initargs_offs;
>
> static char *execute_command;
> static char *ramdisk_execute_command = "/init";
> +static bool __initdata ramdisk_execute_command_provided = false;
>
> /*
> * Used to generate warnings if static_key manipulation functions are used
> @@ -623,6 +624,7 @@ static int __init rdinit_setup(char *str)
> unsigned int i;
>
> ramdisk_execute_command = str;
> + ramdisk_execute_command_provided = true;
> /* See "auto" comment in init_setup */
> for (i = 1; i < MAX_INIT_ARGS; i++)
> argv_init[i] = NULL;
> @@ -1699,8 +1701,9 @@ static noinline void __init kernel_init_freeable(void)
> int ramdisk_command_access;
> ramdisk_command_access = init_eaccess(ramdisk_execute_command);
> if (ramdisk_command_access != 0) {
> - pr_warn("check access for rdinit=%s failed: %i, ignoring\n",
> - ramdisk_execute_command, ramdisk_command_access);
> + if (ramdisk_execute_command_provided || ramdisk_command_access != -ENOENT)
> + pr_warn("check access for rdinit=%s failed: %i, ignoring\n",
> + ramdisk_execute_command, ramdisk_command_access);
Replacing the !=0 check with !=ENOENT appears to be off-topic. What's
happening here?
next prev parent reply other threads:[~2026-01-15 2:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 22:02 Harry Austen
2026-01-15 2:47 ` Andrew Morton [this message]
2026-01-15 7:32 ` Harry Austen
2026-01-15 20:02 ` Andrew Morton
2026-01-15 23:09 ` Harry Austen
2026-01-15 23:28 ` Andrew Morton
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=20260114184747.f08a7b4fcac9ace8a330fdde@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=chenhuacai@kernel.org \
--cc=hpausten@protonmail.com \
--cc=lillian@star-ark.net \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®