summaryrefslogtreecommitdiffstats
path: root/sys/fs/nfsclient/nfs_clvnops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/nfsclient/nfs_clvnops.c')
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 2747191..183491e 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -1063,7 +1063,8 @@ nfs_lookup(struct vop_lookup_args *ap)
* We only accept a positive hit in the cache if the
* change time of the file matches our cached copy.
* Otherwise, we discard the cache entry and fallback
- * to doing a lookup RPC.
+ * to doing a lookup RPC. We also only trust cache
+ * entries for less than nm_nametimeo seconds.
*
* To better handle stale file handles and attributes,
* clear the attribute cache of this node if it is a
@@ -1085,7 +1086,8 @@ nfs_lookup(struct vop_lookup_args *ap)
mtx_unlock(&newnp->n_mtx);
}
if (nfscl_nodeleg(newvp, 0) == 0 ||
- (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 &&
+ ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) &&
+ VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 &&
timespeccmp(&vattr.va_ctime, &nctime, ==))) {
NFSINCRGLOBAL(newnfsstats.lookupcache_hits);
if (cnp->cn_nameiop != LOOKUP &&
OpenPOWER on IntegriCloud