summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@ZenIV.linux.org.uk>2011-11-07 16:39:57 +0000
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-07 10:54:10 -0800
commit50e696308c3fb18a4a0dae7b3a4d47469149c919 (patch)
tree16ff458026c1551803b86d9e0f9f02c7a64182fa /fs
parenta84450604d0fe08b6a2335efbedede18d3d7cc75 (diff)
downloadop-kernel-dev-50e696308c3fb18a4a0dae7b3a4d47469149c919.zip
op-kernel-dev-50e696308c3fb18a4a0dae7b3a4d47469149c919.tar.gz
vfs: d_invalidate() should leave mountpoints alone
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/dcache.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 274f13e..a901c69 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -546,9 +546,11 @@ int d_invalidate(struct dentry * dentry)
* would make it unreachable from the root,
* we might still populate it if it was a
* working directory or similar).
+ * We also need to leave mountpoints alone,
+ * directory or not.
*/
- if (dentry->d_count > 1) {
- if (dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode)) {
+ if (dentry->d_count > 1 && dentry->d_inode) {
+ if (S_ISDIR(dentry->d_inode->i_mode) || d_mountpoint(dentry)) {
spin_unlock(&dentry->d_lock);
return -EBUSY;
}
OpenPOWER on IntegriCloud