aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_lock.c
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>1999-09-27 00:21:43 +0000
committerMatthew Dillon <dillon@FreeBSD.org>1999-09-27 00:21:43 +0000
commite701df7d617afae62e7cc66f7e1b6a0a287a0fe5 (patch)
tree5f9be58db7ca5539f5995244cd0ae4736cc63821 /sys/kern/kern_lock.c
parent74427f90f29ab1ab321166eb3ffcb490bf6ca3a3 (diff)
downloadsrc-e701df7d617afae62e7cc66f7e1b6a0a287a0fe5.tar.gz
src-e701df7d617afae62e7cc66f7e1b6a0a287a0fe5.zip
Fix process p_locks accounting. Conversions of the owner to LK_KERNPROC
caused p_locks to be improperly accounted. Submitted by: Tor.Egge@fast.no
Notes
Notes: svn path=/head/; revision=51702
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r--sys/kern/kern_lock.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index 2b2dfeb13c77..2b4cef15a3cc 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -387,12 +387,15 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line)
if (lkp->lk_exclusivecount != 0) {
#if !defined(MAX_PERF)
if (lkp->lk_lockholder != pid &&
- lkp->lk_lockholder != LK_KERNPROC)
+ lkp->lk_lockholder != LK_KERNPROC) {
panic("lockmgr: pid %d, not %s %d unlocking",
pid, "exclusive lock holder",
lkp->lk_lockholder);
+ }
#endif
- COUNT(p, -1);
+ if (lkp->lk_lockholder != LK_KERNPROC) {
+ COUNT(p, -1);
+ }
if (lkp->lk_exclusivecount == 1) {
lkp->lk_flags &= ~LK_HAVE_EXCL;
lkp->lk_lockholder = LK_NOPROC;