From b73fa104ea9e1651114377c1e4f8e05705edc6c3 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 9 Sep 2013 09:20:32 -0400 Subject: [PATCH] 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 --- src/afs/afs_dcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++) { -- 2.39.5