Windows: fs checkservers should list vldb as well
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 23 Dec 2010 04:23:48 +0000 (23:23 -0500)
committerJeffrey Altman <jaltman@openafs.org>
Tue, 28 Dec 2010 21:11:52 +0000 (13:11 -0800)
The Windows fs checkservers has only listed offline
file servers.  Include vldb as well to match the Unix
cache manager.

Change-Id: I81b8e4a1a813fcd8f19e3dc58c75ef161795518c
Reviewed-on: http://gerrit.openafs.org/3602
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 1624cbf..91c9604 100644 (file)
@@ -1268,10 +1268,20 @@ cm_IoctlCheckServers(struct cm_ioctl *ioctlp, struct cm_user *userp)
     for (tsp = cm_allServersp; tsp; tsp=tsp->allNextp) {
         if (cellp && tsp->cellp != cellp) 
             continue;  /* cell spec'd and wrong */
-        if ((tsp->flags & CM_SERVERFLAG_DOWN)
-            && tsp->type == CM_SERVER_FILE) {
-            memcpy(cp, (char *)&tsp->addr.sin_addr.s_addr, sizeof(long));
-            cp += sizeof(long);
+        if (tsp->flags & CM_SERVERFLAG_DOWN) {
+            /*
+             * all server types are being reported by ipaddr.  only report
+             * a server once regardless of how many services are down.
+             */
+            for (tp = ioctlp->outDatap; tp < cp; tp += sizeof(long)) {
+                if (!memcmp(tp, (char *)&tsp->addr.sin_addr.s_addr, sizeof(long)))
+                    break;
+            }
+
+            if (tp == cp) {
+                memcpy(cp, (char *)&tsp->addr.sin_addr.s_addr, sizeof(long));
+                cp += sizeof(long);
+            }
         }
     }
     lock_ReleaseRead(&cm_serverLock);