]> git.baikalelectronics.ru Git - kernel.git/commitdiff
SUNRPC: Ensure rq_bytes_sent is reset before request transmission
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 2 Jan 2019 20:54:42 +0000 (15:54 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 20 Feb 2019 22:33:55 +0000 (17:33 -0500)
When we resend a request, ensure that the 'rq_bytes_sent' is reset
to zero.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/backchannel_rqst.c
net/sunrpc/xprt.c
net/sunrpc/xprtrdma/backchannel.c
net/sunrpc/xprtrdma/transport.c
net/sunrpc/xprtsock.c

index ec451b8114b0b07dbe5db102af8002d58b7804cd..b9313c15ee3a2d1a4b2935d5fb4d464b6b213862 100644 (file)
@@ -252,7 +252,6 @@ static struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt, __be32 xid)
        req = list_first_entry(&xprt->bc_pa_list, struct rpc_rqst,
                                rq_bc_pa_list);
        req->rq_reply_bytes_recvd = 0;
-       req->rq_bytes_sent = 0;
        memcpy(&req->rq_private_buf, &req->rq_rcv_buf,
                        sizeof(req->rq_private_buf));
        req->rq_xid = xid;
index b95f4452dbc693b75172b8f22411d20ebb93858c..1587728f40d1fe8a417a5b472d1db62474fca476 100644 (file)
@@ -1602,7 +1602,6 @@ xprt_request_init(struct rpc_task *task)
        req->rq_buffer  = NULL;
        req->rq_xid     = xprt_alloc_xid(xprt);
        xprt_init_connect_cookie(req, xprt);
-       req->rq_bytes_sent = 0;
        req->rq_snd_buf.len = 0;
        req->rq_snd_buf.buflen = 0;
        req->rq_rcv_buf.len = 0;
@@ -1752,7 +1751,6 @@ xprt_init_bc_request(struct rpc_rqst *req, struct rpc_task *task)
         */
        xbufp->len = xbufp->head[0].iov_len + xbufp->page_len +
                xbufp->tail[0].iov_len;
-       req->rq_bytes_sent = 0;
 }
 #endif
 
index 0de9b3e63770f21b0827e035349d5819fb1ab964..749452724e6e424e718303276337a502aac8871e 100644 (file)
@@ -267,7 +267,6 @@ void rpcrdma_bc_receive_call(struct rpcrdma_xprt *r_xprt,
 
        /* Prepare rqst */
        rqst->rq_reply_bytes_recvd = 0;
-       rqst->rq_bytes_sent = 0;
        rqst->rq_xid = *p;
 
        rqst->rq_private_buf.len = size;
index fbc171ebfe9172dd8eb9a29f35ce6ef3e9bdeea3..3c490172d383886118845440259e8921cd33eaed 100644 (file)
@@ -738,7 +738,6 @@ xprt_rdma_send_request(struct rpc_rqst *rqst)
                goto drop_connection;
 
        rqst->rq_xmit_bytes_sent += rqst->rq_snd_buf.len;
-       rqst->rq_bytes_sent = 0;
 
        /* An RPC with no reply will throw off credit accounting,
         * so drop the connection to reset the credit grant.
index da45bb1e931e7e11e4d6741a97c5a2538af7b298..5d22c175c7dd00bd6cd9a4ab0655fd806e4d6baf 100644 (file)
@@ -951,7 +951,6 @@ static int xs_local_send_request(struct rpc_rqst *req)
                req->rq_bytes_sent = transport->xmit.offset;
                if (likely(req->rq_bytes_sent >= req->rq_slen)) {
                        req->rq_xmit_bytes_sent += transport->xmit.offset;
-                       req->rq_bytes_sent = 0;
                        transport->xmit.offset = 0;
                        return 0;
                }
@@ -1117,7 +1116,6 @@ static int xs_tcp_send_request(struct rpc_rqst *req)
                req->rq_bytes_sent = transport->xmit.offset;
                if (likely(req->rq_bytes_sent >= req->rq_slen)) {
                        req->rq_xmit_bytes_sent += transport->xmit.offset;
-                       req->rq_bytes_sent = 0;
                        transport->xmit.offset = 0;
                        return 0;
                }