Date: Fri, 22 Apr 2011 10:28:34 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Rick Macklem <rmacklem@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220921 - head/sys/fs/nfsclient Message-ID: <20110422100947.P1371@besplex.bde.org> In-Reply-To: <201104211238.p3LCcC1T096670@svn.freebsd.org> References: <201104211238.p3LCcC1T096670@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110422100947.P1371>