Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef75c7974b383769ae5741cf930b8aa4dcaef395 Commit: ef75c7974b383769ae5741cf930b8aa4dcaef395 Parent: df1d5d23d3a1a713c69b0f9ec67c59aeca3ce6b3 Author: Trond Myklebust <[EMAIL PROTECTED]> AuthorDate: Tue Jan 16 10:09:44 2007 -0500 Committer: Trond Myklebust <[EMAIL PROTECTED]> CommitDate: Sat Feb 3 15:35:04 2007 -0800
NFS: Also use readdir info to revalidate positive dentries If the fileid of the cached dentry fails to match that returned by the readdir call, then we should also d_drop. Try to take into account the fact that on NFSv4, readdir may return the "mounted_on_fileid" by looking for submounts. Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]> --- 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 db29c7f..062e108 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) 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); @@ -1152,6 +1159,7 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc) dentry = alias; } +out_renew: nfs_renew_times(dentry); nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); return dentry; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html