Skip to content

Commit

Permalink
xprtrdma: Fix return code from rpcrdma_xprt_connect()
Browse files Browse the repository at this point in the history
I noticed that when rpcrdma_xprt_connect() returns -ENOMEM,
instead of retrying the connect, the RPC client kills the
RPC task that requested the connection. We want a retry
here.

Fixes: cb586de ("xprtrdma: Make sendctx queue lifetime the same as connection lifetime")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
  • Loading branch information
Chuck Lever authored and Anna Schumaker committed Jul 13, 2020
1 parent 4cf44be commit dda9a95
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions net/sunrpc/xprtrdma/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt)

ep = kzalloc(sizeof(*ep), GFP_NOFS);
if (!ep)
return -EAGAIN;
return -ENOTCONN;
ep->re_xprt = &r_xprt->rx_xprt;
kref_init(&ep->re_kref);

Expand Down Expand Up @@ -535,10 +535,6 @@ int rpcrdma_xprt_connect(struct rpcrdma_xprt *r_xprt)
rpcrdma_ep_get(ep);
rpcrdma_post_recvs(r_xprt, true);

rc = rpcrdma_sendctxs_create(r_xprt);
if (rc)
goto out;

rc = rdma_connect(ep->re_id, &ep->re_remote_cma);
if (rc)
goto out;
Expand All @@ -552,9 +548,17 @@ int rpcrdma_xprt_connect(struct rpcrdma_xprt *r_xprt)
goto out;
}

rc = rpcrdma_sendctxs_create(r_xprt);
if (rc) {
rc = -ENOTCONN;
goto out;
}

rc = rpcrdma_reqs_setup(r_xprt);
if (rc)
if (rc) {
rc = -ENOTCONN;
goto out;
}
rpcrdma_mrs_create(r_xprt);

out:
Expand Down

0 comments on commit dda9a95

Please sign in to comment.