diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2024-10-29 15:27:19 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-11-08 16:30:52 +0100 |
| commit | 1421883aa30c5d26bc3370e2d19cb350f0d5ca28 (patch) | |
| tree | 0cd943ea7f871dae07b7b1e205010bcbe8b88d61 /fs | |
| parent | e30a9a2f69c34a00a3cb4fd45c5d231929e66fb1 (diff) | |
| download | linux-1421883aa30c5d26bc3370e2d19cb350f0d5ca28.tar.gz linux-1421883aa30c5d26bc3370e2d19cb350f0d5ca28.tar.bz2 linux-1421883aa30c5d26bc3370e2d19cb350f0d5ca28.zip | |
NFSD: Never decrement pending_async_copies on error
[ Upstream commit 8286f8b622990194207df9ab852e0f87c60d35e9 ]
The error flow in nfsd4_copy() calls cleanup_async_copy(), which
already decrements nn->pending_async_copies.
Reported-by: Olga Kornievskaia <okorniev@redhat.com>
Fixes: aadc3bbea163 ("NFSD: Limit the number of concurrent async COPY operations")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/nfsd/nfs4proc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 81a1e3bf06b9..8b78d493e301 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1842,10 +1842,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, refcount_set(&async_copy->refcount, 1); /* Arbitrary cap on number of pending async copy operations */ if (atomic_inc_return(&nn->pending_async_copies) > - (int)rqstp->rq_pool->sp_nrthreads) { - atomic_dec(&nn->pending_async_copies); + (int)rqstp->rq_pool->sp_nrthreads) goto out_err; - } async_copy->cp_src = kmalloc(sizeof(*async_copy->cp_src), GFP_KERNEL); if (!async_copy->cp_src) goto out_err; |
