diff -u --recursive --new-file linux-2.6.0-test3-04-fix_rto/include/linux/sunrpc/xprt.h linux-2.6.0-test3-05-resends/include/linux/sunrpc/xprt.h --- linux-2.6.0-test3-04-fix_rto/include/linux/sunrpc/xprt.h 2003-08-11 16:37:05.000000000 -0700 +++ linux-2.6.0-test3-05-resends/include/linux/sunrpc/xprt.h 2003-08-12 12:21:27.000000000 -0700 @@ -115,7 +115,7 @@ unsigned long rq_xtime; /* when transmitted */ int rq_ntimeo; - int rq_nresend; + int rq_ntrans; }; #define rq_svec rq_snd_buf.head #define rq_slen rq_snd_buf.len diff -u --recursive --new-file linux-2.6.0-test3-04-fix_rto/net/sunrpc/xprt.c linux-2.6.0-test3-05-resends/net/sunrpc/xprt.c --- linux-2.6.0-test3-04-fix_rto/net/sunrpc/xprt.c 2003-08-11 17:51:58.000000000 -0700 +++ linux-2.6.0-test3-05-resends/net/sunrpc/xprt.c 2003-08-12 12:21:05.000000000 -0700 @@ -143,15 +143,17 @@ if (!xprt->snd_task) { if (xprt->nocong || __xprt_get_cong(xprt, task)) { xprt->snd_task = task; - if (req) + if (req) { req->rq_bytes_sent = 0; + req->rq_ntrans++; + } } } if (xprt->snd_task != task) { dprintk("RPC: %4d TCP write queue full\n", task->tk_pid); task->tk_timeout = 0; task->tk_status = -EAGAIN; - if (req && req->rq_nresend) + if (req && req->rq_ntrans) rpc_sleep_on(&xprt->resend, task, NULL, NULL); else rpc_sleep_on(&xprt->sending, task, NULL, NULL); @@ -189,8 +191,10 @@ if (xprt->nocong || __xprt_get_cong(xprt, task)) { struct rpc_rqst *req = task->tk_rqstp; xprt->snd_task = task; - if (req) + if (req) { req->rq_bytes_sent = 0; + req->rq_ntrans++; + } } } @@ -578,7 +582,7 @@ if (!xprt->nocong) { xprt_adjust_cwnd(xprt, copied); __xprt_put_cong(xprt, req); - if (!req->rq_nresend) { + if (req->rq_ntrans == 1) { unsigned timer = task->tk_msg.rpc_proc->p_timer; if (timer) @@ -1064,7 +1068,7 @@ goto out; xprt_adjust_cwnd(req->rq_xprt, -ETIMEDOUT); - req->rq_nresend++; + __xprt_put_cong(xprt, req); dprintk("RPC: %4d xprt_timer (%s request)\n", task->tk_pid, req ? "pending" : "backlogged");