From owner-svn-src-stable@FreeBSD.ORG Sat Apr 30 01:16:20 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 952CB106566B; Sat, 30 Apr 2011 01:16:20 +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 4A8278FC08; Sat, 30 Apr 2011 01:16:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3U1GKku023399; Sat, 30 Apr 2011 01:16:20 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3U1GKM3023397; Sat, 30 Apr 2011 01:16:20 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104300116.p3U1GKM3023397@svn.freebsd.org> From: Rick Macklem Date: Sat, 30 Apr 2011 01:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221237 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 30 Apr 2011 01:16:20 -0000 Author: rmacklem Date: Sat Apr 30 01:16:19 2011 New Revision: 221237 URL: http://svn.freebsd.org/changeset/base/221237 Log: MFC: r220731 Add mutex locking on the nfs node in ncl_inactive() for the experimental NFS client. Modified: stable/8/sys/fs/nfsclient/nfs_clnode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clnode.c Sat Apr 30 00:44:17 2011 (r221236) +++ stable/8/sys/fs/nfsclient/nfs_clnode.c Sat Apr 30 01:16:19 2011 (r221237) @@ -202,12 +202,14 @@ ncl_inactive(struct vop_inactive_args *a (void) nfsrpc_close(vp, 1, ap->a_td); } + mtx_lock(&np->n_mtx); if (vp->v_type != VDIR) { sp = np->n_sillyrename; np->n_sillyrename = NULL; } else sp = NULL; if (sp) { + mtx_unlock(&np->n_mtx); (void) ncl_vinvalbuf(vp, 0, ap->a_td, 1); /* * Remove the silly file that was rename'd earlier @@ -216,8 +218,10 @@ ncl_inactive(struct vop_inactive_args *a crfree(sp->s_cred); vrele(sp->s_dvp); FREE((caddr_t)sp, M_NEWNFSREQ); + mtx_lock(&np->n_mtx); } np->n_flag &= NMODIFIED; + mtx_unlock(&np->n_mtx); return (0); }