From 14115da9fb81217c84d5b7a71382f498acac3769 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 14 Jun 2007 21:55:18 +0000 Subject: [PATCH] DEVEL15-windows-volstate-update-post-network-change-20070614 When the system's IP address list changes we invalidate the existing RX connections and probe all of the servers. A better algorithm is to probe all vldb servers, invalidate the rx connections, and then probe all file servers. (cherry picked from commit 0187bf2feb9a191ba0b7868905854c603cc5092c) --- src/WINNT/afsd/cm_daemon.c | 5 +++-- src/WINNT/afsd/cm_server.c | 8 +++++++- src/WINNT/afsd/cm_server.h | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/WINNT/afsd/cm_daemon.c b/src/WINNT/afsd/cm_daemon.c index 759db2ffdc..7dfc5ad802 100644 --- a/src/WINNT/afsd/cm_daemon.c +++ b/src/WINNT/afsd/cm_daemon.c @@ -59,10 +59,11 @@ void cm_IpAddrDaemon(long parm) while (daemon_ShutdownFlag == 0) { DWORD Result = NotifyAddrChange(NULL,NULL); if (Result == NO_ERROR && daemon_ShutdownFlag == 0) { - osi_Log0(afsd_logp, "cm_IpAddrDaemon CheckDownServers"); Sleep(2500); + osi_Log0(afsd_logp, "cm_IpAddrDaemon CheckDownServers"); + cm_CheckServers(CM_FLAG_CHECKVLDBSERVERS | CM_FLAG_CHECKUPSERVERS | CM_FLAG_CHECKDOWNSERVERS, NULL); cm_ForceNewConnectionsAllServers(); - cm_CheckServers(CM_FLAG_CHECKUPSERVERS | CM_FLAG_CHECKDOWNSERVERS, NULL); + cm_CheckServers(CM_FLAG_CHECKFILESERVERS | CM_FLAG_CHECKUPSERVERS | CM_FLAG_CHECKDOWNSERVERS, NULL); smb_CheckVCs(); } } diff --git a/src/WINNT/afsd/cm_server.c b/src/WINNT/afsd/cm_server.c index 89f749518b..9861d65c51 100644 --- a/src/WINNT/afsd/cm_server.c +++ b/src/WINNT/afsd/cm_server.c @@ -201,6 +201,7 @@ void cm_CheckServers(long flags, cm_cell_t *cellp) cm_server_t *tsp; int doPing; int isDown; + int isFS; lock_ObtainWrite(&cm_serverLock); for (tsp = cm_allServersp; tsp; tsp = tsp->allNextp) { @@ -212,6 +213,7 @@ void cm_CheckServers(long flags, cm_cell_t *cellp) doPing = 0; isDown = tsp->flags & CM_SERVERFLAG_DOWN; + isFS = tsp->type == CM_SERVER_FILE; /* only do the ping if the cell matches the requested cell, or we're * matching all cells (cellp == NULL), and if we've requested to ping @@ -219,7 +221,11 @@ void cm_CheckServers(long flags, cm_cell_t *cellp) */ if ((cellp == NULL || cellp == tsp->cellp) && ((isDown && (flags & CM_FLAG_CHECKDOWNSERVERS)) || - (!isDown && (flags & CM_FLAG_CHECKUPSERVERS)))) { + (!isDown && (flags & CM_FLAG_CHECKUPSERVERS))) && + ((!(flags & CM_FLAG_CHECKVLDBSERVERS) || + !isFS && (flags & CM_FLAG_CHECKVLDBSERVERS)) && + (!(flags & CM_FLAG_CHECKFILESERVERS) || + isFS && (flags & CM_FLAG_CHECKFILESERVERS)))) { doPing = 1; } /* we're supposed to check this up/down server */ lock_ReleaseMutex(&tsp->mx); diff --git a/src/WINNT/afsd/cm_server.h b/src/WINNT/afsd/cm_server.h index ae40886c33..85c72c257f 100644 --- a/src/WINNT/afsd/cm_server.h +++ b/src/WINNT/afsd/cm_server.h @@ -67,6 +67,8 @@ typedef struct cm_serverRef { /* flags for procedures */ #define CM_FLAG_CHECKUPSERVERS 1 /* check working servers */ #define CM_FLAG_CHECKDOWNSERVERS 2 /* check down servers */ +#define CM_FLAG_CHECKVLDBSERVERS 4 /* check only vldb servers */ +#define CM_FLAG_CHECKFILESERVERS 8 /* check only file servers */ /* values for ipRank */ #define CM_IPRANK_TOP 5000 /* on same machine */