[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6599ad830802140813n71b56dccud33e19642a0d7647@mail.gmail.com>
Date: Thu, 14 Feb 2008 08:13:09 -0800
From: "Paul Menage" <menage@...gle.com>
To: "Miklos Szeredi" <miklos@...redi.hu>
Cc: viro@...iv.linux.org.uk, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] Add MS_BIND_FLAGS mount flag
On Thu, Feb 14, 2008 at 8:03 AM, Miklos Szeredi <miklos@...redi.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists