]> git.neil.brown.name Git - LaFS.git/commitdiff
cleaner: revise rules for emergency clean.
authorNeilBrown <neilb@suse.de>
Tue, 3 May 2011 04:16:11 +0000 (14:16 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 3 May 2011 04:16:11 +0000 (14:16 +1000)
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 <neilb@suse.de>
clean.c

diff --git a/clean.c b/clean.c
index b5b026faf2167d5b3fec1f5abb5c4edcd21e5559..ebe329c8de8d242751bbf3d56f0bac58eb099735 100644 (file)
--- 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++) {