Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148283971
D21362.id61146.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
842 B
Referenced Files
None
Subscribers
None
D21362.id61146.diff
View Options
Index: head/sys/kern/kern_mutex.c
===================================================================
--- head/sys/kern/kern_mutex.c
+++ head/sys/kern/kern_mutex.c
@@ -176,6 +176,21 @@
assert_mtx(const struct lock_object *lock, int what)
{
+ /*
+ * Treat LA_LOCKED as if LA_XLOCKED was asserted.
+ *
+ * Some callers of lc_assert uses LA_LOCKED to indicate that either
+ * a shared lock or write lock was held, while other callers uses
+ * the more strict LA_XLOCKED (used as MA_OWNED).
+ *
+ * Mutex is the only lock class that can not be shared, as a result,
+ * we can reasonably consider the caller really intends to assert
+ * LA_XLOCKED when they are asserting LA_LOCKED on a mutex object.
+ */
+ if (what & LA_LOCKED) {
+ what &= ~LA_LOCKED;
+ what |= LA_XLOCKED;
+ }
mtx_assert((const struct mtx *)lock, what);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 18, 12:05 AM (1 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29861722
Default Alt Text
D21362.id61146.diff (842 B)
Attached To
Mode
D21362: assert_mtx: treat LA_LOCKED as the same of LA_XLOCKED.
Attached
Detach File
Event Timeline
Log In to Comment