From: Jeffrey Altman Date: Mon, 9 Sep 2013 13:20:32 +0000 (-0400) Subject: afs: CacheTruncateDaemon work until Cache Drained X-Git-Tag: upstream/1.8.0_pre1^2~947 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b73fa104ea9e1651114377c1e4f8e05705edc6c3;p=packages%2Fo%2Fopenafs.git afs: CacheTruncateDaemon work until Cache Drained The afs_CacheTruncateDeamon() thread will not sleep until both 'afs_CacheTooFull' and 'afs_WaitForCacheDrain' are true but the thread will stop freeing space in the cache when 'afs_CacheTooFull' is true which prevents 'afs_WaitForCacheDrain' from ever becoming true if it is not already. Make the conditional for doing work include 'afs_WaitForCacheDrain'. Change-Id: I9a60da6db65511c8bf2391a53a6f76043f825078 Reviewed-on: http://gerrit.openafs.org/10238 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 9b7daa641..d3c329f53 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -436,7 +436,7 @@ afs_CacheTruncateDaemon(void) while (1) { cb_lowat = PERCENT((CM_DCACHESPACEFREEPCT - CM_DCACHEEXTRAPCT), afs_cacheBlocks); ObtainWriteLock(&afs_xdcache, 266); - if (afs_CacheTooFull) { + if (afs_CacheTooFull || afs_WaitForCacheDrain) { int space_needed, slots_needed; /* if we get woken up, we should try to clean something out */ for (counter = 0; counter < 10; counter++) {