aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/namespace.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 970fe79d7867..b0b15cc2117c 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2344,17 +2344,13 @@ void __init mnt_init(void)
2344 2344
2345void put_mnt_ns(struct mnt_namespace *ns) 2345void put_mnt_ns(struct mnt_namespace *ns)
2346{ 2346{
2347 struct vfsmount *root;
2348 LIST_HEAD(umount_list); 2347 LIST_HEAD(umount_list);
2349 2348
2350 if (!atomic_dec_and_lock(&ns->count, &vfsmount_lock)) 2349 if (!atomic_dec_and_test(&ns->count))
2351 return; 2350 return;
2352 root = ns->root;
2353 ns->root = NULL;
2354 spin_unlock(&vfsmount_lock);
2355 down_write(&namespace_sem); 2351 down_write(&namespace_sem);
2356 spin_lock(&vfsmount_lock); 2352 spin_lock(&vfsmount_lock);
2357 umount_tree(root, 0, &umount_list); 2353 umount_tree(ns->root, 0, &umount_list);
2358 spin_unlock(&vfsmount_lock); 2354 spin_unlock(&vfsmount_lock);
2359 up_write(&namespace_sem); 2355 up_write(&namespace_sem);
2360 release_mounts(&umount_list); 2356 release_mounts(&umount_list);