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

Kostik Belousov kostikbel at gmail.com
Thu Apr 21 10:33:06 UTC 2011


On Wed, Apr 20, 2011 at 11:25:18PM +0000, Rick Macklem wrote:
> Author: rmacklem
> Date: Wed Apr 20 23:25:18 2011
> New Revision: 220906
> URL: http://svn.freebsd.org/changeset/base/220906
> 
> Log:
>   Add a check for VI_DOOMED at the beginning of nfscl_request()
>   so that it won't try and use vp->v_mount to do an RPC during
>   a forced dismount. There needs to be at least one more kernel
>   commit, plus a change to the umount(8) command before forced
>   dismounts will work for the experimental NFS client.
>   
>   MFC after:	2 weeks
> 
> Modified:
>   head/sys/fs/nfsclient/nfs_clport.c
> 
> Modified: head/sys/fs/nfsclient/nfs_clport.c
> ==============================================================================
> --- head/sys/fs/nfsclient/nfs_clport.c	Wed Apr 20 23:20:00 2011	(r220905)
> +++ head/sys/fs/nfsclient/nfs_clport.c	Wed Apr 20 23:25:18 2011	(r220906)
> @@ -819,6 +819,8 @@ 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;

Is vnode lock held at this point ? If yes, I suggest to add
ASSERT_VOP_{E,}LOCKED() assertion both to enforce the invariant, and
to document the state to readers of the code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20110421/8b1b21e1/attachment.pgp


More information about the svn-src-head mailing list