Skip to content

Commit

Permalink
SUNRPC: Clear the request rq_bytes_sent field in xprt_release_write
Browse files Browse the repository at this point in the history
Otherwise the tests of req->rq_bytes_sent in xprt_prepare_transmit
will fail if we're dealing with a resend.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 1, 2013
1 parent 0a66052 commit ee071ef
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions net/sunrpc/xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ static void __xprt_lock_write_next_cong(struct rpc_xprt *xprt)
void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task)
{
if (xprt->snd_task == task) {
if (task != NULL) {
struct rpc_rqst *req = task->tk_rqstp;
if (req != NULL)
req->rq_bytes_sent = 0;
}
xprt_clear_locked(xprt);
__xprt_lock_write_next(xprt);
}
Expand All @@ -375,6 +380,11 @@ EXPORT_SYMBOL_GPL(xprt_release_xprt);
void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task)
{
if (xprt->snd_task == task) {
if (task != NULL) {
struct rpc_rqst *req = task->tk_rqstp;
if (req != NULL)
req->rq_bytes_sent = 0;
}
xprt_clear_locked(xprt);
__xprt_lock_write_next_cong(xprt);
}
Expand Down

0 comments on commit ee071ef

Please sign in to comment.