git: 7dc9b36d44b0 - stable/13 - callout: fix using shared rmlocks

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Wed, 27 Apr 2022 12:50:27 UTC
The branch stable/13 has been updated by kp:

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

commit 7dc9b36d44b0bf5e9fc3edace6f769d0d61c3c0e
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:46:43 +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 98880524667e..85f342cdeb3b 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -635,7 +635,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