svn commit: r220921 - head/sys/fs/nfsclient

Bruce Evans brde at optusnet.com.au
Fri Apr 22 00:28:38 UTC 2011


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


More information about the svn-src-all mailing list