--- kernel/bsd/vfs/vfs_subr.c 2018/04/24 18:26:06 1.1.1.1 +++ kernel/bsd/vfs/vfs_subr.c 2018/04/24 18:31:24 1.1.1.2 @@ -872,7 +872,8 @@ vget(vp, flags, p) freevnodes--; simple_unlock(&vnode_free_list_slock); } - vp->v_usecount++; + if (++vp->v_usecount <= 0) + panic("vget: v_usecount"); if (flags & LK_TYPE_MASK) { if (error = vn_lock(vp, flags | LK_INTERLOCK, p)) vrele(vp); @@ -992,11 +993,11 @@ void vref(vp) struct vnode *vp; { - simple_lock(&vp->v_interlock); if (vp->v_usecount <= 0) panic("vref used where vget required"); - vp->v_usecount++; + if (++vp->v_usecount <= 0) + panic("vref v_usecount"); simple_unlock(&vp->v_interlock); } @@ -1009,7 +1010,7 @@ vput(vp) { struct proc *p = current_proc(); /* XXX */ -#if DIGANOSTIC +#if DIAGNOSTIC if (vp == NULL) panic("vput: null vp"); #endif @@ -1227,7 +1228,8 @@ vclean(vp, flags, p) * race against ourselves to recycle it. */ if (active = vp->v_usecount) - vp->v_usecount++; + if (++vp->v_usecount <= 0) + panic("vclean: v_usecount"); /* * Prevent the vnode from being recycled or * brought into use while we clean it out.