Windows: validate buffer hash tables in cm_MergeStatus

Change-Id: I1ff76513e9f2ba08bdeb988a19fec992b08310db
Reviewed-on: http://gerrit.openafs.org/5425
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Jeffrey Altman 2011-09-14 17:46:32 -04:00 committed by Jeffrey Altman
parent febbd0f1ae
commit cf57eb294f
2 changed files with 5 additions and 2 deletions

View File

@ -888,7 +888,7 @@ void buf_Recycle(cm_buf_t *bp)
i = BUF_HASH(&bp->fid, &bp->offset);
lbpp = &(cm_data.buf_scacheHashTablepp[i]);
for(tbp = *lbpp; tbp; lbpp = &tbp->hashp, tbp = *lbpp) {
for(tbp = *lbpp; tbp; lbpp = &tbp->hashp, tbp = tbp->hashp) {
if (tbp == bp)
break;
}

View File

@ -1646,11 +1646,14 @@ void cm_MergeStatus(cm_scache_t *dscp,
j = BUF_HASH(&bp->fid, &bp->offset);
lbpp = &(cm_data.buf_scacheHashTablepp[j]);
for(tbp = *lbpp; tbp; lbpp = &tbp->hashp, tbp = *lbpp) {
for(tbp = *lbpp; tbp; lbpp = &tbp->hashp, tbp = tbp->hashp) {
if (tbp == bp)
break;
}
/* we better find it */
osi_assertx(tbp != NULL, "cm_MergeStatus: buf_scacheHashTablepp table screwup");
*lbpp = bp->hashp; /* hash out */
bp->hashp = NULL;