From: Chao Yu Date: Tue, 18 Jan 2022 03:48:02 +0000 (+0800) Subject: f2fs: fix to enable ATGC correctly via gc_idle sysfs interface X-Git-Tag: v5.17.2~856 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ba7d90c0e893659284081830423e0073cf88976d;p=users%2Fdwmw2%2Flinux.git f2fs: fix to enable ATGC correctly via gc_idle sysfs interface [ Upstream commit 7d19e3dab0002e527052b0aaf986e8c32e5537bf ] It needs to assign sbi->gc_mode with GC_IDLE_AT rather than GC_AT when user tries to enable ATGC via gc_idle sysfs interface, fix it. Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection") Cc: Zhipeng Tan Signed-off-by: Jicheng Shao Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 8ac5066712454..bdb1b5c05be2e 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -481,7 +481,7 @@ out: } else if (t == GC_IDLE_AT) { if (!sbi->am.atgc_enabled) return -EINVAL; - sbi->gc_mode = GC_AT; + sbi->gc_mode = GC_IDLE_AT; } else { sbi->gc_mode = GC_NORMAL; }