f2fs: fix to enable ATGC correctly via gc_idle sysfs interface
authorChao Yu <chao@kernel.org>
Tue, 18 Jan 2022 03:48:02 +0000 (11:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:10 +0000 (14:23 +0200)
[ 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 <tanzhipeng@hust.edu.cn>
Signed-off-by: Jicheng Shao <shaojicheng@hust.edu.cn>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/sysfs.c

index abc4344fba394d4a3c8bfa29b9f404ef9568dbda..8b36e61fe7edbde5eb8b6ea3ae175d849d428ea1 100644 (file)
@@ -473,7 +473,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;
                }