diff options
author | Chao Yu <chao@kernel.org> | 2025-06-27 10:38:18 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-15 12:14:01 +0200 |
commit | ca525a64bb92107730b422047be31e08387ba54d (patch) | |
tree | bccb1156ef300b48cee3256650e94bff613a7eb8 | |
parent | 1f1efc11132a802abaa0d57308cf5cad25009130 (diff) |
f2fs: fix to check upper boundary for gc_no_zoned_gc_percent
[ Upstream commit a919ae794ad2dc6d04b3eea2f9bc86332c1630cc ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | fs/f2fs/sysfs.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index d79d8041b8b7..eb84b9418ac1 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -623,6 +623,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; |