Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Apr 2022 11:18:12 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a879e40ca2a9 - main - callout: fix using shared rmlocks
Message-ID:  <202204201118.23KBICo0055878@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=a879e40ca2a9e95b3e3dc4810127d3cf105ec0d3

commit a879e40ca2a9e95b3e3dc4810127d3cf105ec0d3
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2022-04-19 15:01:25 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-04-20 11:06:50 +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
---
 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 839c6d84a9ec..db4217114c35 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -666,7 +666,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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202204201118.23KBICo0055878>