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>
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;