]> git.neil.brown.name Git - LaFS.git/commitdiff
Don't clear clean_reserved when allocating more
authorNeilBrown <neilb@suse.de>
Sat, 3 Jul 2010 00:57:53 +0000 (10:57 +1000)
committerNeilBrown <neilb@suse.de>
Sat, 3 Jul 2010 00:57:53 +0000 (10:57 +1000)
If the allocation should fail we will have reduced the
allocation, and there could still be an open cleaner-segment
which would thus be confused.

Signed-off-by: NeilBrown <neilb@suse.de>
segments.c

index d73033a1c2b92e0cce82aa6908de014f6fafc896..55703606557c54aedaeb83f0730f579838c92fbf 100644 (file)
@@ -578,8 +578,6 @@ int lafs_alloc_cleaner_segs(struct fs *fs, int max)
        int watermark = fs->max_segment * 4;
        int rv = 0;
        spin_lock(&fs->alloc_lock);
-       fs->free_blocks += fs->clean_reserved;
-       fs->clean_reserved = 0;
        while (fs->clean_reserved < max * fs->max_segment &&
               fs->free_blocks > fs->allocated_blocks + watermark) {
                fs->clean_reserved += fs->max_segment;