From owner-svn-src-stable@FreeBSD.ORG Thu Apr 4 05:26:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3B3EE174; Thu, 4 Apr 2013 05:26:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1527D6F0; Thu, 4 Apr 2013 05:26:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r345QMlI024397; Thu, 4 Apr 2013 05:26:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r345QMPB024396; Thu, 4 Apr 2013 05:26:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304040526.r345QMPB024396@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 4 Apr 2013 05:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249078 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2013 05:26:23 -0000 Author: kib Date: Thu Apr 4 05:26:22 2013 New Revision: 249078 URL: http://svnweb.freebsd.org/changeset/base/249078 Log: MFC r248567: Do not call vnode_pager_setsize() while a NFS node mutex is locked. vnode_pager_setsize() might sleep waiting for the page after EOF be unbusied. Call vnode_pager_setsize() both for the regular and directory vnodes. MFC r248581: Initialize the variable to avoid (false) compiler warning about use of an uninitialized local. Modified: stable/9/sys/fs/nfsclient/nfs_clport.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clport.c Thu Apr 4 05:20:52 2013 (r249077) +++ stable/9/sys/fs/nfsclient/nfs_clport.c Thu Apr 4 05:26:22 2013 (r249078) @@ -367,6 +367,8 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsnode *np; struct nfsmount *nmp; struct timespec mtime_save; + u_quad_t nsize; + int setnsize; /* * If v_type == VNON it is a new node, so fill in the v_type, @@ -424,6 +426,8 @@ nfscl_loadattrcache(struct vnode **vpp, } else vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[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) { @@ -450,10 +454,13 @@ nfscl_loadattrcache(struct vnode **vpp, np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } - vnode_pager_setsize(vp, np->n_size); } else { np->n_size = vap->va_size; } + if (vap->va_type == VREG || vap->va_type == VDIR) { + setnsize = 1; + nsize = vap->va_size; + } } /* * The following checks are added to prevent a race between (say) @@ -486,6 +493,8 @@ nfscl_loadattrcache(struct vnode **vpp, KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, 0); #endif NFSUNLOCKNODE(np); + if (setnsize) + vnode_pager_setsize(vp, nsize); return (0); }