From: Chao Yu Date: Fri, 27 Jun 2025 02:38:18 +0000 (+0800) Subject: f2fs: fix to check upper boundary for gc_no_zoned_gc_percent X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a919ae794ad2dc6d04b3eea2f9bc86332c1630cc;p=users%2Fdwmw2%2Flinux.git 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 Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index d74472d96026a..bdef926b33771 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;