All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Paul Menage <menage@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add MS_BIND_FLAGS mount flag
Date: Thu, 14 Feb 2008 01:02:01 -0500	[thread overview]
Message-ID: <20080214060201.GA17680@infradead.org> (raw)
In-Reply-To: <47B283EB.8070209@google.com>

On Tue, Feb 12, 2008 at 09:45:15PM -0800, Paul Menage wrote:
> From: Paul Menage <menage@google.com>
>
> Add a new mount() flag, MS_BIND_FLAGS.
>
> MS_BIND_FLAGS indicates that a bind mount should take its per-mount flags
> from the arguments passed to mount() rather than from the source
> mountpoint.
>
> This flag allows you to create a bind mount with the desired per-mount
> flags in a single operation, rather than having to do a bind mount
> followed by a remount, which is fiddly and can block for non-trivial
> periods of time (on sb->s_umount?).
>
> For recursive bind mounts, only the root of the tree being bound
> inherits the per-mount flags from the mount() arguments; sub-mounts
> inherit their per-mount flags from the source tree as usual.

I think this concept is reasonable, but I don't think MS_BIND_FLAGS
is a descriptive name for this flag.  MS_EXPLICIT_FLAGS might be better
but still isn't optimal.

> +static struct vfsmount *
> +__copy_tree(struct vfsmount *mnt, struct dentry *dentry,
> +	    int flag, int mnt_flags)

> +struct vfsmount *copy_tree(struct vfsmount *mnt, struct dentry *dentry,
> +			   int flag)
> +{
> +	return __copy_tree(mnt, dentry, flag, mnt->mnt_flags);
> +}

Please just change copy_tree to have an additional parameter.  There's
just four callers of it in the tree, and three of them want the new
parameter.

> +	/* Use the source mount flags unless the user passed MS_BIND_FLAGS */

I think this comment could be made a little more explicit.

	/*
	 * If MS_EXPLICIT_FLAGS is passed in we will take the paramters
	 * the user has specified.  The default behaviour for bind
	 * mounts is however to take the flags from existing mount
	 * instances for the same superblock.
	 */
	 
> #define MS_RELATIME	(1<<21)	/* Update atime relative to mtime/ctime. */
> #define MS_KERNMOUNT	(1<<22) /* this is a kern_mount call */
> #define MS_I_VERSION	(1<<23) /* Update inode I_version field */
> +#define MS_BIND_FLAGS	(1<<24) /* For MS_BIND, take mnt_flags from
> +				 * args, not from source mountpoint */
> #define MS_ACTIVE	(1<<30)
> #define MS_NOUSER	(1<<31)

this looks like whitespace damage to me.


  reply	other threads:[~2008-02-14  6:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-13  5:45 [PATCH] Add MS_BIND_FLAGS mount flag Paul Menage
2008-02-14  6:02 ` Christoph Hellwig [this message]
2008-02-14 15:22   ` Paul Menage
2008-02-14 15:23     ` Paul Menage
2008-02-14  8:30 ` Miklos Szeredi
2008-02-14 13:06   ` Trond Myklebust
2008-02-14 15:19   ` Paul Menage
2008-02-14 16:03     ` Miklos Szeredi
2008-02-14 16:13       ` Paul Menage
2008-02-14 17:31         ` Miklos Szeredi
2008-02-14 18:05           ` Paul Menage
2008-02-14 22:30             ` Miklos Szeredi
2008-02-14 16:26       ` Trond Myklebust
2008-02-14 17:39         ` Miklos Szeredi
2008-02-14 19:17           ` Trond Myklebust
2008-02-14 22:18             ` Miklos Szeredi
2008-02-14 23:33               ` Trond Myklebust

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=20080214060201.GA17680@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menage@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 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.