From: Jeffrey Altman Date: Sat, 6 Aug 2005 01:36:11 +0000 (+0000) Subject: STABLE14-windows-afscache-validate-20050806 X-Git-Tag: openafs-devel-1_3_87~7 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3baa6bfe3680e6266d5c5d8cff681878be2ce44d;p=packages%2Fo%2Fopenafs.git STABLE14-windows-afscache-validate-20050806 Ensure that queues that have forward and reverse pointers are consistent that either both are NULL or neither are. (cherry picked from commit 4d0a6e73bf46847766512c15d2466627237409e5) --- diff --git a/src/WINNT/afsd/cm_aclent.c b/src/WINNT/afsd/cm_aclent.c index 42a0c0ac6..e34470a10 100644 --- a/src/WINNT/afsd/cm_aclent.c +++ b/src/WINNT/afsd/cm_aclent.c @@ -190,6 +190,13 @@ long cm_ValidateACLCache(void) long count; cm_aclent_t * aclp; + if ( cm_data.aclLRUp == NULL && cm_data.aclLRUEndp != NULL || + cm_data.aclLRUp != NULL && cm_data.aclLRUEndp == NULL) { + afsi_log("cm_ValidateACLCache failure: inconsistent LRU pointers"); + fprintf(stderr, "cm_ValidateACLCache failure: inconsistent LRU pointers\n"); + return -9; + } + for ( aclp = cm_data.aclLRUp, count = 0; aclp; aclp = (cm_aclent_t *) osi_QNext(&aclp->q), count++ ) { if (aclp->magic != CM_ACLENT_MAGIC) { diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index 98b63f823..a564660d7 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -156,6 +156,13 @@ buf_ValidateBuffers(void) cm_buf_t * bp, *bpf, *bpa, *bpb; afs_uint32 countb = 0, countf = 0, counta = 0; + if (cm_data.buf_freeListp == NULL && cm_data.buf_freeListEndp != NULL || + cm_data.buf_freeListp != NULL && cm_data.buf_freeListEndp == NULL) { + afsi_log("cm_ValidateBuffers failure: inconsistent free list pointers"); + fprintf(stderr, "cm_ValidateBuffers failure: inconsistent free list pointers\n"); + return -9; + } + for (bp = cm_data.buf_freeListEndp; bp; bp=(cm_buf_t *) osi_QPrev(&bp->q)) { if (bp->magic != CM_BUF_MAGIC) { afsi_log("cm_ValidateBuffers failure: bp->magic != CM_BUF_MAGIC"); @@ -470,7 +477,7 @@ void buf_WaitIO(cm_scache_t * scp, cm_buf_t *bp) lock_ObtainMutex(&scp->mx); if (scp->flags & CM_SCACHEFLAG_WAITING) { osi_Log1(buf_logp, "buf_WaitIO waking scp 0x%x", scp); - osi_Wakeup(&scp->flags); + osi_Wakeup((long)&scp->flags); lock_ReleaseMutex(&scp->mx); } } diff --git a/src/WINNT/afsd/cm_scache.c b/src/WINNT/afsd/cm_scache.c index afe29e105..dc6387dcb 100644 --- a/src/WINNT/afsd/cm_scache.c +++ b/src/WINNT/afsd/cm_scache.c @@ -203,6 +203,13 @@ cm_ValidateSCache(void) cm_scache_t * scp, *lscp; long i; + if ( cm_data.scacheLRUFirstp == NULL && cm_data.scacheLRULastp != NULL || + cm_data.scacheLRUFirstp != NULL && cm_data.scacheLRULastp == NULL) { + afsi_log("cm_ValidateSCache failure: inconsistent LRU pointers"); + fprintf(stderr, "cm_ValidateSCache failure: inconsistent LRU pointers\n"); + return -17; + } + for ( scp = cm_data.scacheLRUFirstp, lscp = NULL, i = 0; scp; lscp = scp, scp = (cm_scache_t *) osi_QNext(&scp->q), i++ ) {