From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <chuck.lever@oracle.com>, Neil Brown <neilb@suse.de>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Jeff Layton <jlayton@kernel.org>
Subject: [PATCH 5/5] nfsd: use a long for the count in nfsd4_state_shrinker_count()
Date: Mon, 03 Mar 2025 12:26:03 -0500 [thread overview]
Message-ID: <20250303-nfsd-cleanup-v1-5-14068e8f59c5@kernel.org> (raw)
In-Reply-To: <20250303-nfsd-cleanup-v1-0-14068e8f59c5@kernel.org>
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>
---
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 1f3e9d42fcd784ea8d101ad3549702a30dfe9058..aa0afd1b19a254686ef1f15f5f11db1c79d69096 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4819,7 +4819,7 @@ nfsd4_init_slabs(void)
static unsigned long
nfsd4_state_shrinker_count(struct shrinker *shrink, struct shrink_control *sc)
{
- int count;
+ long count;
struct nfsd_net *nn = shrink->private_data;
count = atomic_read(&nn->nfsd_courtesy_clients);
--
2.48.1
next prev parent reply other threads:[~2025-03-03 17:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 17:25 [PATCH 0/5] nfsd: some small cleanup patches Jeff Layton
2025-03-03 17:25 ` [PATCH 1/5] nfsd: reorganize struct nfs4_delegation for better packing Jeff Layton
2025-03-03 17:26 ` [PATCH 2/5] nfsd: remove unneeded forward declaration of nfsd4_mark_cb_fault() Jeff Layton
2025-03-03 17:26 ` [PATCH 3/5] nfsd: remove obsolete comment from nfs4_alloc_stid Jeff Layton
2025-03-03 17:26 ` [PATCH 4/5] nfsd: clean up if statement in nfsd4_close_open_stateid() Jeff Layton
2025-03-04 15:24 ` Jeff Layton
2025-03-04 15:29 ` Chuck Lever
2025-03-03 17:26 ` Jeff Layton [this message]
2025-03-03 21:41 ` [PATCH 0/5] nfsd: some small cleanup patches cel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250303-nfsd-cleanup-v1-5-14068e8f59c5@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=chuck.lever@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox