git: 8bd26421b6b5 - stable/12 - callout: fix using shared rmlocks
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 27 Apr 2022 12:50:28 UTC
The branch stable/12 has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=8bd26421b6b501d49581a687513a7ba8a46b3a80
commit 8bd26421b6b501d49581a687513a7ba8a46b3a80
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2022-04-19 15:01:25 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-04-27 06:48:58 +0000
callout: fix using shared rmlocks
15b1eb142c changed the callout code to store the CALLOUT_SHAREDLOCK flag
in c_iflags (where it used to be c_flags), but failed to update the
check in softclock_call_cc(). This resulted in the callout code always
taking the write lock, even if a read lock had been requested (with
the CALLOUT_SHAREDLOCK flag in callout_init_rm()).
Reviewed by: markj
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D34959
(cherry picked from commit a879e40ca2a9e95b3e3dc4810127d3cf105ec0d3)
---
sys/kern/kern_timeout.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index 3980b5d8b980..738604f37494 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -673,7 +673,7 @@ softclock_call_cc(struct callout *c, struct callout_cpu *cc,
("softclock_call_cc: act %p %x", c, c->c_flags));
class = (c->c_lock != NULL) ? LOCK_CLASS(c->c_lock) : NULL;
lock_status = 0;
- if (c->c_flags & CALLOUT_SHAREDLOCK) {
+ if (c->c_iflags & CALLOUT_SHAREDLOCK) {
if (class == &lock_class_rm)
lock_status = (uintptr_t)&tracker;
else