Merge tag 'nfs-for-4.19-1' of git://git.linux-nfs.org/projects/anna/linux-nfs
[sfrench/cifs-2.6.git] / net / sunrpc / xprtrdma / verbs.c
index 5efeba08918b97a319005f5f1548733e929b843c..956a5ea47b58ee8a6009aa8b6315ce5887ec9110 100644 (file)
@@ -280,7 +280,6 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event)
                ++xprt->rx_xprt.connect_cookie;
                connstate = -ECONNABORTED;
 connected:
-               xprt->rx_buf.rb_credits = 1;
                ep->rep_connected = connstate;
                rpcrdma_conn_func(ep);
                wake_up_all(&ep->rep_connect_wait);
@@ -755,6 +754,7 @@ retry:
        }
 
        ep->rep_connected = 0;
+       rpcrdma_post_recvs(r_xprt, true);
 
        rc = rdma_connect(ia->ri_id, &ep->rep_remote_cma);
        if (rc) {
@@ -773,8 +773,6 @@ retry:
 
        dprintk("RPC:       %s: connected\n", __func__);
 
-       rpcrdma_post_recvs(r_xprt, true);
-
 out:
        if (rc)
                ep->rep_connected = rc;
@@ -1171,6 +1169,7 @@ rpcrdma_buffer_create(struct rpcrdma_xprt *r_xprt)
                list_add(&req->rl_list, &buf->rb_send_bufs);
        }
 
+       buf->rb_credits = 1;
        buf->rb_posted_receives = 0;
        INIT_LIST_HEAD(&buf->rb_recv_bufs);