aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 653f64ce98e2..139e5fd22fa6 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -325,10 +325,13 @@ static struct dentry * __d_find_alias(struct inode *inode, int want_discon)
325 325
326struct dentry * d_find_alias(struct inode *inode) 326struct dentry * d_find_alias(struct inode *inode)
327{ 327{
328 struct dentry *de; 328 struct dentry *de = NULL;
329 spin_lock(&dcache_lock); 329
330 de = __d_find_alias(inode, 0); 330 if (!list_empty(&inode->i_dentry)) {
331 spin_unlock(&dcache_lock); 331 spin_lock(&dcache_lock);
332 de = __d_find_alias(inode, 0);
333 spin_unlock(&dcache_lock);
334 }
332 return de; 335 return de;
333} 336}
334 337