From: NeilBrown Date: Sat, 3 Jul 2010 00:57:53 +0000 (+1000) Subject: Don't clear clean_reserved when allocating more X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=83f039a0721d10e50bbdccdafb5159bc0843a5dc;p=LaFS.git Don't clear clean_reserved when allocating more 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 --- diff --git a/segments.c b/segments.c index d73033a..5570360 100644 --- a/segments.c +++ b/segments.c @@ -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;