Skip to content

Commit

Permalink
SUNRPC: Ensure rq_bytes_sent is reset before request transmission
Browse files Browse the repository at this point in the history
When we resend a request, ensure that the 'rq_bytes_sent' is reset
to zero.

Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
Trond Myklebust committed Feb 20, 2019
1 parent 0ffe86f commit b9779a5
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion net/sunrpc/backchannel_rqst.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions net/sunrpc/xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion net/sunrpc/xprtrdma/backchannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion net/sunrpc/xprtrdma/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b9779a5

Please sign in to comment.