From owner-svn-src-head@FreeBSD.ORG Sat May 30 22:11:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BB21106566C; Sat, 30 May 2009 22:11:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3CD38FC0C; Sat, 30 May 2009 22:11:12 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4UMBCEK020911; Sat, 30 May 2009 22:11:12 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4UMBC7R020910; Sat, 30 May 2009 22:11:12 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200905302211.n4UMBC7R020910@svn.freebsd.org> From: Rick Macklem Date: Sat, 30 May 2009 22:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193125 - head/sys/fs/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2009 22:11:13 -0000 Author: rmacklem Date: Sat May 30 22:11:12 2009 New Revision: 193125 URL: http://svn.freebsd.org/changeset/base/193125 Log: Add a check to v_type == VREG for the recently modified code that does NFSv4 Closes in the experimental client's VOP_INACTIVE(). I also replaced a bunch of ap->a_vp with a local copy of vp, because I thought that made it more readable. Approved by: kib (mentor) Modified: head/sys/fs/nfsclient/nfs_clnode.c Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Sat May 30 22:06:58 2009 (r193124) +++ head/sys/fs/nfsclient/nfs_clnode.c Sat May 30 22:11:12 2009 (r193125) @@ -185,35 +185,35 @@ ncl_inactive(struct vop_inactive_args *a { struct nfsnode *np; struct sillyrename *sp; + struct vnode *vp = ap->a_vp; - np = VTONFS(ap->a_vp); - if (prtactive && vrefcnt(ap->a_vp) != 0) - vprint("ncl_inactive: pushing active", ap->a_vp); + np = VTONFS(vp); + if (prtactive && vrefcnt(vp) != 0) + vprint("ncl_inactive: pushing active", vp); - if (NFS_ISV4(ap->a_vp)) { + if (NFS_ISV4(vp) && vp->v_type == VREG) { /* * Since mmap()'d files do I/O after VOP_CLOSE(), the NFSv4 * Close operations are delayed until now. Any dirty buffers * must be flushed before the close, so that the stateid is * available for the writes. */ - if (nfscl_mustflush(ap->a_vp)) - (void) ncl_flush(ap->a_vp, MNT_WAIT, NULL, ap->a_td, - 1); - (void) nfsrpc_close(ap->a_vp, 1, ap->a_td); + if (nfscl_mustflush(vp)) + (void) ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1); + (void) nfsrpc_close(vp, 1, ap->a_td); } - if (ap->a_vp->v_type != VDIR) { + if (vp->v_type != VDIR) { sp = np->n_sillyrename; np->n_sillyrename = NULL; } else sp = NULL; if (sp) { - (void)ncl_vinvalbuf(ap->a_vp, 0, ap->a_td, 1); + (void) ncl_vinvalbuf(vp, 0, ap->a_td, 1); /* * Remove the silly file that was rename'd earlier */ - ncl_removeit(sp, ap->a_vp); + ncl_removeit(sp, vp); crfree(sp->s_cred); vrele(sp->s_dvp); FREE((caddr_t)sp, M_NEWNFSREQ);