[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250627023818.146534-1-chao@kernel.org>
Date: Fri, 27 Jun 2025 10:38:17 +0800
From: Chao Yu <chao@...nel.org>
To: jaegeuk@...nel.org
Cc: linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org,
Chao Yu <chao@...nel.org>,
Daeho Jeong <daehojeong@...gle.com>
Subject: [PATCH 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 <daehojeong@...gle.com>
Signed-off-by: Chao Yu <chao@...nel.org>
---
fs/f2fs/sysfs.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index 2b5c35ce7b8c..d74472d96026 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -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;
--
2.49.0
Powered by blists - more mailing lists