[lkml]   [2008]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Add MS_BIND_FLAGS mount flag
    On Thu, Feb 14, 2008 at 8:03 AM, Miklos Szeredi <> 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.


     \ /
      Last update: 2008-02-14 17:15    [W:0.060 / U:9.836 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site