diff -u --recursive --new-file linux-2.2.11-ac3/net/sunrpc/clnt.c linux-2.2.11-nfsv3/net/sunrpc/clnt.c --- linux-2.2.11-ac3/net/sunrpc/clnt.c Fri Aug 27 22:42:41 1999 +++ linux-2.2.11-nfsv3/net/sunrpc/clnt.c Thu Aug 26 00:53:58 1999 @@ -520,9 +520,8 @@ task->tk_pid, task->tk_status); task->tk_action = call_status; - /* In case of error, evaluate status */ - if (task->tk_status < 0) - return; + + xprt_receive(task); /* If we have no decode function, this means we're performing * a void call (a la lockd message passing). */ @@ -530,8 +529,6 @@ task->tk_action = NULL; return; } - - xprt_receive(task); } /* diff -u --recursive --new-file linux-2.2.11-ac3/net/sunrpc/xprt.c linux-2.2.11-nfsv3/net/sunrpc/xprt.c --- linux-2.2.11-ac3/net/sunrpc/xprt.c Fri Aug 27 22:42:42 1999 +++ linux-2.2.11-nfsv3/net/sunrpc/xprt.c Thu Aug 26 00:48:34 1999 @@ -217,10 +217,8 @@ dprintk("RPC: xprt_sendmsg(%d) = %d\n", slen, result); - if (result >= 0) { - req->rq_bytes_sent += result; + if (result >= 0) return result; - } switch (result) { case -ECONNREFUSED: @@ -610,6 +608,7 @@ copied = repsize; /* Okay, we have it. Copy datagram... */ + rovr->rq_damaged = 1; memcpy(iov, rovr->rq_rvec, rovr->rq_rnr * sizeof(iov[0])); /* This needs to stay tied with the usermode skb_copy_dagram... */ memcpy_tokerneliovec(iov, skb->data+8, copied); @@ -696,6 +695,8 @@ dprintk("RPC: %4d TCP receiving %d bytes\n", req->rq_task->tk_pid, want); + /* Request must be re-encoded before retransmit */ + req->rq_damaged = 1; result = xprt_recvmsg(xprt, xprt->tcp_iovec, req->rq_rnr, want); if (result < 0) goto done; @@ -715,8 +716,6 @@ xprt->tcp_copied = 0; xprt->tcp_rqstp = NULL; } - /* Request must be re-encoded before retransmit */ - req->rq_damaged = 1; } /* Skip over any trailing bytes on short reads */ @@ -1091,7 +1090,11 @@ while (1) { xprt->write_space = 0; status = xprt_sendmsg(xprt, req); - if (status >= 0 && req->rq_bytes_sent != req->rq_slen) + + if (status > 0 && xprt->stream) + req->rq_bytes_sent += status; + + if (status >= 0 && status < req->rq_slen) status = -EAGAIN; if (status >= 0) { @@ -1184,13 +1187,15 @@ */ task->tk_timeout = req->rq_timeout.to_current; + start_bh_atomic(); if (task->tk_rpcwait) rpc_remove_wait_queue(task); - if (task->tk_status < 0 || xprt->shutdown) + if (task->tk_status < 0 || xprt->shutdown) { + end_bh_atomic(); goto out; + } - start_bh_atomic(); if (!req->rq_gotit) { rpc_sleep_on(&xprt->pending, task, xprt_receive_status, xprt_timer);