diff options
| -rw-r--r-- | fs/dcache.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index efd9332c8407..810ac48ae753 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -452,10 +452,9 @@ static void dentry_free(struct dentry *dentry) } /* - * If inode is unlinked and doesn't have any aliases (i.e., all fds pointing to - * it are closed), it is pretty much dead. Except that file handle lookup could - * still revive it which causes issues to fsnotify. So once inode reaches this - * state we make sure to block creating any new aliases. + * When inode is unlinked and doesn't have any aliases (i.e., all fds pointing + * to it are closed) we report FS_DELETE_SELF to fsnotify and cleanup all inode + * marks. */ static bool inode_notify_dead(struct inode *inode) { @@ -2312,12 +2311,7 @@ static struct dentry *__d_obtain_alias(struct inode *inode, bool disconnected) sb = inode->i_sb; - spin_lock(&inode->i_lock); - if (!inode_notify_dead(inode)) - res = __d_find_any_alias(inode); /* existing alias? */ - else - res = ERR_PTR(-ESTALE); - spin_unlock(&inode->i_lock); + res = d_find_any_alias(inode); /* existing alias? */ if (res) goto out; @@ -2329,10 +2323,7 @@ static struct dentry *__d_obtain_alias(struct inode *inode, bool disconnected) security_d_instantiate(new, inode); spin_lock(&inode->i_lock); - if (!inode_notify_dead(inode)) - res = __d_find_any_alias(inode); /* recheck under lock */ - else - res = ERR_PTR(-ESTALE); + res = __d_find_any_alias(inode); /* recheck under lock */ if (likely(!res)) { /* still no alias, attach a disconnected dentry */ unsigned add_flags = d_flags_for_inode(inode); |
