]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afs: CacheTruncateDaemon work until Cache Drained
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 9 Sep 2013 13:20:32 +0000 (09:20 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 14 Nov 2013 13:29:56 +0000 (05:29 -0800)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/afs_dcache.c

index 3514fda35cbf10df54fbab4e3ef43ea61f59cbc0..18117995dc08c6485291737236f6a9e8ab95119c 100644 (file)
@@ -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++) {