diff mbox

nfsd4: allow __d_obtain_alias() to return unhashed dentries

Message ID 20101203223326.GB28763@fieldses.org (mailing list archive)
State Superseded, archived
Headers show

Commit Message

J. Bruce Fields Dec. 3, 2010, 10:33 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/dcache.c b/fs/dcache.c
index 23702a9..afa8a0d 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -368,7 +368,7 @@  static struct dentry * __d_find_alias(struct inode *inode, int want_discon)
 		next = tmp->next;
 		prefetch(next);
 		alias = list_entry(tmp, struct dentry, d_alias);
- 		if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) {
+		if (S_ISDIR(inode->i_mode) || !inode->i_nlink || !d_unhashed(alias)) {
 			if (IS_ROOT(alias) &&
 			    (alias->d_flags & DCACHE_DISCONNECTED))
 				discon_alias = alias;