From: Jeffrey Altman Date: Tue, 28 Dec 2010 19:39:47 +0000 (-0500) Subject: Windows: fs checkserver skip multi-homed up server X-Git-Tag: upstream/1.6.0.pre2^2~95 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3cafe5836603f4fb93b05b994767487da04fb722;p=packages%2Fo%2Fopenafs.git Windows: fs checkserver skip multi-homed up server Multi-homed file servers can be detected by comparing the uuid for the cm_server_t entries. If a server has at least one up interface, do not list it as being down in the "fs checkserver" response list. Reviewed-on: http://gerrit.openafs.org/3603 Tested-by: BuildBot Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman (cherry picked from commit 4e3207335771b78ff27a1f1c0755cdfcf78d7f30) Change-Id: Idc6ae445bc9fad467dede51d5885646bb610c0ef Reviewed-on: http://gerrit.openafs.org/3809 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/WINNT/afsd/cm_ioctl.c b/src/WINNT/afsd/cm_ioctl.c index 6049e3f83..3253f15c0 100644 --- a/src/WINNT/afsd/cm_ioctl.c +++ b/src/WINNT/afsd/cm_ioctl.c @@ -1205,7 +1205,7 @@ cm_IoctlCheckServers(struct cm_ioctl *ioctlp, struct cm_user *userp) char *tp; char *cp; long temp; - cm_server_t *tsp; + cm_server_t *tsp, *csp; int haveCell; tp = ioctlp->inDatap; @@ -1266,6 +1266,22 @@ cm_IoctlCheckServers(struct cm_ioctl *ioctlp, struct cm_user *userp) if (cellp && tsp->cellp != cellp) continue; /* cell spec'd and wrong */ if (tsp->flags & CM_SERVERFLAG_DOWN) { + /* + * for a multi-homed file server, if one of the interfaces + * is up, do not report the server as down. + */ + if (tsp->type == CM_SERVER_FILE) { + for (csp = cm_allServersp; csp; csp=csp->allNextp) { + if (csp->type == CM_SERVER_FILE && + !(csp->flags & CM_SERVERFLAG_DOWN) && + afs_uuid_equal(&tsp->uuid, &csp->uuid)) { + break; + } + } + if (csp) /* found alternate up interface */ + continue; + } + /* * all server types are being reported by ipaddr. only report * a server once regardless of how many services are down.