diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-07-07 20:57:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-07 21:23:51 -0400 |
commit | ac0811538b40bb92d339d22364026ed91dfdd147 (patch) | |
tree | 6129b15ee8219343244c3dc8efa1a9ea7b51531d | |
parent | ed42c879b7b1463aa7a15fdbbeb2b1914d60be8a (diff) |
[PATCH] namespace.c: fix mnt_namespace zeroing for expired mounts
This patch clears mnt_namespace in an expired mount.
If mnt_namespace is not cleared, it's possible to attach a new mount to the
already detached mount, because check_mnt() can return true.
The effect is a resource leak, since the resulting tree will never be
freed.
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/namespace.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 2b4635e43ae8..7fd56eeb21bf 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -847,6 +847,7 @@ static void expire_mount(struct vfsmount *mnt, struct list_head *mounts) | |||
847 | 847 | ||
848 | /* delete from the namespace */ | 848 | /* delete from the namespace */ |
849 | list_del_init(&mnt->mnt_list); | 849 | list_del_init(&mnt->mnt_list); |
850 | mnt->mnt_namespace = NULL; | ||
850 | detach_mnt(mnt, &old_nd); | 851 | detach_mnt(mnt, &old_nd); |
851 | spin_unlock(&vfsmount_lock); | 852 | spin_unlock(&vfsmount_lock); |
852 | path_release(&old_nd); | 853 | path_release(&old_nd); |