Skip to content

Commit 54c4ee2

Browse files
chaseyugregkh
authored andcommitted
f2fs: fix to check upper boundary for gc_valid_thresh_ratio
[ Upstream commit 7a96d1d ] This patch adds missing upper boundary check while setting gc_valid_thresh_ratio via sysfs. Fixes: e791d00 ("f2fs: add valid block ratio not to do excessive GC for one time GC") 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 ee5fc39 commit 54c4ee2

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
@@ -635,6 +635,13 @@ static ssize_t __sbi_store(struct f2fs_attr *a,
635635
return count;
636636
}
637637

638+
if (!strcmp(a->attr.name, "gc_valid_thresh_ratio")) {
639+
if (t > 100)
640+
return -EINVAL;
641+
*ui = (unsigned int)t;
642+
return count;
643+
}
644+
638645
#ifdef CONFIG_F2FS_IOSTAT
639646
if (!strcmp(a->attr.name, "iostat_enable")) {
640647
sbi->iostat_enable = !!t;

0 commit comments

Comments
 (0)