svn commit: r274478 - head/sys/kern

Konstantin Belousov kib at FreeBSD.org
Thu Nov 13 18:51:10 UTC 2014


Author: kib
Date: Thu Nov 13 18:51:09 2014
New Revision: 274478
URL: https://svnweb.freebsd.org/changeset/base/274478

Log:
  Fix assertion, &uc->uc_busy is never zero, the intent is to test the
  uc_busy value, and not its address [1].
  
  Remove the single use of the macro, write KASSERT() explicitely in the
  code of umtxq_sleep_pi().
  
  Submitted by:	Eric van Gyzen <eric at vangyzen.net> [1]
  MFC after:	1 week

Modified:
  head/sys/kern/kern_umtx.c

Modified: head/sys/kern/kern_umtx.c
==============================================================================
--- head/sys/kern/kern_umtx.c	Thu Nov 13 18:15:05 2014	(r274477)
+++ head/sys/kern/kern_umtx.c	Thu Nov 13 18:51:09 2014	(r274478)
@@ -169,7 +169,6 @@ struct umtxq_chain {
 };
 
 #define	UMTXQ_LOCKED_ASSERT(uc)		mtx_assert(&(uc)->uc_lock, MA_OWNED)
-#define	UMTXQ_BUSY_ASSERT(uc)	KASSERT(&(uc)->uc_busy, ("umtx chain is not busy"))
 
 /*
  * Don't propagate time-sharing priority, there is a security reason,
@@ -1478,7 +1477,7 @@ umtxq_sleep_pi(struct umtx_q *uq, struct
 	KASSERT(td == curthread, ("inconsistent uq_thread"));
 	uc = umtxq_getchain(&uq->uq_key);
 	UMTXQ_LOCKED_ASSERT(uc);
-	UMTXQ_BUSY_ASSERT(uc);
+	KASSERT(uc->uc_busy != 0, ("umtx chain is not busy"));
 	umtxq_insert(uq);
 	mtx_lock_spin(&umtx_lock);
 	if (pi->pi_owner == NULL) {


More information about the svn-src-all mailing list