diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-09-27 11:09:53 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-10-01 18:22:11 -0400 |
commit | ee071eff0f1afafa9917254a6e4ee19d28085f1d (patch) | |
tree | 073da279fab6928783aca5849d90fe687f337c45 /net/sunrpc/xprt.c | |
parent | 0a6605213040dd2fb479f0d1a9a87a1d7fa70904 (diff) | |
download | linux-ee071eff0f1afafa9917254a6e4ee19d28085f1d.tar.gz linux-ee071eff0f1afafa9917254a6e4ee19d28085f1d.tar.bz2 linux-ee071eff0f1afafa9917254a6e4ee19d28085f1d.zip |
SUNRPC: Clear the request rq_bytes_sent field in xprt_release_write
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>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index e9ee7bf3a638..8cc5c8bcad7f 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -358,6 +358,11 @@ out_unlock: 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); } @@ -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); } |