diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 2eaa50d7a5..f7476a0645 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -989,7 +989,7 @@ afs_FlushDCache(struct dcache *adc) } if (afs_WaitForCacheDrain) { - if (afs_blocksUsed <= + if ((afs_blocksUsed - afs_blocksDiscarded) <= PERCENT(CM_CACHESIZEDRAINEDPCT, afs_cacheBlocks)) { afs_WaitForCacheDrain = 0; afs_osi_Wakeup(&afs_WaitForCacheDrain);