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>
This commit is contained in:
parent
a84450604d
commit
50e696308c
1 changed files with 4 additions and 2 deletions
|
@ -546,9 +546,11 @@ int d_invalidate(struct dentry * dentry)
|
||||||
* would make it unreachable from the root,
|
* would make it unreachable from the root,
|
||||||
* we might still populate it if it was a
|
* we might still populate it if it was a
|
||||||
* working directory or similar).
|
* working directory or similar).
|
||||||
|
* We also need to leave mountpoints alone,
|
||||||
|
* directory or not.
|
||||||
*/
|
*/
|
||||||
if (dentry->d_count > 1) {
|
if (dentry->d_count > 1 && dentry->d_inode) {
|
||||||
if (dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode)) {
|
if (S_ISDIR(dentry->d_inode->i_mode) || d_mountpoint(dentry)) {
|
||||||
spin_unlock(&dentry->d_lock);
|
spin_unlock(&dentry->d_lock);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue