mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5] initmpfs v2: use tmpfs instead of ramfs for rootfs
@ 2013-07-16 23:45 Rob Landley
  2013-07-16 23:45 ` [PATCH 1/5] initmpfs v2: replace MS_NOUSER in initramfs Rob Landley
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Rob Landley @ 2013-07-16 23:45 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Viro, Al Viro, Andrew Morton, Eric W. Biederman,
	Greg Kroah-Hartman, Hugh Dickins, Jeff Layton, Jens Axboe,
	Jim Cromie, linux-fsdevel, linux-mm, Rusty Russell, Sam Ravnborg,
	Stephen Warren

Use tmpfs for rootfs when CONFIG_TMPFS=y and there's no root=.
Specify rootfstype=ramfs to get the old initramfs behavior.

The previous initramfs code provided a fairly crappy root filesystem:
didn't let you --bind mount directories out of it, reported zero
size/usage so it didn't show up in "df" and couldn't run things like
rpm that query available space before proceeding, would fill up all
available memory and panic the system if you wrote too much to it...

Using tmpfs instead provides a much better root filesystem.

Changes from v1: use test_and_set_bit() for "once" logic.

Changes from this morning's send: none, just hopefully not screwing
up the message-id this time trying to make it a reply to another message
via cut and paste...

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [RESEND] The initmpfs patches.
@ 2013-07-15 21:01 Andrew Morton
  2013-07-17 23:06 ` [PATCH 0/5] initmpfs v2: use tmpfs instead of ramfs for rootfs Andrew Morton
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Morton @ 2013-07-15 21:01 UTC (permalink / raw)
  To: Rob Landley; +Cc: linux-kernel

On Tue, 09 Jul 2013 21:06:39 -0500 Rob Landley <rob@landley.net> wrote:

> Attached, so you don't have to fish them out of:
> 
>    http://lkml.indiana.edu/hypermail/linux/kernel/1306.3/04204.html

Too hard.  Especially when I want to reply to a patch.  Please resend
as a patch series in the time-honoured fashion?

> --- a/fs/ramfs/inode.c
> +++ b/fs/ramfs/inode.c
> @@ -247,7 +247,14 @@ struct dentry *ramfs_mount(struct file_system_type *fs_type,
>  static struct dentry *rootfs_mount(struct file_system_type *fs_type,
>  	int flags, const char *dev_name, void *data)
>  {
> -	return mount_nodev(fs_type, flags|MS_NOUSER, data, ramfs_fill_super);
> +	static int once;
> +
> +	if (once)
> +		return ERR_PTR(-ENODEV);
> +	else
> +		once++;
> +
> +	return mount_nodev(fs_type, flags, data, ramfs_fill_super);
>  }

The patches do this in a couple of places.  The treatment of `once' is
obviously racy.  Probably it is unlikely to matter in these contexts,
but it does set a poor example.  And it's so trivially fixed with, for
example, test_and_set_bit() that I do think it's worth that change.



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

end of thread, other threads:[~2013-07-26  4:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-16 23:45 [PATCH 0/5] initmpfs v2: use tmpfs instead of ramfs for rootfs Rob Landley
2013-07-16 23:45 ` [PATCH 1/5] initmpfs v2: replace MS_NOUSER in initramfs Rob Landley
2013-07-16 23:45 ` [PATCH 2/5] initmpfs v2: Move bdi setup from init_rootfs to init_ramfs Rob Landley
2013-07-16 23:45 ` [PATCH 3/5] initmpfs v2: Move rootfs code from fs/ramfs/ to init/ Rob Landley
2013-07-16 23:45 ` [PATCH 4/5] initmpfs v2: Make rootfs use tmpfs when CONFIG_TMPFS enabled Rob Landley
2013-07-16 23:45 ` [PATCH 5/5] initmpfs v2: Use initramfs if rootfstype= or root= specified Rob Landley
2013-07-19 19:57   ` Andrew Morton
2013-07-26  4:12     ` Rob Landley
  -- strict thread matches above, loose matches on Subject: below --
2013-07-15 21:01 [RESEND] The initmpfs patches Andrew Morton
2013-07-17 23:06 ` [PATCH 0/5] initmpfs v2: use tmpfs instead of ramfs for rootfs Andrew Morton
2013-07-18  0:15   ` Hugh Dickins
2013-07-18 23:17     ` Rob Landley
2013-07-18 23:59   ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome