SUNRPC in case of backlog, hand free slots directly to waiting task
[linux-2.6-microblaze.git] / net / sunrpc / clnt.c
index 612f0a6..42623d6 100644 (file)
@@ -1677,13 +1677,6 @@ call_reserveresult(struct rpc_task *task)
                return;
        }
 
-       /*
-        * Even though there was an error, we may have acquired
-        * a request slot somehow.  Make sure not to leak it.
-        */
-       if (task->tk_rqstp)
-               xprt_release(task);
-
        switch (status) {
        case -ENOMEM:
                rpc_delay(task, HZ >> 2);
@@ -1799,7 +1792,6 @@ call_allocate(struct rpc_task *task)
 
        status = xprt->ops->buf_alloc(task);
        trace_rpc_buf_alloc(task, status);
-       xprt_inject_disconnect(xprt);
        if (status == 0)
                return;
        if (status != -ENOMEM) {
@@ -2457,12 +2449,6 @@ call_decode(struct rpc_task *task)
                task->tk_flags &= ~RPC_CALL_MAJORSEEN;
        }
 
-       /*
-        * Ensure that we see all writes made by xprt_complete_rqst()
-        * before it changed req->rq_reply_bytes_recvd.
-        */
-       smp_rmb();
-
        /*
         * Did we ever call xprt_complete_rqst()? If not, we should assume
         * the message is incomplete.
@@ -2471,6 +2457,11 @@ call_decode(struct rpc_task *task)
        if (!req->rq_reply_bytes_recvd)
                goto out;
 
+       /* Ensure that we see all writes made by xprt_complete_rqst()
+        * before it changed req->rq_reply_bytes_recvd.
+        */
+       smp_rmb();
+
        req->rq_rcv_buf.len = req->rq_private_buf.len;
        trace_rpc_xdr_recvfrom(task, &req->rq_rcv_buf);