diff options
author | alfred <alfred@FreeBSD.org> | 2001-04-13 10:15:53 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2001-04-13 10:15:53 +0000 |
commit | f5211e7a6c6c20149339edd643f4dd90fc874cd0 (patch) | |
tree | abc0cba411764fff7ff7978af6851721a827bd44 /sys/kern | |
parent | 3709643556622297c2380ed18c0949585c16f360 (diff) | |
download | FreeBSD-src-f5211e7a6c6c20149339edd643f4dd90fc874cd0.zip FreeBSD-src-f5211e7a6c6c20149339edd643f4dd90fc874cd0.tar.gz |
convert if/panic -> KASSERT, explain what triggered the assertion
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_lock.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index c92dabf..92e8b05 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -278,8 +278,10 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line) /* fall into downgrade */ case LK_DOWNGRADE: - if (lkp->lk_lockholder != pid || lkp->lk_exclusivecount == 0) - panic("lockmgr: not holding exclusive lock"); + KASSERT(lkp->lk_lockholder == pid && lkp->lk_exclusivecount != 0, + ("lockmgr: not holding exclusive lock " + "(owner pid (%d) != pid (%d), exlcnt (%d) != 0", + lkp->lk_lockholder, pid, lkp->lk_exclusivecount)); sharelock(lkp, lkp->lk_exclusivecount); lkp->lk_exclusivecount = 0; lkp->lk_flags &= ~LK_HAVE_EXCL; |