Add KASSERTs to make it easier to debug problems like the one fixed

in r188141.

Reviewed by:	kib,attilio
Approved by:	rwatson (mentor)
Tested by:	pho
Sponsored by:	FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2009-02-06 18:16:01 +00:00
parent 8a3f2c376a
commit ec48c16f14
2 changed files with 2 additions and 0 deletions

View File

@ -381,6 +381,7 @@ vfs_unbusy(struct mount *mp)
CTR2(KTR_VFS, "%s: mp %p", __func__, mp);
MNT_ILOCK(mp);
MNT_REL(mp);
KASSERT(mp->mnt_lockref > 0, ("negative mnt_lockref"));
mp->mnt_lockref--;
if (mp->mnt_lockref == 0 && (mp->mnt_kern_flag & MNTK_DRAINING) != 0) {
MPASS(mp->mnt_kern_flag & MNTK_UNMOUNT);

View File

@ -206,6 +206,7 @@ void __mnt_vnode_markerfree(struct vnode **mvp, struct mount *mp);
#define MNT_MTX(mp) (&(mp)->mnt_mtx)
#define MNT_REF(mp) (mp)->mnt_ref++
#define MNT_REL(mp) do { \
KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref")); \
(mp)->mnt_ref--; \
if ((mp)->mnt_ref == 0) \
wakeup((mp)); \