svn commit: r321896 - head/sys/kern
Mark Johnston
markj at FreeBSD.org
Tue Aug 1 23:14:39 UTC 2017
Author: markj
Date: Tue Aug 1 23:14:38 2017
New Revision: 321896
URL: https://svnweb.freebsd.org/changeset/base/321896
Log:
Amend r321884 to check the refcount and update the class with w_mtx held.
Reviewed by: jhb
X-MFC with: r321884
Modified:
head/sys/kern/subr_witness.c
Modified: head/sys/kern/subr_witness.c
==============================================================================
--- head/sys/kern/subr_witness.c Tue Aug 1 21:41:14 2017 (r321895)
+++ head/sys/kern/subr_witness.c Tue Aug 1 23:14:38 2017 (r321896)
@@ -1849,10 +1849,10 @@ enroll(const char *description, struct lock_class *loc
return (w);
found:
w->w_refcount++;
- mtx_unlock_spin(&w_mtx);
if (w->w_refcount == 1)
w->w_class = lock_class;
- else if (lock_class != w->w_class)
+ mtx_unlock_spin(&w_mtx);
+ if (lock_class != w->w_class)
kassert_panic(
"lock (%s) %s does not match earlier (%s) lock",
description, lock_class->lc_name,
More information about the svn-src-head
mailing list