diff options
| author | John Stultz <johnstul@us.ibm.com> | 2010-04-29 02:31:49 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2010-04-29 05:57:13 -0400 |
| commit | 4329d1ae261df5ae61f8a4db7253fbe316efb590 (patch) | |
| tree | 4558d10eb94d04defcde2225e440dc449d0dd531 /include | |
| parent | a0a59617869efb2ec0e80c6cf11cfc90735600f6 (diff) | |
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.h | 3 |
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 { | |||
| 99 | atomic_t d_count; | 99 | atomic_t d_count; |
| 100 | unsigned int d_flags; /* protected by d_lock */ | 100 | unsigned int d_flags; /* protected by d_lock */ |
| 101 | spinlock_t d_lock; /* per dentry lock */ | 101 | spinlock_t d_lock; /* per dentry lock */ |
| 102 | int d_mounted; | ||
| 102 | seqcount_t d_seq; /* per dentry seqlock */ | 103 | seqcount_t d_seq; /* per dentry seqlock */ |
| 103 | struct inode *d_inode; /* Where the name belongs to - NULL is | 104 | struct inode *d_inode; /* Where the name belongs to - NULL is |
| 104 | * negative */ | 105 | * negative */ |
| @@ -364,7 +365,7 @@ extern void dput(struct dentry *); | |||
| 364 | 365 | ||
| 365 | static inline int d_mountpoint(struct dentry *dentry) | 366 | static inline int d_mountpoint(struct dentry *dentry) |
| 366 | { | 367 | { |
| 367 | return dentry->d_flags & DCACHE_MOUNTED; | 368 | return dentry->d_mounted; |
| 368 | } | 369 | } |
| 369 | 370 | ||
| 370 | extern struct vfsmount *lookup_mnt(struct path *); | 371 | extern struct vfsmount *lookup_mnt(struct path *); |
