ViceLog(0, ("h_Enumerate found %d of %d hosts\n", count, hostCount));
} else if (host != NULL) {
ViceLog(0, ("h_Enumerate found more than %d hosts\n", hostCount));
- assert(0);
+ ShutDownAndCore(PANIC);
}
H_UNLOCK;
for (i = 0; i < count; i++) {
register struct host *host, *next;
int flags = 0;
int nflags = 0;
+ int count;
if (hostCount == 0) {
return;
}
h_Hold_r(enumstart);
- for (host = enumstart; host; host = next, flags = nflags) {
+ for (count = 0, host = enumstart; host && count < hostCount; host = next, flags = nflags, count++) {
next = host->next;
if (next && !H_ENUMERATE_ISSET_BAIL(flags))
h_Hold_r(next);
}
h_Release_r(host); /* this might free up the host */
}
+ if (host != NULL) {
+ ViceLog(0, ("h_Enumerate_r found more than %d hosts\n", hostCount));
+ ShutDownAndCore(PANIC);
+ }
} /*h_Enumerate_r */
{
register struct client *client;
register struct host *host;
+ int count;
H_LOCK;
- for (host = hostList; host; host = host->next) {
+ for (count = 0, host = hostList; host && count < hostCount; host = host->next, count++) {
if (host->hostFlags & HOSTDELETED)
continue;
for (client = host->FirstClient; client; client = client->next) {
}
}
}
+ if (count != hostCount) {
+ ViceLog(0, ("h_ID2Client found %d of %d hosts\n", count, hostCount));
+ } else if (host != NULL) {
+ ViceLog(0, ("h_ID2Client found more than %d hosts\n", hostCount));
+ ShutDownAndCore(PANIC);
+ }
H_UNLOCK;
return NULL;
{
register struct host *host;
register int num = 0, active = 0, del = 0;
+ int count;
H_LOCK;
- for (host = hostList; host; host = host->next) {
+ for (count = 0, host = hostList; host && count < hostCount; host = host->next, count++) {
if (!(host->hostFlags & HOSTDELETED)) {
num++;
if (host->ActiveCall > cutofftime)
del++;
}
}
+ if (count != hostCount) {
+ ViceLog(0, ("h_GetWorkStats found %d of %d hosts\n", count, hostCount));
+ } else if (host != NULL) {
+ ViceLog(0, ("h_GetWorkStats found more than %d hosts\n", hostCount));
+ ShutDownAndCore(PANIC);
+ }
H_UNLOCK;
if (nump)
*nump = num;
register struct host *hostP; /*Ptr to current host entry */
register afs_uint32 currAddr_HBO; /*Curr host addr, host byte order */
+ int count;
/*
* Clear out the storage pointed to by our parameters.
*a_diffNetworkP = (afs_int32) 0;
H_LOCK;
- for (hostP = hostList; hostP; hostP = hostP->next) {
+ for (count = 0, hostP = hostList; hostP && count < hostCount; hostP = hostP->next, count++) {
if (!(hostP->hostFlags & HOSTDELETED)) {
/*
* Bump the number of undeleted host entries found.
a_diffNetworkP);
} /*Only look at non-deleted hosts */
} /*For each host record hashed to this index */
+ if (count != hostCount) {
+ ViceLog(0, ("h_GetHostNetStats found %d of %d hosts\n", count, hostCount));
+ } else if (hostP != NULL) {
+ ViceLog(0, ("h_GetHostNetStats found more than %d hosts\n", hostCount));
+ ShutDownAndCore(PANIC);
+ }
H_UNLOCK;
} /*h_GetHostNetStats */