From owner-svn-src-all@FreeBSD.ORG Wed Sep 9 20:37:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C09A61065672; Wed, 9 Sep 2009 20:37:49 +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 A7F318FC12; Wed, 9 Sep 2009 20:37:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n89Kbn1M096786; Wed, 9 Sep 2009 20:37:49 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n89Kbnwi096782; Wed, 9 Sep 2009 20:37:49 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200909092037.n89Kbnwi096782@svn.freebsd.org> From: Rick Macklem Date: Wed, 9 Sep 2009 20:37:49 +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: r197048 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2009 20:37:49 -0000 Author: rmacklem Date: Wed Sep 9 20:37:49 2009 New Revision: 197048 URL: http://svn.freebsd.org/changeset/base/197048 Log: Add LK_NOWITNESS to the vn_lock() calls done on newly created nfs vnodes, since these nodes are not linked into the mount queue and, as such, the vn_lock() cannot cause a deadlock so LORs are harmless. Suggested by: kib Approved by: kib (mentor) MFC after: 3 days Modified: head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/nfsclient/nfs_clport.c head/sys/nfsclient/nfs_node.c Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Wed Sep 9 20:28:58 2009 (r197047) +++ head/sys/fs/nfsclient/nfs_clnode.c Wed Sep 9 20:37:49 2009 (r197048) @@ -157,7 +157,7 @@ ncl_nget(struct mount *mntp, u_int8_t *f M_NFSFH, M_WAITOK); bcopy(fhp, np->n_fhp->nfh_fh, fhsize); np->n_fhp->nfh_len = fhsize; - lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); + lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); error = insmntque(vp, mntp); if (error != 0) { *npp = NULL; Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Wed Sep 9 20:28:58 2009 (r197047) +++ head/sys/fs/nfsclient/nfs_clport.c Wed Sep 9 20:37:49 2009 (r197048) @@ -232,7 +232,7 @@ nfscl_nget(struct mount *mntp, struct vn */ VN_LOCK_AREC(vp); VN_LOCK_ASHARE(vp); - lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); + lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); error = insmntque(vp, mntp); if (error != 0) { *npp = NULL; Modified: head/sys/nfsclient/nfs_node.c ============================================================================== --- head/sys/nfsclient/nfs_node.c Wed Sep 9 20:28:58 2009 (r197047) +++ head/sys/nfsclient/nfs_node.c Wed Sep 9 20:37:49 2009 (r197048) @@ -158,7 +158,7 @@ nfs_nget(struct mount *mntp, nfsfh_t *fh np->n_fhp = &np->n_fh; bcopy((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize); np->n_fhsize = fhsize; - lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); + lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); error = insmntque(vp, mntp); if (error != 0) { *npp = NULL;