diff options
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r-- | fs/nfs/client.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index f2a092ca69b5..5ee23e7058b3 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -431,14 +431,14 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto, | |||
431 | { | 431 | { |
432 | to->to_initval = timeo * HZ / 10; | 432 | to->to_initval = timeo * HZ / 10; |
433 | to->to_retries = retrans; | 433 | to->to_retries = retrans; |
434 | if (!to->to_retries) | ||
435 | to->to_retries = 2; | ||
436 | 434 | ||
437 | switch (proto) { | 435 | switch (proto) { |
438 | case XPRT_TRANSPORT_TCP: | 436 | case XPRT_TRANSPORT_TCP: |
439 | case XPRT_TRANSPORT_RDMA: | 437 | case XPRT_TRANSPORT_RDMA: |
438 | if (to->to_retries == 0) | ||
439 | to->to_retries = NFS_DEF_TCP_RETRANS; | ||
440 | if (to->to_initval == 0) | 440 | if (to->to_initval == 0) |
441 | to->to_initval = 60 * HZ; | 441 | to->to_initval = NFS_DEF_TCP_TIMEO * HZ / 10; |
442 | if (to->to_initval > NFS_MAX_TCP_TIMEOUT) | 442 | if (to->to_initval > NFS_MAX_TCP_TIMEOUT) |
443 | to->to_initval = NFS_MAX_TCP_TIMEOUT; | 443 | to->to_initval = NFS_MAX_TCP_TIMEOUT; |
444 | to->to_increment = to->to_initval; | 444 | to->to_increment = to->to_initval; |
@@ -450,14 +450,17 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto, | |||
450 | to->to_exponential = 0; | 450 | to->to_exponential = 0; |
451 | break; | 451 | break; |
452 | case XPRT_TRANSPORT_UDP: | 452 | case XPRT_TRANSPORT_UDP: |
453 | default: | 453 | if (to->to_retries == 0) |
454 | to->to_retries = NFS_DEF_UDP_RETRANS; | ||
454 | if (!to->to_initval) | 455 | if (!to->to_initval) |
455 | to->to_initval = 11 * HZ / 10; | 456 | to->to_initval = NFS_DEF_UDP_TIMEO * HZ / 10; |
456 | if (to->to_initval > NFS_MAX_UDP_TIMEOUT) | 457 | if (to->to_initval > NFS_MAX_UDP_TIMEOUT) |
457 | to->to_initval = NFS_MAX_UDP_TIMEOUT; | 458 | to->to_initval = NFS_MAX_UDP_TIMEOUT; |
458 | to->to_maxval = NFS_MAX_UDP_TIMEOUT; | 459 | to->to_maxval = NFS_MAX_UDP_TIMEOUT; |
459 | to->to_exponential = 1; | 460 | to->to_exponential = 1; |
460 | break; | 461 | break; |
462 | default: | ||
463 | BUG(); | ||
461 | } | 464 | } |
462 | } | 465 | } |
463 | 466 | ||