svn commit: r285252 - head/sys/kern

Mark Johnston markj at FreeBSD.org
Tue Jul 7 19:29:20 UTC 2015


Author: markj
Date: Tue Jul  7 19:29:18 2015
New Revision: 285252
URL: https://svnweb.freebsd.org/changeset/base/285252

Log:
  Fix an incorrect assertion in witness.
  
  The number of available lock list entries for a thread is LOCK_CHILDCOUNT,
  and each entry can record up to LOCK_NCHILDREN locks. When iterating over
  the locks held by a thread, a bound on the loop index is therefore given
  by LOCK_CHILDCOUNT * LOCK_NCHILDREN; WITNESS_COUNT is an unrelated
  constant.
  
  Reviewed by:	jhb
  MFC after:	1 week
  Sponsored by:	EMC / Isilon Storage Division
  Differential Revision:	https://reviews.freebsd.org/D2974

Modified:
  head/sys/kern/subr_witness.c

Modified: head/sys/kern/subr_witness.c
==============================================================================
--- head/sys/kern/subr_witness.c	Tue Jul  7 19:23:59 2015	(r285251)
+++ head/sys/kern/subr_witness.c	Tue Jul  7 19:29:18 2015	(r285252)
@@ -1221,7 +1221,7 @@ witness_checkorder(struct lock_object *l
 	for (j = 0, lle = lock_list; lle != NULL; lle = lle->ll_next) {
 		for (i = lle->ll_count - 1; i >= 0; i--, j++) {
 
-			MPASS(j < witness_count);
+			MPASS(j < LOCK_CHILDCOUNT * LOCK_NCHILDREN);
 			lock1 = &lle->ll_children[i];
 
 			/*


More information about the svn-src-head mailing list