From: kib Date: Mon, 16 Sep 2019 13:26:27 +0000 (+0000) Subject: nfscl_loadattrcache: fix rest of the cases to not call X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=607db409c87d98798296e766c955750b499915af;p=freebsd.git nfscl_loadattrcache: fix rest of the cases to not call vnode_pager_setsize() under the node mutex. r248567 moved some calls of vnode_pager_setsize() after the node lock is unlocked, do the rest now. Reported and tested by: peterj Sponsored by: The FreeBSD Foundation MFC after: 1 week --- diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 471e029a8b5..63ea4736707 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -511,10 +511,10 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, * zero np->n_attrstamp to indicate that * the attributes are stale. */ - vap->va_size = np->n_size; + nsize = vap->va_size = np->n_size; + setnsize = 1; np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); - vnode_pager_setsize(vp, np->n_size); } else if (np->n_flag & NMODIFIED) { /* * We've modified the file: Use the larger @@ -526,7 +526,8 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } - vnode_pager_setsize(vp, np->n_size); + nsize = np->n_size; + setnsize = 1; } else if (vap->va_size < np->n_size) { /* * When shrinking the size, the call to @@ -538,9 +539,9 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, np->n_flag |= NSIZECHANGED; setnsize = 1; } else { - np->n_size = vap->va_size; + nsize = np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; - vnode_pager_setsize(vp, np->n_size); + setnsize = 1; } } else { np->n_size = vap->va_size;