summaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-12-22 23:04:31 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2016-12-22 23:04:31 -0500
commitfaf0dcebd7b387187f29ff811d47df465ea4c9f9 (patch)
tree77077e72fe22222a369aa36da2f12e064a91bbe9 /fs/namespace.c
parent128394eff343fc6d2f32172f03e24829539c5835 (diff)
parent5235d448c48e1f5a4a34bf90d412775cb75ffb32 (diff)
downloadlinux-faf0dcebd7b387187f29ff811d47df465ea4c9f9.tar.bz2
Merge branch 'work.namespace' into for-linus
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index f7e28f8ea04d..b5b1259e064f 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -96,10 +96,6 @@ static inline struct hlist_head *mp_hash(struct dentry *dentry)
return &mountpoint_hashtable[tmp & mp_hash_mask];
}
-/*
- * allocation is serialized by namespace_sem, but we need the spinlock to
- * serialize with freeing.
- */
static int mnt_alloc_id(struct mount *mnt)
{
int res;
@@ -1034,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);
@@ -1828,9 +1826,7 @@ struct vfsmount *clone_private_mount(const struct path *path)
if (IS_MNT_UNBINDABLE(old_mnt))
return ERR_PTR(-EINVAL);
- down_read(&namespace_sem);
new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE);
- up_read(&namespace_sem);
if (IS_ERR(new_mnt))
return ERR_CAST(new_mnt);