Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157875931
D49313.id152177.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D49313.id152177.diff
View Options
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -288,7 +288,7 @@
curthread, m->lock_object.lo_name, file, line));
KASSERT(m->mtx_lock != MTX_DESTROYED,
("mtx_lock() of destroyed mutex @ %s:%d", file, line));
- KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_sleep,
+ KASSERT(LOCK_CLASS(&m->lock_object) != &lock_class_mtx_spin,
("mtx_lock() of spin mutex %s @ %s:%d", m->lock_object.lo_name,
file, line));
WITNESS_CHECKORDER(&m->lock_object, (opts & ~MTX_RECURSE) |
@@ -317,7 +317,7 @@
KASSERT(m->mtx_lock != MTX_DESTROYED,
("mtx_unlock() of destroyed mutex @ %s:%d", file, line));
- KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_sleep,
+ KASSERT(LOCK_CLASS(&m->lock_object) != &lock_class_mtx_spin,
("mtx_unlock() of spin mutex %s @ %s:%d", m->lock_object.lo_name,
file, line));
WITNESS_UNLOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line);
@@ -346,7 +346,7 @@
KASSERT(m->mtx_lock != MTX_DESTROYED,
("mtx_lock_spin() of destroyed mutex @ %s:%d", file, line));
- KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin,
+ KASSERT(LOCK_CLASS(&m->lock_object) != &lock_class_mtx_sleep,
("mtx_lock_spin() of sleep mutex %s @ %s:%d",
m->lock_object.lo_name, file, line));
if (mtx_owned(m))
@@ -387,7 +387,7 @@
KASSERT(m->mtx_lock != MTX_DESTROYED,
("mtx_trylock_spin() of destroyed mutex @ %s:%d", file, line));
- KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin,
+ KASSERT(LOCK_CLASS(&m->lock_object) != &lock_class_mtx_sleep,
("mtx_trylock_spin() of sleep mutex %s @ %s:%d",
m->lock_object.lo_name, file, line));
KASSERT((opts & MTX_RECURSE) == 0,
@@ -412,7 +412,7 @@
KASSERT(m->mtx_lock != MTX_DESTROYED,
("mtx_unlock_spin() of destroyed mutex @ %s:%d", file, line));
- KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin,
+ KASSERT(LOCK_CLASS(&m->lock_object) != &lock_class_mtx_sleep,
("mtx_unlock_spin() of sleep mutex %s @ %s:%d",
m->lock_object.lo_name, file, line));
WITNESS_UNLOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line);
@@ -450,7 +450,7 @@
curthread, m->lock_object.lo_name, file, line));
KASSERT(m->mtx_lock != MTX_DESTROYED,
("mtx_trylock() of destroyed mutex @ %s:%d", file, line));
- KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_sleep,
+ KASSERT(LOCK_CLASS(&m->lock_object) != &lock_class_mtx_spin,
("mtx_trylock() of spin mutex %s @ %s:%d", m->lock_object.lo_name,
file, line));
@@ -827,7 +827,7 @@
KASSERT(m->mtx_lock != MTX_DESTROYED,
("thread_lock() of destroyed mutex @ %s:%d", file, line));
- KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin,
+ KASSERT(LOCK_CLASS(&m->lock_object) != &lock_class_mtx_sleep,
("thread_lock() of sleep mutex %s @ %s:%d",
m->lock_object.lo_name, file, line));
KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) == 0,
@@ -1286,7 +1286,7 @@
KASSERT(m->mtx_lock != MTX_DESTROYED,
("%s() of destroyed mutex %p", __func__, m));
- KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin,
+ KASSERT(LOCK_CLASS(&m->lock_object) != &lock_class_mtx_sleep,
("%s() of sleep mutex %p (%s)", __func__, m,
m->lock_object.lo_name));
KASSERT(!mtx_owned(m), ("%s() waiting on myself on lock %p (%s)", __func__, m,
@@ -1312,8 +1312,8 @@
KASSERT(m->mtx_lock != MTX_DESTROYED,
("%s() of destroyed mutex %p", __func__, m));
- KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_sleep,
- ("%s() not a sleep mutex %p (%s)", __func__, m,
+ KASSERT(LOCK_CLASS(&m->lock_object) != &lock_class_mtx_spin,
+ ("%s() of spin mutex %p (%s)", __func__, m,
m->lock_object.lo_name));
KASSERT(!mtx_owned(m), ("%s() waiting on myself on lock %p (%s)", __func__, m,
m->lock_object.lo_name));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 27, 2:02 AM (20 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33543917
Default Alt Text
D49313.id152177.diff (3 KB)
Attached To
Mode
D49313: mtx: Avoid nested panics on lock class mismatch assertions
Attached
Detach File
Event Timeline
Log In to Comment