lkml.org 
[lkml]   [2011]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] fs: bound mount propagation fix
    Date
    I think MS_SILENT shouldn't be cleared anywhere. I suppose the bug is in 
    MS_SHARED options checking. Please see the patch below.

    Fixed MS_SHARED, MS_SLAVE, MS_UNBINDABLE option handling;
    Existing options check doesn't allow to have any options combinations
    because of integer comparison (not bitwise).

    Signed-off-by: Roman Borisov <ext-roman.borisov@nokia.com>
    ---
    fs/namespace.c | 2 +-
    fs/pnode.c | 6 +++---
    2 files changed, 4 insertions(+), 4 deletions(-)

    diff --git a/fs/namespace.c b/fs/namespace.c
    index 2beb0fb..e0cf263 100644
    --- a/fs/namespace.c
    +++ b/fs/namespace.c
    @@ -1434,7 +1434,7 @@ static int do_change_type(struct path *path, int flag)
    return -EINVAL;

    down_write(&namespace_sem);
    - if (type == MS_SHARED) {
    + if (type & MS_SHARED) {
    err = invent_group_ids(mnt, recurse);
    if (err)
    goto out_unlock;
    diff --git a/fs/pnode.c b/fs/pnode.c
    index 8d5f392..0c9dc54 100644
    --- a/fs/pnode.c
    +++ b/fs/pnode.c
    @@ -128,15 +128,15 @@ static int do_make_slave(struct vfsmount *mnt)

    void change_mnt_propagation(struct vfsmount *mnt, int type)
    {
    - if (type == MS_SHARED) {
    + if (type & MS_SHARED) {
    set_mnt_shared(mnt);
    return;
    }
    do_make_slave(mnt);
    - if (type != MS_SLAVE) {
    + if (!(type & MS_SLAVE)) {
    list_del_init(&mnt->mnt_slave);
    mnt->mnt_master = NULL;
    - if (type == MS_UNBINDABLE)
    + if (type & MS_UNBINDABLE)
    mnt->mnt_flags |= MNT_UNBINDABLE;
    else
    mnt->mnt_flags &= ~MNT_UNBINDABLE;
    --
    1.7.0.4


    \
     
     \ /
      Last update: 2011-04-01 16:49    [W:0.025 / U:32.112 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site