diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-11-21 01:33:09 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-12-16 22:30:49 +0100 |
commit | 5235d448c48e1f5a4a34bf90d412775cb75ffb32 (patch) | |
tree | f4bbb063b81ba920fffe16fd12bfc0d01db05673 /fs/namespace.c | |
parent | clone_private_mount() doesn't need to touch namespace_sem (diff) | |
download | linux-5235d448c48e1f5a4a34bf90d412775cb75ffb32.tar.xz linux-5235d448c48e1f5a4a34bf90d412775cb75ffb32.zip |
reorganize do_make_slave()
Make sure that clone_mnt() never returns a mount with MNT_SHARED in
flags, but without a valid ->mnt_group_id. That allows to demystify
do_make_slave() quite a bit, among other things.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index ec726ae00579..141d5776c70e 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -1030,6 +1030,8 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root, if (IS_MNT_SLAVE(old)) list_add(&mnt->mnt_slave, &old->mnt_slave); mnt->mnt_master = old->mnt_master; + } else { + CLEAR_MNT_SHARED(mnt); } if (flag & CL_MAKE_SHARED) set_mnt_shared(mnt); |