summaryrefslogtreecommitdiff
path: root/sys/nfs
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2009-06-02 23:17:00 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2009-06-02 23:17:00 +0000
commitc64ba8f3144a9836b3320d154687ecf20b07135c (patch)
treeb85ce68b8b3b2e45b3a48a684ab1499d489e2570 /sys/nfs
parente54f1563747789b89c0456389f777741fa14ff92 (diff)
give the retransmission count booking keeping a facelift,
just store the maximun amount of rexmits in one place and cleanup. Also make sure this only effects soft mounts. OK blambert@
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs.h3
-rw-r--r--sys/nfs/nfs_socket.c23
-rw-r--r--sys/nfs/nfs_vfsops.c19
-rw-r--r--sys/nfs/nfsmount.h3
4 files changed, 15 insertions, 33 deletions
diff --git a/sys/nfs/nfs.h b/sys/nfs/nfs.h
index 4ca42223266..789baf4efee 100644
--- a/sys/nfs/nfs.h
+++ b/sys/nfs/nfs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs.h,v 1.40 2009/05/22 00:19:25 thib Exp $ */
+/* $OpenBSD: nfs.h,v 1.41 2009/06/02 23:16:59 thib Exp $ */
/* $NetBSD: nfs.h,v 1.10.4.1 1996/05/27 11:23:56 fvdl Exp $ */
/*
@@ -230,7 +230,6 @@ struct nfsreq {
struct vnode *r_vp;
u_int32_t r_xid;
int r_flags; /* flags on request, see below */
- int r_retry; /* max retransmission count */
int r_rexmit; /* current retrans count */
int r_timer; /* tick counter on reply */
int r_procnum; /* NFS procedure number */
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index a8041b8de8c..03b993b6693 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.81 2009/05/30 17:20:29 thib Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.82 2009/06/02 23:16:59 thib Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -856,10 +856,6 @@ nfs_request1(struct nfsreq *rep, struct ucred *cred, struct mbuf **mrp,
}
tryagain:
- if (nmp->nm_flag & NFSMNT_SOFT)
- rep->r_retry = nmp->nm_retry;
- else
- rep->r_retry = NFS_MAXREXMIT + 1; /* past clip limit */
rep->r_rtt = rep->r_rexmit = 0;
if (proct[rep->r_procnum] > 0)
rep->r_flags = R_TIMING;
@@ -1110,10 +1106,8 @@ nfs_rephead(siz, nd, slp, err, mrq, mbp)
}
/*
- * Nfs timer routine
- * Scan the nfsreq list and retranmit any requests that have timed out
- * To avoid retransmission attempts on STREAM sockets (in the future) make
- * sure to set the r_retry field to 0 (implies nm_retry == 0).
+ * nfs timer routine
+ * Scan the nfsreq list and retranmit any requests that have timed out.
*/
void
nfs_timer(arg)
@@ -1153,15 +1147,13 @@ nfs_timer(arg)
if (nmp->nm_timeouts < nitems(nfs_backoff))
nmp->nm_timeouts++;
}
- /*
- * Check for server not responding
- */
- if ((rep->r_flags & R_TPRINTFMSG) == 0 &&
- rep->r_rexmit > nmp->nm_deadthresh) {
+
+ /* Check for server not responding. */
+ if ((rep->r_flags & R_TPRINTFMSG) == 0 && rep->r_rexmit > 4) {
nfs_msg(rep, "not responding");
rep->r_flags |= R_TPRINTFMSG;
}
- if (rep->r_rexmit >= rep->r_retry) { /* too many */
+ if (rep->r_rexmit >= nmp->nm_retry) { /* too many */
nfsstats.rpctimeouts++;
rep->r_flags |= R_SOFTTERM;
continue;
@@ -1171,6 +1163,7 @@ nfs_timer(arg)
rep->r_rexmit = NFS_MAXREXMIT;
continue;
}
+
if ((so = nmp->nm_so) == NULL)
continue;
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index 0c8a500964a..cc7f4037922 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vfsops.c,v 1.81 2009/04/13 17:51:57 blambert Exp $ */
+/* $OpenBSD: nfs_vfsops.c,v 1.82 2009/06/02 23:16:59 thib Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */
/*
@@ -67,9 +67,6 @@
#include <nfs/nfsdiskless.h>
#include <nfs/nfs_var.h>
-#define NQ_DEADTHRESH NQ_NEVERDEAD /* Default nm_deadthresh */
-#define NQ_NEVERDEAD 9 /* Greater than max. nm_timeouts */
-
extern struct nfsstats nfsstats;
extern int nfs_ticks;
extern u_int32_t nfs_procids[NFS_NPROCS];
@@ -443,11 +440,10 @@ nfs_decode_args(nmp, argp, nargp)
nmp->nm_timeo = NFS_MAXTIMEO;
}
- if ((argp->flags & NFSMNT_RETRANS) && argp->retrans > 1) {
- nmp->nm_retry = argp->retrans;
- if (nmp->nm_retry > NFS_MAXREXMIT)
- nmp->nm_retry = NFS_MAXREXMIT;
- }
+ if ((argp->flags & NFSMNT_RETRANS) && argp->retrans > 1)
+ nmp->nm_retry = MIN(argp->retrans, NFS_MAXREXMIT);
+ if (!(nmp->nm_flag & NFSMNT_SOFT))
+ nmp->nm_retry = NFS_MAXREXMIT + 1; /* past clip limit */
if (argp->flags & NFSMNT_NFSV3) {
if (argp->sotype == SOCK_DGRAM)
@@ -503,9 +499,6 @@ nfs_decode_args(nmp, argp, nargp)
if ((argp->flags & NFSMNT_READAHEAD) && argp->readahead >= 0 &&
argp->readahead <= NFS_MAXRAHEAD)
nmp->nm_readahead = argp->readahead;
- if ((argp->flags & NFSMNT_DEADTHRESH) && argp->deadthresh >= 1 &&
- argp->deadthresh <= NQ_NEVERDEAD)
- nmp->nm_deadthresh = argp->deadthresh;
if (argp->flags & NFSMNT_ACREGMIN && argp->acregmin >= 0) {
if (argp->acregmin > 0xffff)
nmp->nm_acregmin = 0xffff;
@@ -554,7 +547,6 @@ nfs_decode_args(nmp, argp, nargp)
nargp->retrans = nmp->nm_retry;
nargp->maxgrouplist = nmp->nm_numgrps;
nargp->readahead = nmp->nm_readahead;
- nargp->deadthresh = nmp->nm_deadthresh;
nargp->acregmin = nmp->nm_acregmin;
nargp->acregmax = nmp->nm_acregmax;
nargp->acdirmin = nmp->nm_acdirmin;
@@ -680,7 +672,6 @@ mountnfs(argp, mp, nam, pth, hst)
nmp->nm_readdirsize = NFS_READDIRSIZE;
nmp->nm_numgrps = NFS_MAXGRPS;
nmp->nm_readahead = NFS_DEFRAHEAD;
- nmp->nm_deadthresh = NQ_DEADTHRESH;
nmp->nm_fhsize = argp->fhsize;
nmp->nm_acregmin = NFS_MINATTRTIMO;
nmp->nm_acregmax = NFS_MAXATTRTIMO;
diff --git a/sys/nfs/nfsmount.h b/sys/nfs/nfsmount.h
index 84031e7c388..c2fc2065865 100644
--- a/sys/nfs/nfsmount.h
+++ b/sys/nfs/nfsmount.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsmount.h,v 1.18 2008/12/27 14:14:30 thib Exp $ */
+/* $OpenBSD: nfsmount.h,v 1.19 2009/06/02 23:16:59 thib Exp $ */
/* $NetBSD: nfsmount.h,v 1.10 1996/02/18 11:54:03 fvdl Exp $ */
/*
@@ -62,7 +62,6 @@ struct nfsmount {
int nm_sent; /* Request send count */
int nm_cwnd; /* Request send window */
int nm_timeouts; /* Request timeouts */
- int nm_deadthresh; /* Threshold of timeouts-->dead server*/
int nm_rsize; /* Max size of read rpc */
int nm_wsize; /* Max size of write rpc */
int nm_readdirsize; /* Size of a readdir rpc */