diff options
| author | Chao Yu <chao@kernel.org> | 2025-06-27 10:38:18 +0800 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2025-06-30 16:44:52 +0000 |
| commit | a919ae794ad2dc6d04b3eea2f9bc86332c1630cc (patch) | |
| tree | 6e083e9b688aa9ce121d7f05a43bd4f83fc959ab | |
| parent | 7a96d1d73ce9de5041e891a623b722f900651561 (diff) | |
| download | linux-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.c | 7 |
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; |
