All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] rootfs: Use tmpfs for rootfs even if root= is given
@ 2023-10-31 15:44 Stefan Berger
  2023-10-31 16:56 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Berger @ 2023-10-31 15:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: Stefan Berger, Milton D. Miller II, Rob Landley, Jeff Layton,
	Jens Axboe, Jim Cromie, Sam Ravnborg, Greg Kroah-Hartman,
	Eric W. Biederman, Alexander Viro, H. Peter Anvin, Mimi Zohar

rootfs currently does not use tmpfs if the root= boot option is passed
even though the documentation about rootfs (added in 6e19eded3684) in
Documentation/filesystems/ramfs-rootfs-initramfs.rst states:

  If CONFIG_TMPFS is enabled, rootfs will use tmpfs instead of ramfs by
  default.  To force ramfs, add "rootfstype=ramfs" to the kernel command
  line.

However, this currently does not work when root= is passed on the boot
command line since then saved_root_name contains a string and prevents
usage of tmpfs. Therefore, remove the check on saved_root_name to
enable tmpfs for rootfs.

Fixes: 6e19eded3684 ("initmpfs: use initramfs if rootfstype= or root= specified")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Cc: "Milton D. Miller II" <mdmii@outlook.com>
Cc: Rob Landley <rob@landley.net>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jim Cromie <jim.cromie@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Mimi Zohar <zohar@linux.ibm.com>
---
 init/do_mounts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index 5dfd30b13f48..6567cf5807ee 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -510,7 +510,7 @@ struct file_system_type rootfs_fs_type = {
 
 void __init init_rootfs(void)
 {
-	if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] &&
+	if (IS_ENABLED(CONFIG_TMPFS) &&
 		(!root_fs_names || strstr(root_fs_names, "tmpfs")))
 		is_tmpfs = true;
 }
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-11-02 11:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-31 15:44 [RFC PATCH] rootfs: Use tmpfs for rootfs even if root= is given Stefan Berger
2023-10-31 16:56 ` Greg Kroah-Hartman
     [not found]   ` <b035a00f-865a-453c-bb27-0916aada0594@linux.ibm.com>
2023-10-31 20:33     ` H. Peter Anvin
2023-10-31 21:02       ` Stefan Berger
2023-11-01 11:35   ` Rob Landley
2023-11-01 12:11     ` Stefan Berger
2023-11-01 14:48       ` Rob Landley
2023-11-01 14:16     ` Stefan Berger
2023-11-01 14:28       ` Greg Kroah-Hartman
2023-11-01 14:31         ` Mimi Zohar
2023-11-02 11:56     ` Mimi Zohar

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.