From: NeilBrown Date: Tue, 3 May 2011 04:16:11 +0000 (+1000) Subject: cleaner: revise rules for emergency clean. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=6115a48840935326f36a9603a2b24d8be72c5575;p=LaFS.git cleaner: revise rules for emergency clean. Normally we only clean when there is free space available for dedicated cleaning segments. However if space is tight we might need to clean to the main segment. Do this only if there are no 'clean' segments (otherwise force a checkpoint so those clean segments become free). clean_reserved doesn't really factor into this decision. Signed-off-by: NeilBrown --- diff --git a/clean.c b/clean.c index b5b026f..ebe329c 100644 --- a/clean.c +++ b/clean.c @@ -629,14 +629,12 @@ unsigned long lafs_do_clean(struct fs *fs) /* If we can only clean to main segment, we may * have to. However: * - only do one segment at a time - * - if there is any clean_reserved, then use it - * - if there are no 'clean' segments, then clean. + * - only if there are no clean (but not yet free) segments * - if CleanerBlocks, then clean. * otherwise don't. */ - if (fs->clean_reserved - || fs->segtrack->clean.cnt == 0 - || test_bit(CleanerBlocks, &fs->fsstate)) + if (fs->segtrack->clean.cnt == 0 + && test_bit(CleanerBlocks, &fs->fsstate)) max_segs = 1; } for (i = 0; i < max_segs; i++) {