summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Stultz <johnstul@us.ibm.com>2010-04-28 23:31:49 -0700
committerThomas Gleixner <tglx@linutronix.de>2010-04-29 11:57:13 +0200
commit4329d1ae261df5ae61f8a4db7253fbe316efb590 (patch)
tree4558d10eb94d04defcde2225e440dc449d0dd531 /include
parenta0a59617869efb2ec0e80c6cf11cfc90735600f6 (diff)
downloadlwn-4329d1ae261df5ae61f8a4db7253fbe316efb590.tar.gz
lwn-4329d1ae261df5ae61f8a4db7253fbe316efb590.zip
fs: Fix namespace related hangs
Nick converted the dentry->d_mounted counter to a flag, however with namespaces, dentries can be mounted multiple times (and more importantly unmounted multiple times). If a namespace was created and then released, the unmount_tree would remove the DCACHE_MOUNTED flag and that would make d_mountpoint fail, causing the mounts to be lost. This patch coverts it back to a counter, and adds some extra WARN_ONs to make sure things are accounted properly. Signed-off-by: John Stultz <johnstul@us.ibm.com> Cc: "Luis Claudio R. Goncalves" <lclaudio@uudg.org> Cc: Nick Piggin <npiggin@suse.de> LKML-Reference: <1272522942.1967.12.camel@work-vm> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dcache.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 39872ea86c6a..bc5a5ff141c8 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -99,6 +99,7 @@ struct dentry {
atomic_t d_count;
unsigned int d_flags; /* protected by d_lock */
spinlock_t d_lock; /* per dentry lock */
+ int d_mounted;
seqcount_t d_seq; /* per dentry seqlock */
struct inode *d_inode; /* Where the name belongs to - NULL is
* negative */
@@ -364,7 +365,7 @@ extern void dput(struct dentry *);
static inline int d_mountpoint(struct dentry *dentry)
{
- return dentry->d_flags & DCACHE_MOUNTED;
+ return dentry->d_mounted;
}
extern struct vfsmount *lookup_mnt(struct path *);