Skip to content

Commit a26fd18

Browse files
chaseyugregkh
authored andcommitted
f2fs: fix to check upper boundary for gc_no_zoned_gc_percent
[ Upstream commit a919ae7 ] This patch adds missing upper boundary check while setting gc_no_zoned_gc_percent via sysfs. Fixes: 9a481a1 ("f2fs: create gc_no_zoned_gc_percent and gc_boost_zoned_gc_percent") Cc: Daeho Jeong <[email protected]> Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 2438e03 commit a26fd18

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_no_zoned_gc_percent")) {
632+
if (t > 100)
633+
return -EINVAL;
634+
*ui = (unsigned int)t;
635+
return count;
636+
}
637+
631638
if (!strcmp(a->attr.name, "gc_boost_zoned_gc_percent")) {
632639
if (t > 100)
633640
return -EINVAL;

0 commit comments

Comments
 (0)