summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryohan.joung <yohan.joung@sk.com>2025-06-25 09:14:07 +0900
committerJaegeuk Kim <jaegeuk@kernel.org>2025-06-30 16:43:58 +0000
commit10dcaa56ef93f2a45e4c3fec27d8e1594edad110 (patch)
tree6e916d52d40529c9ec007556807b63b8ee5c3f49
parent154467f4ad033473e5c903a03e7b9bca7df9a0fa (diff)
downloadlinux-10dcaa56ef93f2a45e4c3fec27d8e1594edad110.tar.gz
linux-10dcaa56ef93f2a45e4c3fec27d8e1594edad110.zip
f2fs: fix to check upper boundary for value of gc_boost_zoned_gc_percent
to check the upper boundary when setting gc_boost_zoned_gc_percent Fixes: 9a481a1c16f4 ("f2fs: create gc_no_zoned_gc_percent and gc_boost_zoned_gc_percent") Signed-off-by: yohan.joung <yohan.joung@sk.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/sysfs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index 51be7ffb38c5..2b5c35ce7b8c 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -628,6 +628,13 @@ out:
return count;
}
+ if (!strcmp(a->attr.name, "gc_boost_zoned_gc_percent")) {
+ if (t > 100)
+ return -EINVAL;
+ *ui = (unsigned int)t;
+ return count;
+ }
+
#ifdef CONFIG_F2FS_IOSTAT
if (!strcmp(a->attr.name, "iostat_enable")) {
sbi->iostat_enable = !!t;