From 8c7b9ac129d0962faa6f8b092424eab3427cc364 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Sun, 9 Feb 2020 13:27:09 -0800 Subject: [PATCH] f2fs: add migration count iff migration happens If first segment is empty and migration_granularity is 1, we can't move this at all. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index a19966b..bb0b643 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1240,12 +1240,12 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, segno, gc_type); stat_inc_seg_count(sbi, type, gc_type); + migrated++; freed: if (gc_type == FG_GC && get_valid_blocks(sbi, segno, false) == 0) seg_freed++; - migrated++; if (__is_large_section(sbi) && segno + 1 < end_segno) sbi->next_victim_seg[gc_type] = segno + 1; -- 2.7.4