]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: fs checkserver skip multi-homed up server
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 28 Dec 2010 19:39:47 +0000 (14:39 -0500)
committerDerrick Brashear <shadow@dementia.org>
Thu, 3 Feb 2011 02:39:07 +0000 (18:39 -0800)
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 <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 4e3207335771b78ff27a1f1c0755cdfcf78d7f30)

Change-Id: Idc6ae445bc9fad467dede51d5885646bb610c0ef
Reviewed-on: http://gerrit.openafs.org/3809
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/WINNT/afsd/cm_ioctl.c

index 6049e3f83ccd3ca9928679b5678d1b3e09ee5232..3253f15c001e06974e35f4af4ff11f7600b599f3 100644 (file)
@@ -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.