aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-09-25 11:31:54 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-10-01 18:22:10 -0400
commit0a6605213040dd2fb479f0d1a9a87a1d7fa70904 (patch)
tree9789e9f922284855e1254f21fb84b6d1f8e95b09 /net/sunrpc
parent8b71798c0d389d4cadc884fc7d68c61ee8cd4f45 (diff)
SUNRPC: Don't set the request connect_cookie until a successful transmit
We're using the request connect_cookie to track whether or not a request was successfully transmitted on the current transport connection or not. For that reason we should ensure that it is only set after we've successfully transmitted the request. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 095363eee764..e9ee7bf3a638 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -912,7 +912,6 @@ void xprt_transmit(struct rpc_task *task)
912 } else if (!req->rq_bytes_sent) 912 } else if (!req->rq_bytes_sent)
913 return; 913 return;
914 914
915 req->rq_connect_cookie = xprt->connect_cookie;
916 req->rq_xtime = ktime_get(); 915 req->rq_xtime = ktime_get();
917 status = xprt->ops->send_request(task); 916 status = xprt->ops->send_request(task);
918 if (status != 0) { 917 if (status != 0) {
@@ -938,12 +937,14 @@ void xprt_transmit(struct rpc_task *task)
938 /* Don't race with disconnect */ 937 /* Don't race with disconnect */
939 if (!xprt_connected(xprt)) 938 if (!xprt_connected(xprt))
940 task->tk_status = -ENOTCONN; 939 task->tk_status = -ENOTCONN;
941 else if (!req->rq_reply_bytes_recvd && rpc_reply_expected(task)) { 940 else {
942 /* 941 /*
943 * Sleep on the pending queue since 942 * Sleep on the pending queue since
944 * we're expecting a reply. 943 * we're expecting a reply.
945 */ 944 */
946 rpc_sleep_on(&xprt->pending, task, xprt_timer); 945 if (!req->rq_reply_bytes_recvd && rpc_reply_expected(task))
946 rpc_sleep_on(&xprt->pending, task, xprt_timer);
947 req->rq_connect_cookie = xprt->connect_cookie;
947 } 948 }
948 spin_unlock_bh(&xprt->transport_lock); 949 spin_unlock_bh(&xprt->transport_lock);
949} 950}
@@ -1186,6 +1187,7 @@ static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
1186 req->rq_xprt = xprt; 1187 req->rq_xprt = xprt;
1187 req->rq_buffer = NULL; 1188 req->rq_buffer = NULL;
1188 req->rq_xid = xprt_alloc_xid(xprt); 1189 req->rq_xid = xprt_alloc_xid(xprt);
1190 req->rq_connect_cookie = xprt->connect_cookie - 1;
1189 req->rq_release_snd_buf = NULL; 1191 req->rq_release_snd_buf = NULL;
1190 xprt_reset_majortimeo(req); 1192 xprt_reset_majortimeo(req);
1191 dprintk("RPC: %5u reserved req %p xid %08x\n", task->tk_pid, 1193 dprintk("RPC: %5u reserved req %p xid %08x\n", task->tk_pid,