[PATCH] NFS: allow enough time for timeouts to run

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



NFS/TCP uses linear backoff when retransmiting requests but
miscalculates the cut-off time for the timeout sequence resulting
in premature major timeouts.

The cutoff should be the sum of first retransmits+1 numbers
multiplied by the timeo, not the retransmits+1 multiplied by
timeo.

Signed-off-by: Max Matveev <makc@xxxxxxxxxx>
---
 fs/nfs/client.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 5833fbb..3d12d10 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -604,7 +604,8 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
 		if (to->to_initval > NFS_MAX_TCP_TIMEOUT)
 			to->to_initval = NFS_MAX_TCP_TIMEOUT;
 		to->to_increment = to->to_initval;
-		to->to_maxval = to->to_initval + (to->to_increment * to->to_retries);
+		to->to_maxval = (to->to_retries + 1) * (to->to_retries + 2) / 2;
+		to->to_maxval *= to->to_initval;
 		if (to->to_maxval > NFS_MAX_TCP_TIMEOUT)
 			to->to_maxval = NFS_MAX_TCP_TIMEOUT;
 		if (to->to_maxval < to->to_initval)
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux