diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-04-16 16:41:57 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:29 -0400 |
commit | 0b9e79431377df452348e78262dd5a3dc359eeef (patch) | |
tree | 0a69324b177e2db40e88988b83e0782dd9d98990 /net/sunrpc/xprtrdma/transport.c | |
parent | 19445b99b6d66af661c586c052de23110731a502 (diff) |
SUNRPC: Move the test for XPRT_CONNECTING into xprt_connect()
This fixes a bug with setting xprt->stat.connect_start.
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
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 | ||