From ecf02d3bb79ae855ff7545bd361b5a84a6d43de9 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Tue, 16 Jan 2007 10:09:44 -0500 Subject: [PATCH] --- yaml --- r: 46074 b: refs/heads/master c: ef75c7974b383769ae5741cf930b8aa4dcaef395 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/nfs/dir.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 2fa754bda2c1..5e04de7afae0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: df1d5d23d3a1a713c69b0f9ec67c59aeca3ce6b3 +refs/heads/master: ef75c7974b383769ae5741cf930b8aa4dcaef395 diff --git a/trunk/fs/nfs/dir.c b/trunk/fs/nfs/dir.c index db29c7fa9620..062e108fac50 100644 --- a/trunk/fs/nfs/dir.c +++ b/trunk/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;