From: Daeho Jeong Date: Thu, 29 May 2025 22:25:32 +0000 (-0700) Subject: f2fs: make sure zoned device GC to use FG_GC in shortage of free section X-Git-Tag: io_uring-6.17-20250815~47^2~108 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=24bf3ee37fb8ed736094247133d00cb2c3bab3ce;p=linux-block.git f2fs: make sure zoned device GC to use FG_GC in shortage of free section We already use FG_GC when we have free sections under gc_boost_zoned_gc_percent. So, let's make it consistent. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 3cb5242f4ddf..439f0153c24e 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -144,7 +144,7 @@ do_gc: gc_control.one_time; /* foreground GC was been triggered via f2fs_balance_fs() */ - if (foreground) + if (foreground && !f2fs_sb_has_blkzoned(sbi)) sync_mode = false; gc_control.init_gc_type = sync_mode ? FG_GC : BG_GC; diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index ae1223ef648f..dad5a92b7e70 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -455,7 +455,8 @@ void f2fs_balance_fs(struct f2fs_sb_info *sbi, bool need) } else { struct f2fs_gc_control gc_control = { .victim_segno = NULL_SEGNO, - .init_gc_type = BG_GC, + .init_gc_type = f2fs_sb_has_blkzoned(sbi) ? + FG_GC : BG_GC, .no_bg_gc = true, .should_migrate_blocks = false, .err_gc_skipped = false,