Date: Fri, 14 Jun 2013 00:02:29 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251719 - stable/8/sys/nfsclient Message-ID: <201306140002.r5E02Tu1070466@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Fri Jun 14 00:02:29 2013 New Revision: 251719 URL: http://svnweb.freebsd.org/changeset/base/251719 Log: MFC: r251089 Add a patch analygous to r248567, r248581, r251079 to the old NFS client to avoid the panic reported in the PR by doing the vnode_pager_setsize() call after unlocking the mutex. Modified: stable/8/sys/nfsclient/nfs_subs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/nfsclient/ (props changed) Modified: stable/8/sys/nfsclient/nfs_subs.c ============================================================================== --- stable/8/sys/nfsclient/nfs_subs.c Thu Jun 13 22:30:24 2013 (r251718) +++ stable/8/sys/nfsclient/nfs_subs.c Fri Jun 14 00:02:29 2013 (r251719) @@ -478,6 +478,8 @@ nfs_loadattrcache(struct vnode **vpp, st 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; @@ -580,6 +582,8 @@ nfs_loadattrcache(struct vnode **vpp, st 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) { @@ -606,7 +610,8 @@ nfs_loadattrcache(struct vnode **vpp, st 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; } @@ -643,6 +648,8 @@ nfs_loadattrcache(struct vnode **vpp, st 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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306140002.r5E02Tu1070466>