From: Ion Badulescu Date: Wed, 4 Sep 2002 20:13:27 +0000 (+0000) Subject: * amd/srvr_nfs.c (nfs_timed_out): allocate a new XID on server X-Git-Tag: am-utils-6_0_8~3 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=b817c688e32ff68c37b7d8a6066b1a8a48f029c6;p=am-utils-6.0.git * amd/srvr_nfs.c (nfs_timed_out): allocate a new XID on server timeout to avoid problems with late ping replies [patch from George Ross ported from 6.1] --- diff --git a/ChangeLog b/ChangeLog index b89721f..3946b5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-09-04 Ion Badulescu + + * amd/srvr_nfs.c (nfs_timed_out): allocate a new XID on server + timeout to avoid problems with late ping replies [patch from + George Ross ported from 6.1] + 2002-07-11 Erez Zadok * scripts/expn.{1,in}: fixed typos as reported by Thomas Klausner diff --git a/amd/srvr_nfs.c b/amd/srvr_nfs.c index 24ad120..fb2784f 100644 --- a/amd/srvr_nfs.c +++ b/amd/srvr_nfs.c @@ -38,7 +38,7 @@ * * %W% (Berkeley) %G% * - * $Id: srvr_nfs.c,v 1.7.2.6 2002/01/21 00:49:42 ezk Exp $ + * $Id: srvr_nfs.c,v 1.7.2.7 2002/09/04 20:13:28 ib42 Exp $ * */ @@ -411,21 +411,21 @@ nfs_timed_out(voidp v) * Another ping has failed */ np->np_ping++; + if (np->np_ping > 1) + srvrlog(fs, "not responding"); /* * Not known to be up any longer */ - if (FSRV_ISUP(fs)) { + if (FSRV_ISUP(fs)) fs->fs_flags &= ~FSF_VALID; - if (np->np_ping > 1) - srvrlog(fs, "not responding"); - } /* * If ttl has expired then guess that it is dead */ if (np->np_ttl < clocktime()) { int oflags = fs->fs_flags; + dlog("ttl has expired"); if ((fs->fs_flags & FSF_DOWN) == 0) { /* * Server was up, but is now down. @@ -451,6 +451,10 @@ nfs_timed_out(voidp v) } if (oflags != fs->fs_flags && (fs->fs_flags & FSF_WANT)) wakeup_srvr(fs); + /* + * Reset failed ping count + */ + np->np_ping = 0; } else { #ifdef DEBUG if (np->np_ping > 1) @@ -458,6 +462,12 @@ nfs_timed_out(voidp v) #endif /* DEBUG */ } + /* + * New RPC xid, so any late responses to the previous ping + * get ignored... + */ + np->np_xid = NPXID_ALLOC(struct ); + /* * Run keepalive again */