summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_socket.c
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2006-09-20 21:56:22 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2006-09-20 21:56:22 +0000
commit901d27dd839579369a4332191e3bf97b22732ff5 (patch)
tree1e0d023f6fdf980bca22b1e38c0a9e401fa4c0c1 /sys/nfs/nfs_socket.c
parent8d6561e1c3895a7f1885a1af2219f61c6d54308e (diff)
Fix the way delays between request retransmissions are calculated
in the case where NFSERR_TRYLATER is received from the server. Adapted from NetBSD. ok pedro@, tedu@
Diffstat (limited to 'sys/nfs/nfs_socket.c')
-rw-r--r--sys/nfs/nfs_socket.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 74b88487179..cb0416b45d8 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.44 2006/08/04 12:35:57 pedro Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.45 2006/09/20 21:56:21 thib Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -843,12 +843,14 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
time_t reqtime, waituntil;
caddr_t dpos, cp2;
int t1, s, error = 0, mrest_len, auth_len, auth_type;
- int trylater_delay = 15, trylater_cnt = 0, failed_auth = 0;
+ int trylater_delay, failed_auth = 0;
int verf_len, verf_type;
u_int32_t xid;
char *auth_str, *verf_str;
NFSKERBKEY_T key; /* save session key */
+ trylater_delay = NFS_MINTIMEO;
+
nmp = VFSTONFS(vp->v_mount);
rep = pool_get(&nfsreqpl, PR_WAITOK);
rep->r_nmp = nmp;
@@ -1043,9 +1045,10 @@ tryagain:
while (time_second < waituntil)
(void) tsleep((caddr_t)&lbolt,
PSOCK, "nqnfstry", 0);
- trylater_delay *= nfs_backoff[trylater_cnt];
- if (trylater_cnt < 7)
- trylater_cnt++;
+ trylater_delay *= NFS_TIMEOUTMUL;
+ if (trylater_delay > NFS_MAXTIMEO)
+ trylater_delay = NFS_MAXTIMEO;
+
goto tryagain;
}