aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/backchannel_rqst.c2
-rw-r--r--net/sunrpc/clnt.c8
-rw-r--r--net/sunrpc/stats.c2
-rw-r--r--net/sunrpc/xprt.c15
4 files changed, 14 insertions, 13 deletions
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index f56e18a23498..5a7d342e3087 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -230,7 +230,7 @@ struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt)
230 230
231 if (req != NULL) { 231 if (req != NULL) {
232 set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); 232 set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
233 req->rq_received = 0; 233 req->rq_reply_bytes_recvd = 0;
234 req->rq_bytes_sent = 0; 234 req->rq_bytes_sent = 0;
235 memcpy(&req->rq_private_buf, &req->rq_rcv_buf, 235 memcpy(&req->rq_private_buf, &req->rq_rcv_buf,
236 sizeof(req->rq_private_buf)); 236 sizeof(req->rq_private_buf));
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index f3e93b8eb90f..5bc2f45bddf0 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1258,8 +1258,8 @@ call_status(struct rpc_task *task)
1258 struct rpc_rqst *req = task->tk_rqstp; 1258 struct rpc_rqst *req = task->tk_rqstp;
1259 int status; 1259 int status;
1260 1260
1261 if (req->rq_received > 0 && !req->rq_bytes_sent) 1261 if (req->rq_reply_bytes_recvd > 0 && !req->rq_bytes_sent)
1262 task->tk_status = req->rq_received; 1262 task->tk_status = req->rq_reply_bytes_recvd;
1263 1263
1264 dprint_status(task); 1264 dprint_status(task);
1265 1265
@@ -1376,7 +1376,7 @@ call_decode(struct rpc_task *task)
1376 1376
1377 /* 1377 /*
1378 * Ensure that we see all writes made by xprt_complete_rqst() 1378 * Ensure that we see all writes made by xprt_complete_rqst()
1379 * before it changed req->rq_received. 1379 * before it changed req->rq_reply_bytes_recvd.
1380 */ 1380 */
1381 smp_rmb(); 1381 smp_rmb();
1382 req->rq_rcv_buf.len = req->rq_private_buf.len; 1382 req->rq_rcv_buf.len = req->rq_private_buf.len;
@@ -1417,7 +1417,7 @@ out_retry:
1417 task->tk_status = 0; 1417 task->tk_status = 0;
1418 /* Note: rpc_verify_header() may have freed the RPC slot */ 1418 /* Note: rpc_verify_header() may have freed the RPC slot */
1419 if (task->tk_rqstp == req) { 1419 if (task->tk_rqstp == req) {
1420 req->rq_received = req->rq_rcv_buf.len = 0; 1420 req->rq_reply_bytes_recvd = req->rq_rcv_buf.len = 0;
1421 if (task->tk_client->cl_discrtry) 1421 if (task->tk_client->cl_discrtry)
1422 xprt_conditional_disconnect(task->tk_xprt, 1422 xprt_conditional_disconnect(task->tk_xprt,
1423 req->rq_connect_cookie); 1423 req->rq_connect_cookie);
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index 8487aa0f1f5a..1b4e6791ecf3 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -156,7 +156,7 @@ void rpc_count_iostats(struct rpc_task *task)
156 op_metrics->om_timeouts += task->tk_timeouts; 156 op_metrics->om_timeouts += task->tk_timeouts;
157 157
158 op_metrics->om_bytes_sent += task->tk_bytes_sent; 158 op_metrics->om_bytes_sent += task->tk_bytes_sent;
159 op_metrics->om_bytes_recv += req->rq_received; 159 op_metrics->om_bytes_recv += req->rq_reply_bytes_recvd;
160 160
161 queue = (long)req->rq_xtime - task->tk_start; 161 queue = (long)req->rq_xtime - task->tk_start;
162 if (queue < 0) 162 if (queue < 0)
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index c144611223fc..f412a852bc73 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -806,9 +806,10 @@ void xprt_complete_rqst(struct rpc_task *task, int copied)
806 806
807 list_del_init(&req->rq_list); 807 list_del_init(&req->rq_list);
808 req->rq_private_buf.len = copied; 808 req->rq_private_buf.len = copied;
809 /* Ensure all writes are done before we update req->rq_received */ 809 /* Ensure all writes are done before we update */
810 /* req->rq_reply_bytes_recvd */
810 smp_wmb(); 811 smp_wmb();
811 req->rq_received = copied; 812 req->rq_reply_bytes_recvd = copied;
812 rpc_wake_up_queued_task(&xprt->pending, task); 813 rpc_wake_up_queued_task(&xprt->pending, task);
813} 814}
814EXPORT_SYMBOL_GPL(xprt_complete_rqst); 815EXPORT_SYMBOL_GPL(xprt_complete_rqst);
@@ -823,7 +824,7 @@ static void xprt_timer(struct rpc_task *task)
823 dprintk("RPC: %5u xprt_timer\n", task->tk_pid); 824 dprintk("RPC: %5u xprt_timer\n", task->tk_pid);
824 825
825 spin_lock_bh(&xprt->transport_lock); 826 spin_lock_bh(&xprt->transport_lock);
826 if (!req->rq_received) { 827 if (!req->rq_reply_bytes_recvd) {
827 if (xprt->ops->timer) 828 if (xprt->ops->timer)
828 xprt->ops->timer(task); 829 xprt->ops->timer(task);
829 } else 830 } else
@@ -845,8 +846,8 @@ int xprt_prepare_transmit(struct rpc_task *task)
845 dprintk("RPC: %5u xprt_prepare_transmit\n", task->tk_pid); 846 dprintk("RPC: %5u xprt_prepare_transmit\n", task->tk_pid);
846 847
847 spin_lock_bh(&xprt->transport_lock); 848 spin_lock_bh(&xprt->transport_lock);
848 if (req->rq_received && !req->rq_bytes_sent) { 849 if (req->rq_reply_bytes_recvd && !req->rq_bytes_sent) {
849 err = req->rq_received; 850 err = req->rq_reply_bytes_recvd;
850 goto out_unlock; 851 goto out_unlock;
851 } 852 }
852 if (!xprt->ops->reserve_xprt(task)) 853 if (!xprt->ops->reserve_xprt(task))
@@ -875,7 +876,7 @@ void xprt_transmit(struct rpc_task *task)
875 876
876 dprintk("RPC: %5u xprt_transmit(%u)\n", task->tk_pid, req->rq_slen); 877 dprintk("RPC: %5u xprt_transmit(%u)\n", task->tk_pid, req->rq_slen);
877 878
878 if (!req->rq_received) { 879 if (!req->rq_reply_bytes_recvd) {
879 if (list_empty(&req->rq_list) && rpc_reply_expected(task)) { 880 if (list_empty(&req->rq_list) && rpc_reply_expected(task)) {
880 /* 881 /*
881 * Add to the list only if we're expecting a reply 882 * Add to the list only if we're expecting a reply
@@ -914,7 +915,7 @@ void xprt_transmit(struct rpc_task *task)
914 /* Don't race with disconnect */ 915 /* Don't race with disconnect */
915 if (!xprt_connected(xprt)) 916 if (!xprt_connected(xprt))
916 task->tk_status = -ENOTCONN; 917 task->tk_status = -ENOTCONN;
917 else if (!req->rq_received && rpc_reply_expected(task)) { 918 else if (!req->rq_reply_bytes_recvd && rpc_reply_expected(task)) {
918 /* 919 /*
919 * Sleep on the pending queue since 920 * Sleep on the pending queue since
920 * we're expecting a reply. 921 * we're expecting a reply.