]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
f2fs: fix to check upper boundary for value of gc_boost_zoned_gc_percent
authoryohan.joung <yohan.joung@sk.com>
Wed, 25 Jun 2025 00:14:07 +0000 (09:14 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:14:00 +0000 (12:14 +0200)
[ Upstream commit 10dcaa56ef93f2a45e4c3fec27d8e1594edad110 ]

to check the upper boundary when setting gc_boost_zoned_gc_percent

Fixes: 9a481a1c16f4 ("f2fs: create gc_no_zoned_gc_percent and gc_boost_zoned_gc_percent")
Signed-off-by: yohan.joung <yohan.joung@sk.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/sysfs.c

index 7df638f901a1f59d7e47d5b44e2297457c1a4fa9..b450046c24abdbdf8a437f4a8a01f2ab06620947 100644 (file)
@@ -623,6 +623,13 @@ out:
                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;