From 261e3bbf9747e9c7c87b3bce519df94754e24ed8 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Mon, 3 Mar 2025 12:26:03 -0500 Subject: [PATCH] nfsd: use a long for the count in nfsd4_state_shrinker_count() If there are no courtesy clients then the return value from the atomic_long_read() could overflow an int. Use a long to store the value instead. Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever --- fs/nfsd/nfs4state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index e51c310bd1115..982045944c3cc 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4815,8 +4815,8 @@ out: static unsigned long nfsd4_state_shrinker_count(struct shrinker *shrink, struct shrink_control *sc) { - int count; struct nfsd_net *nn = shrink->private_data; + long count; count = atomic_read(&nn->nfsd_courtesy_clients); if (!count) -- 2.39.5