提交 ee071eff 编写于 作者: T Trond Myklebust

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: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 0a660521
...@@ -358,6 +358,11 @@ static void __xprt_lock_write_next_cong(struct rpc_xprt *xprt) ...@@ -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) void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task)
{ {
if (xprt->snd_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_clear_locked(xprt);
__xprt_lock_write_next(xprt); __xprt_lock_write_next(xprt);
} }
...@@ -375,6 +380,11 @@ EXPORT_SYMBOL_GPL(xprt_release_xprt); ...@@ -375,6 +380,11 @@ EXPORT_SYMBOL_GPL(xprt_release_xprt);
void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task) void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task)
{ {
if (xprt->snd_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_clear_locked(xprt);
__xprt_lock_write_next_cong(xprt); __xprt_lock_write_next_cong(xprt);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册