From: Chuck Lever Date: Sun, 11 Apr 2021 18:19:08 +0000 (-0400) Subject: svcrdma: Pass a useful error code to the send_err tracepoint X-Git-Tag: accepted/tizen/unified/20230118.172025~7281^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8727f78855b8d770b192949adbb1425092529e0f;p=platform%2Fkernel%2Flinux-rpi.git svcrdma: Pass a useful error code to the send_err tracepoint Capture error codes in @ret, which is passed to the send_err tracepoint, so that they can be logged when something goes awry. Signed-off-by: Chuck Lever --- diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index a3b0f58..d6bbafb 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -921,6 +921,7 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) struct svc_rdma_recv_ctxt *rctxt = rqstp->rq_xprt_ctxt; __be32 *rdma_argp = rctxt->rc_recv_buf; struct svc_rdma_send_ctxt *sctxt; + unsigned int rc_size; __be32 *p; int ret; @@ -933,6 +934,7 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) if (!sctxt) goto drop_connection; + ret = -EMSGSIZE; p = xdr_reserve_space(&sctxt->sc_stream, rpcrdma_fixed_maxsz * sizeof(*p)); if (!p) @@ -941,17 +943,21 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) ret = svc_rdma_send_reply_chunk(rdma, rctxt, &rqstp->rq_res); if (ret < 0) goto reply_chunk; + rc_size = ret; *p++ = *rdma_argp; *p++ = *(rdma_argp + 1); *p++ = rdma->sc_fc_credits; *p = pcl_is_empty(&rctxt->rc_reply_pcl) ? rdma_msg : rdma_nomsg; - if (svc_rdma_encode_read_list(sctxt) < 0) + ret = svc_rdma_encode_read_list(sctxt); + if (ret < 0) goto put_ctxt; - if (svc_rdma_encode_write_list(rctxt, sctxt) < 0) + ret = svc_rdma_encode_write_list(rctxt, sctxt); + if (ret < 0) goto put_ctxt; - if (svc_rdma_encode_reply_chunk(rctxt, sctxt, ret) < 0) + ret = svc_rdma_encode_reply_chunk(rctxt, sctxt, rc_size); + if (ret < 0) goto put_ctxt; ret = svc_rdma_send_reply_msg(rdma, sctxt, rctxt, rqstp);