summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2025-06-27 10:38:18 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2025-06-30 16:44:52 +0000
commita919ae794ad2dc6d04b3eea2f9bc86332c1630cc (patch)
tree6e083e9b688aa9ce121d7f05a43bd4f83fc959ab
parent7a96d1d73ce9de5041e891a623b722f900651561 (diff)
downloadlinux-a919ae794ad2dc6d04b3eea2f9bc86332c1630cc.tar.gz
linux-a919ae794ad2dc6d04b3eea2f9bc86332c1630cc.zip
f2fs: fix to check upper boundary for gc_no_zoned_gc_percent
This patch adds missing upper boundary check while setting gc_no_zoned_gc_percent via sysfs. Fixes: 9a481a1c16f4 ("f2fs: create gc_no_zoned_gc_percent and gc_boost_zoned_gc_percent") Cc: Daeho Jeong <daehojeong@google.com> Signed-off-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 d74472d96026..bdef926b3377 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -628,6 +628,13 @@ out:
return count;
}
+ if (!strcmp(a->attr.name, "gc_no_zoned_gc_percent")) {
+ if (t > 100)
+ return -EINVAL;
+ *ui = (unsigned int)t;
+ return count;
+ }
+
if (!strcmp(a->attr.name, "gc_boost_zoned_gc_percent")) {
if (t > 100)
return -EINVAL;