]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
svcrdma: Remove save_io_pages() call from send_error_msg()
authorChuck Lever <chuck.lever@oracle.com>
Wed, 25 Mar 2020 15:15:55 +0000 (11:15 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 13 Jul 2020 21:28:24 +0000 (17:28 -0400)
Commit 4757d90b15d8 ("svcrdma: Report Write/Reply chunk overruns")
made an effort to preserve I/O pages until RDMA Write completion.

In a subsequent patch, I intend to de-duplicate the two functions
that send ERR_CHUNK responses. Pull the save_io_pages() call out of
svc_rdma_send_error_msg() to make it more like
svc_rdma_send_error().

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/xprtrdma/svc_rdma_sendto.c

index 38e7c3c8c4a9caf80daf2b71e2a6223763c05f40..2f88d01e8d270092748c1702af79343e1d71debc 100644 (file)
@@ -806,8 +806,7 @@ static int svc_rdma_send_reply_msg(struct svcxprt_rdma *rdma,
 
 /* Given the client-provided Write and Reply chunks, the server was not
  * able to form a complete reply. Return an RDMA_ERROR message so the
- * client can retire this RPC transaction. As above, the Send completion
- * routine releases payload pages that were part of a previous RDMA Write.
+ * client can retire this RPC transaction.
  *
  * Remote Invalidation is skipped for simplicity.
  */
@@ -834,8 +833,6 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma,
        *p   = err_chunk;
        trace_svcrdma_err_chunk(*rdma_argp);
 
-       svc_rdma_save_io_pages(rqstp, ctxt);
-
        ctxt->sc_send_wr.num_sge = 1;
        ctxt->sc_send_wr.opcode = IB_WR_SEND;
        ctxt->sc_sges[0].length = ctxt->sc_hdrbuf.len;
@@ -930,6 +927,10 @@ int svc_rdma_sendto(struct svc_rqst *rqstp)
        if (ret != -E2BIG && ret != -EINVAL)
                goto err1;
 
+       /* Send completion releases payload pages that were part
+        * of previously posted RDMA Writes.
+        */
+       svc_rdma_save_io_pages(rqstp, sctxt);
        ret = svc_rdma_send_error_msg(rdma, sctxt, rqstp);
        if (ret < 0)
                goto err1;