diff options
author | Rick Macklem <rmacklem@FreeBSD.org> | 2013-05-29 00:32:49 +0000 |
---|---|---|
committer | Rick Macklem <rmacklem@FreeBSD.org> | 2013-05-29 00:32:49 +0000 |
commit | 456219935079760ca57c79870450d04f296e8e0f (patch) | |
tree | e91539a346b251d2b5733d96da92eff7683ac9e1 /sys/nfsclient | |
parent | c89ea4d72b559a254ed26f903c34d21ad2db737d (diff) | |
download | src-test2-456219935079760ca57c79870450d04f296e8e0f.tar.gz src-test2-456219935079760ca57c79870450d04f296e8e0f.zip |
Notes
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_subs.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index 7cc41af0b44e..2ab02f088c07 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/nfs_subs.c @@ -463,6 +463,8 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp, struct timespec mtime, mtime_save; int v3 = NFS_ISV3(vp); int error = 0; + u_quad_t nsize; + int setnsize; md = *mdp; t1 = (mtod(md, caddr_t) + md->m_len) - *dposp; @@ -565,6 +567,8 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp, vap->va_filerev = 0; } np->n_attrstamp = time_second; + setnsize = 0; + nsize = 0; if (vap->va_size != np->n_size) { if (vap->va_type == VREG) { if (dontshrink && vap->va_size < np->n_size) { @@ -591,7 +595,8 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp, np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } - vnode_pager_setsize(vp, np->n_size); + setnsize = 1; + nsize = vap->va_size; } else { np->n_size = vap->va_size; } @@ -628,6 +633,8 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp, KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, &np->n_vattr, 0); #endif mtx_unlock(&np->n_mtx); + if (setnsize) + vnode_pager_setsize(vp, nsize); out: #ifdef KDTRACE_HOOKS if (error) |