Skip to content

Commit ee5fc39

Browse files
yohanjounggregkh
authored andcommitted
f2fs: fix to check upper boundary for value of gc_boost_zoned_gc_percent
[ Upstream commit 10dcaa5 ] to check the upper boundary when setting gc_boost_zoned_gc_percent Fixes: 9a481a1 ("f2fs: create gc_no_zoned_gc_percent and gc_boost_zoned_gc_percent") Signed-off-by: yohan.joung <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 01b6f59 commit ee5fc39

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/f2fs/sysfs.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,13 @@ static ssize_t __sbi_store(struct f2fs_attr *a,
628628
return count;
629629
}
630630

631+
if (!strcmp(a->attr.name, "gc_boost_zoned_gc_percent")) {
632+
if (t > 100)
633+
return -EINVAL;
634+
*ui = (unsigned int)t;
635+
return count;
636+
}
637+
631638
#ifdef CONFIG_F2FS_IOSTAT
632639
if (!strcmp(a->attr.name, "iostat_enable")) {
633640
sbi->iostat_enable = !!t;

0 commit comments

Comments
 (0)