[PATCH] f2fs: fix to check upper boundary for value of gc_boost_zoned_gc_percent

yohan.joung posted 1 patch 3 months, 2 weeks ago
fs/f2fs/sysfs.c | 7 +++++++
1 file changed, 7 insertions(+)
[PATCH] f2fs: fix to check upper boundary for value of gc_boost_zoned_gc_percent
Posted by yohan.joung 3 months, 2 weeks ago
to check the upper boundary when setting gc_boost_zoned_gc_percent

Signed-off-by: yohan.joung <yohan.joung@sk.com>
---
 fs/f2fs/sysfs.c | 7 +++++++
 1 file changed, 7 insertions(+)

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 @@ static ssize_t __sbi_store(struct f2fs_attr *a,
 		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;
-- 
2.33.0
Re: [PATCH] f2fs: fix to check upper boundary for value of gc_boost_zoned_gc_percent
Posted by Chao Yu 3 months, 2 weeks ago
On 6/25/25 08:14, yohan.joung wrote:
> to check the upper boundary when setting gc_boost_zoned_gc_percent
> 
> Signed-off-by: yohan.joung <yohan.joung@sk.com>

Fixes: 9a481a1c16f4 ("f2fs: create gc_no_zoned_gc_percent and gc_boost_zoned_gc_percent")

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,