aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 2dd333b0fe7f..6645846f2056 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2246,10 +2246,14 @@ void __init mnt_init(void)
2246 init_mount_tree(); 2246 init_mount_tree();
2247} 2247}
2248 2248
2249void __put_mnt_ns(struct mnt_namespace *ns) 2249void put_mnt_ns(struct mnt_namespace *ns)
2250{ 2250{
2251 struct vfsmount *root = ns->root; 2251 struct vfsmount *root;
2252 LIST_HEAD(umount_list); 2252 LIST_HEAD(umount_list);
2253
2254 if (!atomic_dec_and_lock(&ns->count, &vfsmount_lock))
2255 return;
2256 root = ns->root;
2253 ns->root = NULL; 2257 ns->root = NULL;
2254 spin_unlock(&vfsmount_lock); 2258 spin_unlock(&vfsmount_lock);
2255 down_write(&namespace_sem); 2259 down_write(&namespace_sem);