summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2025-03-03 12:26:03 -0500
committerChuck Lever <chuck.lever@oracle.com>2025-03-10 09:11:12 -0400
commit261e3bbf9747e9c7c87b3bce519df94754e24ed8 (patch)
treee9787ef918d8f64ba7aaa97fccce5e4ec0fed568
parent387625808c45ccd46350440436f4a2f5cec4d04a (diff)
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 <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
-rw-r--r--fs/nfsd/nfs4state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index e51c310bd111..982045944c3c 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)