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.6.6_pre2^2~17 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7d70e9819bb42ad45defb961fb5cee97653349b8;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: Id25929080eecd390d4ed56e5fffd6fe56cc8502c Reviewed-on: http://gerrit.openafs.org/10436 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Benjamin Kaduk Reviewed-by: Stephan Wiesand --- diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 3514fda35..18117995d 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++) {