Skip to content

Commit

Permalink
nfsd: use a long for the count in nfsd4_state_shrinker_count()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Layton authored and Chuck Lever committed Mar 10, 2025
1 parent 3876258 commit 261e3bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -4815,8 +4815,8 @@ nfsd4_init_slabs(void)
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)
Expand Down

0 comments on commit 261e3bb

Please sign in to comment.