linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul Menage" <menage@google.com>
To: "Miklos Szeredi" <miklos@szeredi.hu>
Cc: viro@zeniv.linux.org.uk, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] Add MS_BIND_FLAGS mount flag
Date: Thu, 14 Feb 2008 08:13:09 -0800	[thread overview]
Message-ID: <6599ad830802140813n71b56dccud33e19642a0d7647@mail.gmail.com> (raw)
In-Reply-To: <E1JPgYm-0002dm-IX@pomaz-ex.szeredi.hu>

On Thu, Feb 14, 2008 at 8:03 AM, Miklos Szeredi <miklos@szeredi.hu> wrote:
>  > The "flags" argument could be the same as for regular mount, and
>  > contain the mnt_flags - so the extra argument could maybe usefully be
>  > a "mnt_flags_mask", to indicate which flags we actually care about
>  > overriding.
>
>  The way I imagined it, is that mnt_flags is a mask, and the operation
>  (determined by flags) is either:
>
>   - set bits in mask
>   - clear bits in mask (or not in mask)
>   - set flags to mask
>
>  It doesn't allow setting some bits, clearing some others, and leaving
>  alone the rest.  But I think such flexibility isn't really needed.

I think I'd suggest something like:

new_mnt->mnt_flags = (old_mnt->mnt_flags & ~arg_mask) | (arg_flags & mask)

>  Maybe instead of messing with masks, it's better to introduce a
>  get_flags() or a more general mount_stat() operation, and let
>  userspace deal with setting and clearing flags, just as we do for
>  stat/chmod?
>
>  So we'd have
>
>   mount_stat(path, stat);
>   mount_bind(from, to, flags);
>   mount_set_flags(path, flags);
>   mount_move(from, to);
>
>  and perhaps
>
>   mount_remount(path, opt_string, flags);

Sounds reasonable to me. But it wouldn't directly solve the "do a
recursive bind mount setting the MS_READONLY flag on all children"
problem, so we'd need some of the earlier suggestions too.

Paul

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

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <47B283EB.8070209@google.com>
2008-02-14  8:30 ` [PATCH] Add MS_BIND_FLAGS mount flag 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 [this message]
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
     [not found] ` <20080214060201.GA17680@infradead.org>
     [not found]   ` <6599ad830802140722t2e3a2779sa323657dfd6da841@mail.gmail.com>
2008-02-14 15:23     ` Paul Menage

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=6599ad830802140813n71b56dccud33e19642a0d7647@mail.gmail.com \
    --to=menage@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --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;
as well as URLs for NNTP newsgroup(s).