]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nfsd: use a long for the count in nfsd4_state_shrinker_count()
authorJeff Layton <jlayton@kernel.org>
Mon, 3 Mar 2025 17:26:03 +0000 (12:26 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 10 Mar 2025 13:11:12 +0000 (09:11 -0400)
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 <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c

index e51c310bd11152e724b0d374556bea9899fc8428..982045944c3cc316b34f61014dcc175478ed2113 100644 (file)
@@ -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)