summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_witness.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-02-28 19:10:43 +0000
committerthompsa <thompsa@FreeBSD.org>2009-02-28 19:10:43 +0000
commit4eafa084fe4aba2a485ea0c0d8e047b253977e9d (patch)
treed4fd9801f03e85271b325fb5f8aae7d73e4307d7 /sys/kern/subr_witness.c
parent15bfb6156fe8bf9b5eade101c94b894323039d20 (diff)
downloadFreeBSD-src-4eafa084fe4aba2a485ea0c0d8e047b253977e9d.zip
FreeBSD-src-4eafa084fe4aba2a485ea0c0d8e047b253977e9d.tar.gz
Move the NORELEASE check to after the recurse count decrement and bailout, this
is not counted as actually releasing the lock.
Diffstat (limited to 'sys/kern/subr_witness.c')
-rw-r--r--sys/kern/subr_witness.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index 3fba3fb..c7a5b9d 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -1511,12 +1511,6 @@ found:
instance->li_line);
panic("share->uexcl");
}
- if ((instance->li_flags & LI_NORELEASE) != 0 && witness_watch > 0) {
- printf("forbidden unlock of (%s) %s @ %s:%d\n", class->lc_name,
- lock->lo_name, file, line);
- panic("lock marked norelease");
- }
-
/* If we are recursed, unrecurse. */
if ((instance->li_flags & LI_RECURSEMASK) > 0) {
CTR4(KTR_WITNESS, "%s: pid %d unrecursed on %s r=%d", __func__,
@@ -1525,6 +1519,12 @@ found:
instance->li_flags--;
return;
}
+ /* The lock is now being dropped, check for NORELEASE flag */
+ if ((instance->li_flags & LI_NORELEASE) != 0 && witness_watch > 0) {
+ printf("forbidden unlock of (%s) %s @ %s:%d\n", class->lc_name,
+ lock->lo_name, file, line);
+ panic("lock marked norelease");
+ }
/* Otherwise, remove this item from the list. */
s = intr_disable();
OpenPOWER on IntegriCloud