Fix up various vnode-related asserts which did not dump the used vnode

This commit is contained in:
Mateusz Guzik 2020-02-03 14:25:32 +00:00
parent 7877018c2c
commit f1fa1ba3d0
5 changed files with 6 additions and 10 deletions

View File

@ -479,8 +479,7 @@ devfs_allocv(struct devfs_dirent *de, struct mount *mp, int lockmode,
dev_refl(dev);
/* XXX: v_rdev should be protect by vnode lock */
vp->v_rdev = dev;
KASSERT(vp->v_usecount == 1,
("%s %d (%d)\n", __func__, __LINE__, vp->v_usecount));
VNPASS(vp->v_usecount == 1, vp);
dev->si_usecount++;
/* Special casing of ttys for deadfs. Probably redundant. */
dsw = dev->si_devsw;

View File

@ -209,7 +209,7 @@ null_nodeget(mp, lowervp, vpp)
int error;
ASSERT_VOP_LOCKED(lowervp, "lowervp");
KASSERT(lowervp->v_usecount >= 1, ("Unreferenced vnode %p", lowervp));
VNPASS(lowervp->v_usecount > 0, lowervp);
/* Lookup the hash firstly. */
*vpp = null_hashget(mp, lowervp);

View File

@ -2859,10 +2859,8 @@ vfs_vmio_iodone(struct buf *bp)
REFCOUNT_COUNT(obj->paging_in_progress), bp->b_npages));
vp = bp->b_vp;
KASSERT(vp->v_holdcnt > 0,
("vfs_vmio_iodone: vnode %p has zero hold count", vp));
KASSERT(vp->v_object != NULL,
("vfs_vmio_iodone: vnode %p has no vm_object", vp));
VNPASS(vp->v_holdcnt > 0, vp);
VNPASS(vp->v_object != NULL, vp);
foff = bp->b_offset;
KASSERT(bp->b_offset != NOOFFSET,

View File

@ -441,8 +441,7 @@ ffs_lock(ap)
flags = ap->a_flags;
for (;;) {
#ifdef DEBUG_VFS_LOCKS
KASSERT(vp->v_holdcnt != 0,
("ffs_lock %p: zero hold count", vp));
VNPASS(vp->v_holdcnt != 0, vp);
#endif
lkp = vp->v_vnlock;
result = _lockmgr_args(lkp, flags, VI_MTX(vp),

View File

@ -248,7 +248,7 @@ vnode_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
vp = (struct vnode *)handle;
ASSERT_VOP_LOCKED(vp, "vnode_pager_alloc");
KASSERT(vp->v_usecount != 0, ("vnode_pager_alloc: no vnode reference"));
VNPASS(vp->v_usecount > 0, vp);
retry:
object = vp->v_object;