diff options
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index bd269d268824..db29c7fa9620 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1123,8 +1123,14 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc) | |||
1123 | } | 1123 | } |
1124 | name.hash = full_name_hash(name.name, name.len); | 1124 | name.hash = full_name_hash(name.name, name.len); |
1125 | dentry = d_lookup(parent, &name); | 1125 | dentry = d_lookup(parent, &name); |
1126 | if (dentry != NULL) | 1126 | if (dentry != NULL) { |
1127 | return dentry; | 1127 | /* Is this a positive dentry? */ |
1128 | if (dentry->d_inode != NULL) | ||
1129 | return dentry; | ||
1130 | /* No, so d_drop to allow one to be created */ | ||
1131 | d_drop(dentry); | ||
1132 | dput(dentry); | ||
1133 | } | ||
1128 | if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR)) | 1134 | if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR)) |
1129 | return NULL; | 1135 | return NULL; |
1130 | /* Note: caller is already holding the dir->i_mutex! */ | 1136 | /* Note: caller is already holding the dir->i_mutex! */ |