]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/nfs/nfs_subs.c
xnu-4903.221.2.tar.gz
[apple/xnu.git] / bsd / nfs / nfs_subs.c
index ff5ae70b6fbf4faf263f939264e2039b90c111f8..0702fbed92433ea410d462d5beda04b020168ec8 100644 (file)
@@ -1688,8 +1688,15 @@ nfs_getattrcache(nfsnode_t np, struct nfs_vattr *nvaper, int flags)
         * and return cached attributes.
         */
        if (!nfs_use_cache(nmp)) {
-               timeo = nfs_attrcachetimeout(np);
                microuptime(&nowup);
+               if (np->n_attrstamp > nowup.tv_sec) {
+                       printf("NFS: Attribute time stamp is in the future by %ld seconds. Invalidating cache\n",
+                              np->n_attrstamp - nowup.tv_sec);
+                       NATTRINVALIDATE(np);
+                       NACCESSINVALIDATE(np);
+                       return (ENOENT);
+               }
+               timeo = nfs_attrcachetimeout(np);
                if ((nowup.tv_sec - np->n_attrstamp) >= timeo) {
                        FSDBG(528, np, 0, 0xffffff02, ENOENT);
                        OSAddAtomic64(1, &nfsstats.attrcache_misses);