f2fs: fix to check upper boundary for gc_valid_thresh_ratio
Chao Yu
maintainerPATCH 1/2 f2fs: fix to check upper boundary for gc_valid_thresh_ratio
This patch adds missing upper boundary check while setting gc_valid_thresh_ratio via sysfs.
Fixes e791d00bd06c ("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]>
--- fs/f2fs/sysfs.c | 7 +++++++ 1 file changed, 7 insertions(+)
fs/f2fs/sysfs.c +7 -0
@@ -635,6 +635,13 @@ static ssize_t __sbi_store(struct f2fs_attr *a,return count; } +if (!strcmp (a->attr.name,"gc_valid_thresh_ratio" )) { +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;
Signature · 1 line
2.49.0
Chao Yu
maintainerPATCH 2/2 f2fs: fix to check upper boundary for gc_no_zoned_gc_percent
This patch adds missing upper boundary check while setting gc_no_zoned_gc_percent via sysfs.
Fixes 9a481a1c16f4 ("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]>
--- fs/f2fs/sysfs.c | 7 +++++++ 1 file changed, 7 insertions(+)
fs/f2fs/sysfs.c +7 -0
@@ -628,6 +628,13 @@ static ssize_t __sbi_store(struct f2fs_attr *a,return count; } +if (!strcmp (a->attr.name,"gc_no_zoned_gc_percent" )) { +if (t >100 ) +return -EINVAL ; + *ui = (unsigned int )t; +return count; + } +if (!strcmp (a->attr.name,"gc_boost_zoned_gc_percent" )) {if (t >100 )return -EINVAL ;
Signature · 1 line
2.49.0
This series was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:
Hello:
This series was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:
Quoted 8 lines · On Fri, 27 Jun 2025 10:38:17 +0800 you wrote:
This patch adds missing upper boundary check while setting
gc_valid_thresh_ratiovia sysfs.Fixes e791d00bd06c ("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]>[...]
Here is the summary with links:
- [f2fs-dev,1/2] f2fs: fix to check upper boundary for gc_valid_thresh_ratio
https://git.kernel.org/jaegeuk/f2fs/c/7a96d1d73ce9 - [f2fs-dev,2/2] f2fs: fix to check upper boundary for gc_no_zoned_gc_percent https://git.kernel.org/jaegeuk/f2fs/c/a919ae794ad2
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html