name.hash = full_name_hash(name.name, name.len);
dentry = d_lookup(parent, &name);
if (dentry != NULL) {
- /* Is this a positive dentry? */
- if (dentry->d_inode != NULL)
- return dentry;
+ /* Is this a positive dentry that matches the readdir info? */
+ if (dentry->d_inode != NULL &&
+ (NFS_FILEID(dentry->d_inode) == entry->ino ||
+ d_mountpoint(dentry))) {
+ if (!desc->plus || entry->fh->size == 0)
+ return dentry;
+ if (nfs_compare_fh(NFS_FH(dentry->d_inode),
+ entry->fh) == 0)
+ goto out_renew;
+ }
/* No, so d_drop to allow one to be created */
d_drop(dentry);
dput(dentry);
dentry = alias;
}
+out_renew:
nfs_renew_times(dentry);
nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
return dentry;