From fca3395674d41fded108e493c6b5695bb6dcd077 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Sat, 29 Mar 2025 15:09:15 -0700 Subject: [PATCH] cred: fix struct credbatch to use long for refcount This structure collects count from multiple cred structures. Of course it can't use a smaller type. PR: 283747 Reviewed by: olce, mjg, markj Differential Revision: https://reviews.freebsd.org/D49562 Fixes: 37337709d3334f32650ba3a7c529fa013ed5e1f2 (cherry picked from commit cd46e980134f6fc765b28ee9c8bf41e8fc1b0261) --- sys/kern/kern_prot.c | 2 +- sys/sys/ucred.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 31652a338e8..d0f4c8cd699 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2365,7 +2365,7 @@ crunuse(struct thread *td) } static void -crunusebatch(struct ucred *cr, int users, int ref) +crunusebatch(struct ucred *cr, u_int users, long ref) { KASSERT(users > 0, ("%s: passed users %d not > 0 ; cred %p", diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index be7d5bab1d1..f43e3bb1241 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -195,8 +195,8 @@ struct proc; struct credbatch { struct ucred *cred; - int users; - int ref; + u_int users; + long ref; }; static inline void