aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2024-10-28 09:04:43 +1100
committerChuck Lever <chuck.lever@oracle.com>2024-11-18 20:23:08 -0500
commit6a404f475f65c3b74799f4652dc15753834b3be0 (patch)
treea11f7fc4197aaa2e080afa7a477d52895e5d73a4
parentnfsd: Don't fail OP_SETCLIENTID when there are too many clients. (diff)
downloadwireguard-linux-6a404f475f65c3b74799f4652dc15753834b3be0.tar.xz
wireguard-linux-6a404f475f65c3b74799f4652dc15753834b3be0.zip
nfsd: make use of warning provided by refcount_t
refcount_t, by design, checks for unwanted situations and provides warnings. It is rarely useful to have explicit warnings with refcount usage. In this case we have an explicit warning if a refcount_t reaches zero when decremented. Simply using refcount_dec() will provide a similar warning and also mark the refcount_t as saturated to avoid any possible use-after-free. This patch drops the warning and uses refcount_dec() instead of refcount_dec_and_test(). Signed-off-by: NeilBrown <neilb@suse.de> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to '')
-rw-r--r--fs/nfsd/filecache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index 1408166222c5..c16671135d17 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -1050,7 +1050,7 @@ retry:
* the last one however, since we should hold another.
*/
if (nfsd_file_lru_remove(nf))
- WARN_ON_ONCE(refcount_dec_and_test(&nf->nf_ref));
+ refcount_dec(&nf->nf_ref);
goto wait_for_construction;
}