mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Pitre <nicolas.pitre@linaro.org>
To: Brian Ashworth <bosrsf04@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>,
	Ingo Molnar <mingo@kernel.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Andy Lutomirski <luto@kernel.org>, Petr Mladek <pmladek@suse.com>,
	Helge Deller <deller@gmx.de>, Rik van Riel <riel@redhat.com>,
	Thomas Garnier <thgarnie@google.com>,
	Parav Pandit <pandit.parav@gmail.com>,
	"seokhoon . yoon" <iamyooon@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Dave Hansen <dave.hansen@intel.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	josh@joshtriplett.org, brkkurek192@gmail.com,
	conorcurry@gmail.com, fanofbond138@gmail.com
Subject: Re: [PATCH 1/1] fs: Allows for the pivot_root syscall to be optional
Date: Sat, 25 Feb 2017 20:14:52 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.20.1702252007320.1730@knanqh.ubzr> (raw)
In-Reply-To: <06c7c949626acd419d77d611a65ca5427d6cf866.1488054759.git.bosrsf04@gmail.com>

On Sat, 25 Feb 2017, Brian Ashworth wrote:

> The pivot_root syscall is not needed on systems that do not use
> any intermediate filesystem. Allowing for pivot_root to be
> ommitted from the kernel will aid in the tinification efforts.
> 
> Without CONFIG_PIVOT_ROOT_SYSCALL set
> add/remove: 0/2 grow/shrink: 1/0 up/down: 45/-707 (-662)
> function                                     old     new   delta
> attach_recursive_mnt                         349     394     +45
> attach_mnt                                    71       -     -71
> sys_pivot_root                               636       -    -636
> Total: Before=1899893, After=1899231, chg -0.03%

A -0.03% size difference doesn't seem much.  To bring up a more 
realistic scenario for tinification statistics, you could start from 
"make tinyconfig" instead.

> Signed-off-by: Brian Ashworth <bosrsf04@gmail.com>
> ---
>  fs/namespace.c  |  2 ++
>  init/Kconfig    | 10 ++++++++++
>  kernel/sys_ni.c |  1 +
>  3 files changed, 13 insertions(+)

I agree that this is a much more interesting diffstat than the previous 
one.

Acked-by: Nicolas Pitre <nico@linaro.org>


> diff --git a/fs/namespace.c b/fs/namespace.c
> index 487ba30bb5c6..5e24a08bfb36 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -3058,6 +3058,7 @@ bool path_is_under(const struct path *path1, const struct path *path2)
>  }
>  EXPORT_SYMBOL(path_is_under);
>  
> +#ifdef CONFIG_PIVOT_ROOT_SYSCALL
>  /*
>   * pivot_root Semantics:
>   * Moves the root file system of the current process to the directory put_old,
> @@ -3180,6 +3181,7 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
>  out0:
>  	return error;
>  }
> +#endif  /* CONFIG_PIVOT_ROOT_SYSCALL */
>  
>  static void __init init_mount_tree(void)
>  {
> diff --git a/init/Kconfig b/init/Kconfig
> index 8c39615165b7..4ea9ab25ec30 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1450,6 +1450,16 @@ config SYSCTL_SYSCALL
>  
>  	  If unsure say N here.
>  
> +config PIVOT_ROOT_SYSCALL
> +	bool "Pivot_root syscall support" if EXPERT
> +	default y
> +	help
> +	  pivot_root is a system call that allows the root to be moved and
> +	  replaced by another root. This is needed for intermediate file
> +	  systems such as initrd.
> +
> +	  If unsure say Y here.
> +
>  config POSIX_TIMERS
>  	bool "Posix Clocks & timers" if EXPERT
>  	default y
> diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
> index 8acef8576ce9..7bd207571f87 100644
> --- a/kernel/sys_ni.c
> +++ b/kernel/sys_ni.c
> @@ -178,6 +178,7 @@ cond_syscall(sys_setfsgid);
>  cond_syscall(sys_capget);
>  cond_syscall(sys_capset);
>  cond_syscall(sys_copy_file_range);
> +cond_syscall(sys_pivot_root);
>  
>  /* arch-specific weak syscall entries */
>  cond_syscall(sys_pciconfig_read);
> -- 
> 2.11.1
> 
> 

  reply	other threads:[~2017-02-26  1:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-25  0:21 [PATCH 0/3] fs: Support compiling out the pivot_root syscall bosrsf04
2017-02-25  0:21 ` [PATCH 1/3] fs: Makes functions used by pivot_root accessible bosrsf04
2017-02-25  0:21 ` [PATCH 2/3] fs: Extracts pivot_root so it can be made optional bosrsf04
2017-02-25 15:22   ` Theodore Ts'o
2017-02-25 16:06     ` Al Viro
2017-02-26  0:54       ` [PATCH 0/1] fs: Support compiling out the pivot_root syscall Brian Ashworth
2017-02-26  0:54         ` [PATCH 1/1] fs: Allows for the pivot_root syscall to be optional Brian Ashworth
2017-02-26  1:14           ` Nicolas Pitre [this message]
2017-03-29 20:38             ` bosrsf04
2017-02-25  0:21 ` [PATCH 3/3] fs: Allows for the pivot_root syscall to be omitted bosrsf04
2017-02-25 15:18 ` [PATCH 0/3] fs: Support compiling out the pivot_root syscall Nicolas Pitre

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=alpine.LFD.2.20.1702252007320.1730@knanqh.ubzr \
    --to=nicolas.pitre@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bosrsf04@gmail.com \
    --cc=brkkurek192@gmail.com \
    --cc=conorcurry@gmail.com \
    --cc=dave.hansen@intel.com \
    --cc=deller@gmx.de \
    --cc=fanofbond138@gmail.com \
    --cc=iamyooon@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=pandit.parav@gmail.com \
    --cc=pmladek@suse.com \
    --cc=riel@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thgarnie@google.com \
    --cc=viro@zeniv.linux.org.uk \
    /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®