diff options
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index db29c7fa9620..062e108fac50 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1124,9 +1124,16 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc) | |||
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 | /* Is this a positive dentry? */ | 1127 | /* Is this a positive dentry that matches the readdir info? */ |
1128 | if (dentry->d_inode != NULL) | 1128 | if (dentry->d_inode != NULL && |
1129 | return dentry; | 1129 | (NFS_FILEID(dentry->d_inode) == entry->ino || |
1130 | d_mountpoint(dentry))) { | ||
1131 | if (!desc->plus || entry->fh->size == 0) | ||
1132 | return dentry; | ||
1133 | if (nfs_compare_fh(NFS_FH(dentry->d_inode), | ||
1134 | entry->fh) == 0) | ||
1135 | goto out_renew; | ||
1136 | } | ||
1130 | /* No, so d_drop to allow one to be created */ | 1137 | /* No, so d_drop to allow one to be created */ |
1131 | d_drop(dentry); | 1138 | d_drop(dentry); |
1132 | dput(dentry); | 1139 | dput(dentry); |
@@ -1152,6 +1159,7 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc) | |||
1152 | dentry = alias; | 1159 | dentry = alias; |
1153 | } | 1160 | } |
1154 | 1161 | ||
1162 | out_renew: | ||
1155 | nfs_renew_times(dentry); | 1163 | nfs_renew_times(dentry); |
1156 | nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); | 1164 | nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); |
1157 | return dentry; | 1165 | return dentry; |