mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 23:11:27 +00:00
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: a53d5cb064
("svcrdma: Avoid releasing a page in svc_xprt_release()")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
c4b50cdf9d
commit
baf6d18b11
1 changed files with 6 additions and 6 deletions
|
@ -792,6 +792,12 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
|
||||||
struct svc_rdma_recv_ctxt *ctxt;
|
struct svc_rdma_recv_ctxt *ctxt;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
/* Prevent svc_xprt_release() from releasing pages in rq_pages
|
||||||
|
* when returning 0 or an error.
|
||||||
|
*/
|
||||||
|
rqstp->rq_respages = rqstp->rq_pages;
|
||||||
|
rqstp->rq_next_page = rqstp->rq_respages;
|
||||||
|
|
||||||
rqstp->rq_xprt_ctxt = NULL;
|
rqstp->rq_xprt_ctxt = NULL;
|
||||||
|
|
||||||
ctxt = NULL;
|
ctxt = NULL;
|
||||||
|
@ -815,12 +821,6 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
|
||||||
DMA_FROM_DEVICE);
|
DMA_FROM_DEVICE);
|
||||||
svc_rdma_build_arg_xdr(rqstp, ctxt);
|
svc_rdma_build_arg_xdr(rqstp, ctxt);
|
||||||
|
|
||||||
/* Prevent svc_xprt_release from releasing pages in rq_pages
|
|
||||||
* if we return 0 or an error.
|
|
||||||
*/
|
|
||||||
rqstp->rq_respages = rqstp->rq_pages;
|
|
||||||
rqstp->rq_next_page = rqstp->rq_respages;
|
|
||||||
|
|
||||||
ret = svc_rdma_xdr_decode_req(&rqstp->rq_arg, ctxt);
|
ret = svc_rdma_xdr_decode_req(&rqstp->rq_arg, ctxt);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue