aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/sysfs.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2019-01-04 17:39:53 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2019-01-08 20:41:09 -0800
commit36c5733f9570e9052a6437012be8034085f25ab7 (patch)
tree70f16160e61b763912657c6235bdbf0eec907958 /fs/f2fs/sysfs.c
parentf2fs: remove set but not used variable 'err' (diff)
downloadlinux-dev-36c5733f9570e9052a6437012be8034085f25ab7.tar.xz
linux-dev-36c5733f9570e9052a6437012be8034085f25ab7.zip
f2fs: check inject_rate validity during configuring
Type of inject_rate is unsigned int, let's check new value's validity during configuring. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/sysfs.c')
-rw-r--r--fs/f2fs/sysfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index 0575edbe3ed6..02d4012a9183 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -222,6 +222,8 @@ out:
#ifdef CONFIG_F2FS_FAULT_INJECTION
if (a->struct_type == FAULT_INFO_TYPE && t >= (1 << FAULT_MAX))
return -EINVAL;
+ if (a->struct_type == FAULT_INFO_RATE && t >= UINT_MAX)
+ return -EINVAL;
#endif
if (a->struct_type == RESERVED_BLOCKS) {
spin_lock(&sbi->stat_lock);