afs: Don't clear afs_CacheTooFull prematurely
authorAndrew Deason <adeason@sinenomine.net>
Thu, 14 Nov 2013 18:53:40 +0000 (12:53 -0600)
committerDerrick Brashear <shadow@your-file-system.com>
Sun, 12 Jan 2014 19:38:42 +0000 (11:38 -0800)
Currently, we can clear afs_CacheTooFull here, even if
afs_CacheIsTooFull() doesn't agree that the cache is no longer 'too
full'. This could theoretically result in afs_CacheTooFull being
cleared, even though the cache is indeed 'too full', according to
afs_CacheIsTooFull(). Just break here, and let afs_CacheIsTooFull()
decide.

This reverts a small part of 488c7c97854a4bd0ec67bcfe17df93b3fd025f88.
This part doesn't seem important to the functionality in that commit,
though; the rest of that commit is still here, and avoids the extra
work if we have calculated no needed space to free.

Change-Id: If0adce7fa2e88a970ddb202de02c8ff048d2ad15
Reviewed-on: http://gerrit.openafs.org/10460
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

src/afs/afs_dcache.c

index 872757a..06ab7ad 100644 (file)
@@ -452,7 +452,6 @@ afs_CacheTruncateDaemon(void)
                if (slots_needed || space_needed)
                    afs_GetDownD(slots_needed, &space_needed, 0);
                if ((space_needed <= 0) && (slots_needed <= 0)) {
-                   afs_CacheTooFull = 0;
                    break;
                }
                if (afs_termState == AFSOP_STOP_TRUNCDAEMON)