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)
committerJeffrey Altman <jaltman@openafs.org>
Tue, 28 Dec 2010 21:12:06 +0000 (13:12 -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.

Change-Id: I718eeee3316d05a33a4af97ca6c7fd947db41f44
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>

src/WINNT/afsd/cm_ioctl.c

index 91c9604..b4d1d95 100644 (file)
@@ -1208,7 +1208,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;
@@ -1270,6 +1270,22 @@ cm_IoctlCheckServers(struct cm_ioctl *ioctlp, struct cm_user *userp)
             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.
              */