svn commit: r313909 - head/sys/kern

Bryan Drewery bdrewery at FreeBSD.org
Tue Feb 21 17:00:37 UTC 2017


On 2/17/2017 9:07 PM, Bryan Drewery wrote:
> Author: bdrewery
> Date: Sat Feb 18 05:07:53 2017
> New Revision: 313909
> URL: https://svnweb.freebsd.org/changeset/base/313909
> 
> Log:
>   Fix panic with unlocked vnode to vrecycle().
>   
>   MFC after:	2 weeks
> 
> Modified:
>   head/sys/kern/uipc_mqueue.c
> 
> Modified: head/sys/kern/uipc_mqueue.c
> ==============================================================================
> --- head/sys/kern/uipc_mqueue.c	Sat Feb 18 01:52:10 2017	(r313908)
> +++ head/sys/kern/uipc_mqueue.c	Sat Feb 18 05:07:53 2017	(r313909)
> @@ -714,7 +714,9 @@ do_recycle(void *context, int pending __
>  {
>  	struct vnode *vp = (struct vnode *)context;
>  
> +	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
>  	vrecycle(vp);
> +	VOP_UNLOCK(vp, 0);
>  	vdrop(vp);
>  }
>  
> 

Just looking at this, it seemed questionable and most likely bitrotted.
I added the lock to avoid an assertion to unblock me and allow the
module to be used by others with INVARIANTS.  Most of the vnode handling
here is from the initial commit, long before a lot of refactoring around
vnode lifecycle management.  It does appear to need someone more
familiar with vnode handling to go through and clean it up.


-- 
Regards,
Bryan Drewery

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20170221/f2d8e1ce/attachment.sig>


More information about the svn-src-all mailing list