Date: Fri, 6 Feb 2009 18:16:01 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r188243 - in head/sys: kern sys Message-ID: <200902061816.n16IG1u2068210@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)); \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902061816.n16IG1u2068210>