diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2011-11-07 11:39:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-07 13:54:10 -0500 |
commit | 50e696308c3fb18a4a0dae7b3a4d47469149c919 (patch) | |
tree | 16ff458026c1551803b86d9e0f9f02c7a64182fa | |
parent | a84450604d0fe08b6a2335efbedede18d3d7cc75 (diff) |
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>
-rw-r--r-- | fs/dcache.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 274f13e2f094..a901c6901bce 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -546,9 +546,11 @@ int d_invalidate(struct dentry * dentry) | |||
546 | * would make it unreachable from the root, | 546 | * would make it unreachable from the root, |
547 | * we might still populate it if it was a | 547 | * we might still populate it if it was a |
548 | * working directory or similar). | 548 | * working directory or similar). |
549 | * We also need to leave mountpoints alone, | ||
550 | * directory or not. | ||
549 | */ | 551 | */ |
550 | if (dentry->d_count > 1) { | 552 | if (dentry->d_count > 1 && dentry->d_inode) { |
551 | if (dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode)) { | 553 | if (S_ISDIR(dentry->d_inode->i_mode) || d_mountpoint(dentry)) { |
552 | spin_unlock(&dentry->d_lock); | 554 | spin_unlock(&dentry->d_lock); |
553 | return -EBUSY; | 555 | return -EBUSY; |
554 | } | 556 | } |