From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79B3027FD49 for ; Thu, 15 Jan 2026 02:47:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768445268; cv=none; b=aag2soVMP9ynCFl/3NbfDLyFdztgEKAiW1KnsY1AoEv33eXYAbYaM306cMIB0GgfxRjtBcfu4VxJCMZbk7ISNdp5BHZOsCzSO5TuA7MBtXroEBHIPXVFpKiNOSzKcdhcnCnGynWqNg1o1LdJtgunyxbZbrGTheCdyYEStPVxxDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768445268; c=relaxed/simple; bh=IrqPAj19GKGDHENtSp6rgxymAdZZTh9HmvyyN4l9rUY=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=bH6cEPYa83TptciJ+FdzDnHOL78g8Ek1vlkqxoOoCghymJoYlJF+4t8Ykga85Sv5bItCsTmLxC8h9EU97jZtNQve5EHaTnCQNMcC9YeXkyL3JH/x3QzxL8yDTZmR06z34Adak8QYk51OhNOQ8peo4LzfRvEfvbvcv5PmdTaGAWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=l6Bs2IDQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="l6Bs2IDQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA401C19424; Thu, 15 Jan 2026 02:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1768445268; bh=IrqPAj19GKGDHENtSp6rgxymAdZZTh9HmvyyN4l9rUY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=l6Bs2IDQ1g6lIzScA1nk/02E8Nar8ogtp4XlvAmZbAEn1/tI4M/aIZfGlxsGHvRYa 4Wax/yJ3pdD4V1iilNO6nVpLQ0r9tj6MSsxLptnjB8D8fmh+pzZf+YQk/UF+qY+FTV BhRk0LX8HYAk4GaFuEd3drCsbe04l9M4JqtBjqZE= Date: Wed, 14 Jan 2026 18:47:47 -0800 From: Andrew Morton To: Harry Austen Cc: Huacai Chen , linux-kernel@vger.kernel.org, Lillian Berry Subject: Re: [PATCH] init/main.c: prevent warning on lack of default implicit rdinit Message-Id: <20260114184747.f08a7b4fcac9ace8a330fdde@linux-foundation.org> In-Reply-To: <20260114220139.4685-1-hpausten@protonmail.com> References: <20260114220139.4685-1-hpausten@protonmail.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 14 Jan 2026 22:02:27 +0000 Harry Austen 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?