Skip to content

Commit 8286f8b

Browse files
committed
NFSD: Never decrement pending_async_copies on error
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: aadc3bb ("NFSD: Limit the number of concurrent async COPY operations") Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 63fab04 commit 8286f8b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/nfsd/nfs4proc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,10 +1845,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
18451845
refcount_set(&async_copy->refcount, 1);
18461846
/* Arbitrary cap on number of pending async copy operations */
18471847
if (atomic_inc_return(&nn->pending_async_copies) >
1848-
(int)rqstp->rq_pool->sp_nrthreads) {
1849-
atomic_dec(&nn->pending_async_copies);
1848+
(int)rqstp->rq_pool->sp_nrthreads)
18501849
goto out_err;
1851-
}
18521850
async_copy->cp_src = kmalloc(sizeof(*async_copy->cp_src), GFP_KERNEL);
18531851
if (!async_copy->cp_src)
18541852
goto out_err;

0 commit comments

Comments
 (0)