diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-04-16 16:42:12 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:30 -0400 |
| commit | a8ce4a8f37fef0a09a1e920c2e09f67a80426c7e (patch) | |
| tree | cd3c11c87fa63c8bf15e74f311560a83637fc3fa | |
| parent | 0b9e79431377df452348e78262dd5a3dc359eeef (diff) | |
SUNRPC: Fail over more quickly on connect errors
We should not allow soft tasks to wait for longer than the major timeout
period when waiting for a reconnect to occur.
Remove the field xprt->connect_timeout since it has been obsoleted by
xprt->reestablish_timeout.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| -rw-r--r-- | include/linux/sunrpc/xprt.h | 3 | ||||
| -rw-r--r-- | net/sunrpc/xprt.c | 2 | ||||
| -rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 1 | ||||
| -rw-r--r-- | net/sunrpc/xprtsock.c | 17 |
4 files changed, 2 insertions, 21 deletions
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 6f9457a75b8f..8263f7aefedf 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -174,8 +174,7 @@ struct rpc_xprt { | |||
| 174 | /* | 174 | /* |
| 175 | * Connection of transports | 175 | * Connection of transports |
| 176 | */ | 176 | */ |
| 177 | unsigned long connect_timeout, | 177 | unsigned long bind_timeout, |
| 178 | bind_timeout, | ||
| 179 | reestablish_timeout; | 178 | reestablish_timeout; |
| 180 | unsigned int connect_cookie; /* A cookie that gets bumped | 179 | unsigned int connect_cookie; /* A cookie that gets bumped |
| 181 | every time the transport | 180 | every time the transport |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index c71d835165e2..6c9997ef386a 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
| @@ -710,7 +710,7 @@ void xprt_connect(struct rpc_task *task) | |||
| 710 | if (task->tk_rqstp) | 710 | if (task->tk_rqstp) |
| 711 | task->tk_rqstp->rq_bytes_sent = 0; | 711 | task->tk_rqstp->rq_bytes_sent = 0; |
| 712 | 712 | ||
| 713 | task->tk_timeout = xprt->connect_timeout; | 713 | task->tk_timeout = task->tk_rqstp->rq_timeout; |
| 714 | rpc_sleep_on(&xprt->pending, task, xprt_connect_status); | 714 | rpc_sleep_on(&xprt->pending, task, xprt_connect_status); |
| 715 | 715 | ||
| 716 | if (test_bit(XPRT_CLOSING, &xprt->state)) | 716 | if (test_bit(XPRT_CLOSING, &xprt->state)) |
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 0607b9aaae91..3f3b38c5642f 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
| @@ -305,7 +305,6 @@ xprt_setup_rdma(struct xprt_create *args) | |||
| 305 | /* 60 second timeout, no retries */ | 305 | /* 60 second timeout, no retries */ |
| 306 | xprt->timeout = &xprt_rdma_default_timeout; | 306 | xprt->timeout = &xprt_rdma_default_timeout; |
| 307 | xprt->bind_timeout = (60U * HZ); | 307 | xprt->bind_timeout = (60U * HZ); |
| 308 | xprt->connect_timeout = (60U * HZ); | ||
| 309 | xprt->reestablish_timeout = (5U * HZ); | 308 | xprt->reestablish_timeout = (5U * HZ); |
| 310 | xprt->idle_timeout = (5U * 60 * HZ); | 309 | xprt->idle_timeout = (5U * 60 * HZ); |
| 311 | 310 | ||
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index d138afa3bb35..790a8f31b0bb 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
| @@ -138,20 +138,6 @@ static ctl_table sunrpc_table[] = { | |||
| 138 | #endif | 138 | #endif |
| 139 | 139 | ||
| 140 | /* | 140 | /* |
| 141 | * Time out for an RPC UDP socket connect. UDP socket connects are | ||
| 142 | * synchronous, but we set a timeout anyway in case of resource | ||
| 143 | * exhaustion on the local host. | ||
| 144 | */ | ||
| 145 | #define XS_UDP_CONN_TO (5U * HZ) | ||
| 146 | |||
| 147 | /* | ||
| 148 | * Wait duration for an RPC TCP connection to be established. Solaris | ||
| 149 | * NFS over TCP uses 60 seconds, for example, which is in line with how | ||
| 150 | * long a server takes to reboot. | ||
| 151 | */ | ||
| 152 | #define XS_TCP_CONN_TO (60U * HZ) | ||
| 153 | |||
| 154 | /* | ||
| 155 | * Wait duration for a reply from the RPC portmapper. | 141 | * Wait duration for a reply from the RPC portmapper. |
| 156 | */ | 142 | */ |
| 157 | #define XS_BIND_TO (60U * HZ) | 143 | #define XS_BIND_TO (60U * HZ) |
| @@ -2324,7 +2310,6 @@ static struct rpc_xprt *xs_setup_udp(struct xprt_create *args) | |||
| 2324 | xprt->max_payload = (1U << 16) - (MAX_HEADER << 3); | 2310 | xprt->max_payload = (1U << 16) - (MAX_HEADER << 3); |
| 2325 | 2311 | ||
| 2326 | xprt->bind_timeout = XS_BIND_TO; | 2312 | xprt->bind_timeout = XS_BIND_TO; |
| 2327 | xprt->connect_timeout = XS_UDP_CONN_TO; | ||
| 2328 | xprt->reestablish_timeout = XS_UDP_REEST_TO; | 2313 | xprt->reestablish_timeout = XS_UDP_REEST_TO; |
| 2329 | xprt->idle_timeout = XS_IDLE_DISC_TO; | 2314 | xprt->idle_timeout = XS_IDLE_DISC_TO; |
| 2330 | 2315 | ||
| @@ -2399,7 +2384,6 @@ static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args) | |||
| 2399 | xprt->max_payload = RPC_MAX_FRAGMENT_SIZE; | 2384 | xprt->max_payload = RPC_MAX_FRAGMENT_SIZE; |
| 2400 | 2385 | ||
| 2401 | xprt->bind_timeout = XS_BIND_TO; | 2386 | xprt->bind_timeout = XS_BIND_TO; |
| 2402 | xprt->connect_timeout = XS_TCP_CONN_TO; | ||
| 2403 | xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO; | 2387 | xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO; |
| 2404 | xprt->idle_timeout = XS_IDLE_DISC_TO; | 2388 | xprt->idle_timeout = XS_IDLE_DISC_TO; |
| 2405 | 2389 | ||
| @@ -2475,7 +2459,6 @@ static struct rpc_xprt *xs_setup_bc_tcp(struct xprt_create *args) | |||
| 2475 | /* backchannel */ | 2459 | /* backchannel */ |
| 2476 | xprt_set_bound(xprt); | 2460 | xprt_set_bound(xprt); |
| 2477 | xprt->bind_timeout = 0; | 2461 | xprt->bind_timeout = 0; |
| 2478 | xprt->connect_timeout = 0; | ||
| 2479 | xprt->reestablish_timeout = 0; | 2462 | xprt->reestablish_timeout = 0; |
| 2480 | xprt->idle_timeout = 0; | 2463 | xprt->idle_timeout = 0; |
| 2481 | 2464 | ||
