/*
- * Copyright (c) 2000-2014 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* 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);
cnp->cn_flags |= NOCROSSMOUNT;
cnp->cn_nameptr = cnp->cn_pnbuf;
nip->ni_usedvp = nip->ni_startdir = dp;
+ nip->ni_rootdir = rootvnode;
/*
* And call lookup() to do the real work
xnd.ni_cnd.cn_nameptr = xnd.ni_cnd.cn_pnbuf = path;
xnd.ni_startdir = mvp;
xnd.ni_usedvp = mvp;
+ xnd.ni_rootdir = rootvnode;
xnd.ni_cnd.cn_context = ctx;
while ((error = lookup(&xnd)) == ERECYCLE) {
xnd.ni_cnd.cn_flags = LOCKLEAF;
{
struct nfs_exportfs *nxfs;
struct nfs_export *nx;
- struct nfs_export_options *nxo;
+ struct nfs_export_options *nxo = NULL;
if (nam == NULL)
return (EACCES);
/* Lookup in the export list first. */
if (nam != NULL) {
saddr = mbuf_data(nam);
+ if (saddr->sa_family > AF_MAX) {
+ /* Bogus sockaddr? Don't match anything. */
+ return (NULL);
+ }
rnh = nx->nx_rtable[saddr->sa_family];
if (rnh != NULL) {
no = (struct nfs_netopt *)