Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4291
b: refs/heads/master
c: 1ce88cf
h: refs/heads/master
i:
  4289: 2772d0b
  4287: 9ae6675
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Jul 8, 2005
1 parent 314ef50 commit 96698f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 202322e6f7cd12e82b5ff0fa92bbdf517fcf0947
refs/heads/master: 1ce88cf466f7b6078b14d67d186a3d7c19dd5609
7 changes: 5 additions & 2 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ void mark_mounts_for_expiry(struct list_head *mounts)
/* don't do anything if the namespace is dead - all the
* vfsmounts from it are going away anyway */
namespace = mnt->mnt_namespace;
if (!namespace || atomic_read(&namespace->count) <= 0)
if (!namespace || !namespace->root)
continue;
get_namespace(namespace);

Expand Down Expand Up @@ -1450,9 +1450,12 @@ void __init mnt_init(unsigned long mempages)

void __put_namespace(struct namespace *namespace)
{
struct vfsmount *root = namespace->root;
namespace->root = NULL;
spin_unlock(&vfsmount_lock);
down_write(&namespace->sem);
spin_lock(&vfsmount_lock);
umount_tree(namespace->root);
umount_tree(root);
spin_unlock(&vfsmount_lock);
up_write(&namespace->sem);
kfree(namespace);
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ extern void __put_namespace(struct namespace *namespace);

static inline void put_namespace(struct namespace *namespace)
{
if (atomic_dec_and_test(&namespace->count))
if (atomic_dec_and_lock(&namespace->count, &vfsmount_lock))
/* releases vfsmount_lock */
__put_namespace(namespace);
}

Expand Down

0 comments on commit 96698f6

Please sign in to comment.