From owner-svn-src-head@FreeBSD.ORG Fri Apr 22 00:28:38 2011 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 961B1106564A; Fri, 22 Apr 2011 00:28:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 1680F8FC0A; Fri, 22 Apr 2011 00:28:37 +0000 (UTC) Received: from c122-106-155-58.carlnfd1.nsw.optusnet.com.au (c122-106-155-58.carlnfd1.nsw.optusnet.com.au [122.106.155.58]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p3M0SYCR011854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 22 Apr 2011 10:28:36 +1000 Date: Fri, 22 Apr 2011 10:28:34 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem In-Reply-To: <201104211238.p3LCcC1T096670@svn.freebsd.org> Message-ID: <20110422100947.P1371@besplex.bde.org> References: <201104211238.p3LCcC1T096670@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220921 - 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: Fri, 22 Apr 2011 00:28:38 -0000 On Thu, 21 Apr 2011, Rick Macklem wrote: > Log: > Revert r220906, since the vp isn't always locked when > nfscl_request() is called. It will need a more involved > patch. > > Modified: > head/sys/fs/nfsclient/nfs_clport.c > > Modified: head/sys/fs/nfsclient/nfs_clport.c > ============================================================================== > --- head/sys/fs/nfsclient/nfs_clport.c Thu Apr 21 11:44:16 2011 (r220920) > +++ head/sys/fs/nfsclient/nfs_clport.c Thu Apr 21 12:38:12 2011 (r220921) > @@ -819,8 +819,6 @@ nfscl_request(struct nfsrv_descript *nd, > int ret, vers; > struct nfsmount *nmp; > > - if ((vp->v_iflag & VI_DOOMED) != 0) > - return (EPERM); > nmp = VFSTONFS(vp->v_mount); > if (nd->nd_flag & ND_NFSV4) > vers = NFS_VER4; I was going to say that it obviously needs to be locked anyway since it is used for other things (vp->v_mount), and that assertions that it is locked (as suggested by kib@) would be ugly bloat (except for debugging) since any use of it obviously implies that it is locked. However, v_mount is special. It only needs the "u" lock. "u" means that only a reference is needed. However, complete assertions for this would be even uglier. To be complete, you would have a "u" assertion that the reference is held as well as an "i" assertion for v_iflag, with appropriate exclusiveness corresponding to which flags are accessed and/or acted on, plus more assertions for other fields in vp. Altogether there are about 10 different locks for vp fields. A function that accesses vnodes could easily need assertions for all of these to be complete. Bruce