From: Jeff Layton Date: Mon, 3 Mar 2025 17:26:03 +0000 (-0500) Subject: nfsd: use a long for the count in nfsd4_state_shrinker_count() X-Git-Tag: v6.15-rc1~88^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=261e3bbf9747e9c7c87b3bce519df94754e24ed8;p=thirdparty%2Fkernel%2Flinux.git 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 --- 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)