Skip to content

Commit baf6d18

Browse files
committed
svcrdma: Prevent page release when nothing was received
I noticed that svc_rqst_release_pages() was still unnecessarily releasing a page when svc_rdma_recvfrom() returns zero. Fixes: a53d5cb ("svcrdma: Avoid releasing a page in svc_xprt_release()") Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent c4b50cd commit baf6d18

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

net/sunrpc/xprtrdma/svc_rdma_recvfrom.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,12 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
792792
struct svc_rdma_recv_ctxt *ctxt;
793793
int ret;
794794

795+
/* Prevent svc_xprt_release() from releasing pages in rq_pages
796+
* when returning 0 or an error.
797+
*/
798+
rqstp->rq_respages = rqstp->rq_pages;
799+
rqstp->rq_next_page = rqstp->rq_respages;
800+
795801
rqstp->rq_xprt_ctxt = NULL;
796802

797803
ctxt = NULL;
@@ -815,12 +821,6 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
815821
DMA_FROM_DEVICE);
816822
svc_rdma_build_arg_xdr(rqstp, ctxt);
817823

818-
/* Prevent svc_xprt_release from releasing pages in rq_pages
819-
* if we return 0 or an error.
820-
*/
821-
rqstp->rq_respages = rqstp->rq_pages;
822-
rqstp->rq_next_page = rqstp->rq_respages;
823-
824824
ret = svc_rdma_xdr_decode_req(&rqstp->rq_arg, ctxt);
825825
if (ret < 0)
826826
goto out_err;

0 commit comments

Comments
 (0)