diff options
Diffstat (limited to 'net/sunrpc/xprtrdma/transport.c')
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 187257b1d880..0607b9aaae91 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -449,21 +449,19 @@ xprt_rdma_connect(struct rpc_task *task) | |||
449 | struct rpc_xprt *xprt = (struct rpc_xprt *)task->tk_xprt; | 449 | struct rpc_xprt *xprt = (struct rpc_xprt *)task->tk_xprt; |
450 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); | 450 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); |
451 | 451 | ||
452 | if (!xprt_test_and_set_connecting(xprt)) { | 452 | if (r_xprt->rx_ep.rep_connected != 0) { |
453 | if (r_xprt->rx_ep.rep_connected != 0) { | 453 | /* Reconnect */ |
454 | /* Reconnect */ | 454 | schedule_delayed_work(&r_xprt->rdma_connect, |
455 | schedule_delayed_work(&r_xprt->rdma_connect, | 455 | xprt->reestablish_timeout); |
456 | xprt->reestablish_timeout); | 456 | xprt->reestablish_timeout <<= 1; |
457 | xprt->reestablish_timeout <<= 1; | 457 | if (xprt->reestablish_timeout > (30 * HZ)) |
458 | if (xprt->reestablish_timeout > (30 * HZ)) | 458 | xprt->reestablish_timeout = (30 * HZ); |
459 | xprt->reestablish_timeout = (30 * HZ); | 459 | else if (xprt->reestablish_timeout < (5 * HZ)) |
460 | else if (xprt->reestablish_timeout < (5 * HZ)) | 460 | xprt->reestablish_timeout = (5 * HZ); |
461 | xprt->reestablish_timeout = (5 * HZ); | 461 | } else { |
462 | } else { | 462 | schedule_delayed_work(&r_xprt->rdma_connect, 0); |
463 | schedule_delayed_work(&r_xprt->rdma_connect, 0); | 463 | if (!RPC_IS_ASYNC(task)) |
464 | if (!RPC_IS_ASYNC(task)) | 464 | flush_scheduled_work(); |
465 | flush_scheduled_work(); | ||
466 | } | ||
467 | } | 465 | } |
468 | } | 466 | } |
469 | 467 | ||