svn commit: r188243 - in head/sys: kern sys
Edward Tomasz Napierala
trasz at FreeBSD.org
Fri Feb 6 10:16:02 PST 2009
Author: trasz
Date: Fri Feb 6 18:16:01 2009
New Revision: 188243
URL: http://svn.freebsd.org/changeset/base/188243
Log:
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
Modified:
head/sys/kern/vfs_subr.c
head/sys/sys/mount.h
Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c Fri Feb 6 17:21:41 2009 (r188242)
+++ head/sys/kern/vfs_subr.c Fri Feb 6 18:16:01 2009 (r188243)
@@ -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);
Modified: head/sys/sys/mount.h
==============================================================================
--- head/sys/sys/mount.h Fri Feb 6 17:21:41 2009 (r188242)
+++ head/sys/sys/mount.h Fri Feb 6 18:16:01 2009 (r188243)
@@ -206,6 +206,7 @@ void __mnt_vnode_markerfree(str
#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)); \
More information about the svn-src-head
mailing list