--- kernel/bsd/sys/vnode.h 2018/04/24 18:26:01 1.1 +++ kernel/bsd/sys/vnode.h 2018/04/24 18:28:37 1.1.1.2 @@ -276,7 +276,8 @@ extern __inline void vhold(vp) struct vnode *vp; { simple_lock(&vp->v_interlock); - vp->v_holdcnt++; + if (++vp->v_holdcnt <= 0) + panic("vhold: v_holdcnt"); simple_unlock(&vp->v_interlock); } #define VREF(vp) vref(vp) /* increase reference */ @@ -284,7 +285,8 @@ extern __inline void vref(vp) struct vnode *vp; { simple_lock(&vp->v_interlock); - vp->v_usecount++; + if (++vp->v_usecount <= 0) + panic("vref: v_usecount"); simple_unlock(&vp->v_interlock); } #endif /* DIAGNOSTIC */