mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
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>
This commit is contained in:
parent
a2c0412c05
commit
6a404f475f
@ -1050,7 +1050,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct net *net,
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user