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:
parent
8a3f2c376a
commit
ec48c16f14
@ -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);
|
||||
|
@ -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)); \
|
||||
|
Loading…
Reference in New Issue
Block a user