diff options
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 15 |
1 files changed, 8 insertions, 7 deletions
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 | } |
814 | EXPORT_SYMBOL_GPL(xprt_complete_rqst); | 815 | EXPORT_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. |