From 080cf4202de306381ce4cb53c0bdbb04b1befc4a Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 21 Mar 2008 23:59:49 -0400 Subject: [PATCH] --- yaml --- r: 87913 b: refs/heads/master c: 7c4b93d8269b9d35971a8239426b1f6ddc3d5ef7 h: refs/heads/master i: 87911: 7fe0151230f2b478ccfff40e3fe0271be97bfb59 v: v3 --- [refs] | 2 +- trunk/fs/namespace.c | 5 ++++- trunk/fs/pnode.c | 2 +- trunk/include/linux/mount.h | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 9b4da0c15758..9330a891575c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1a39068954e33f4bf3e09375a8112dcc801c4688 +refs/heads/master: 7c4b93d8269b9d35971a8239426b1f6ddc3d5ef7 diff --git a/trunk/fs/namespace.c b/trunk/fs/namespace.c index 6324dfc80dc6..c175218ebae1 100644 --- a/trunk/fs/namespace.c +++ b/trunk/fs/namespace.c @@ -548,6 +548,7 @@ void release_mounts(struct list_head *head) m = mnt->mnt_parent; mnt->mnt_mountpoint = mnt->mnt_root; mnt->mnt_parent = mnt; + m->mnt_ghosts--; spin_unlock(&vfsmount_lock); dput(dentry); mntput(m); @@ -572,8 +573,10 @@ void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill) __touch_mnt_namespace(p->mnt_ns); p->mnt_ns = NULL; list_del_init(&p->mnt_child); - if (p->mnt_parent != p) + if (p->mnt_parent != p) { + p->mnt_parent->mnt_ghosts++; p->mnt_mountpoint->d_mounted--; + } change_mnt_propagation(p, MS_PRIVATE); } } diff --git a/trunk/fs/pnode.c b/trunk/fs/pnode.c index 05ba692bc540..1d8f5447f3f7 100644 --- a/trunk/fs/pnode.c +++ b/trunk/fs/pnode.c @@ -225,7 +225,7 @@ int propagate_mnt(struct vfsmount *dest_mnt, struct dentry *dest_dentry, */ static inline int do_refcount_check(struct vfsmount *mnt, int count) { - int mycount = atomic_read(&mnt->mnt_count); + int mycount = atomic_read(&mnt->mnt_count) - mnt->mnt_ghosts; return (mycount > count); } diff --git a/trunk/include/linux/mount.h b/trunk/include/linux/mount.h index 6d3047d8c91c..dac5e67ff3ee 100644 --- a/trunk/include/linux/mount.h +++ b/trunk/include/linux/mount.h @@ -61,6 +61,7 @@ struct vfsmount { atomic_t mnt_count; int mnt_expiry_mark; /* true if marked for expiry */ int mnt_pinned; + int mnt_ghosts; }; static inline struct vfsmount *mntget(struct vfsmount *mnt)