diff options
author | Wang Xiaojun <wangxiaojun11@huawei.com> | 2021-07-09 11:34:53 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2021-07-14 02:11:08 +0300 |
commit | 5417c98c12f6eeb1252130bcea3b943f5e273be7 (patch) | |
tree | 4c0a783d1177d35ed171ed1c9286fa8b1d031847 /fs | |
parent | 01f6afd0f3ccaa2d5f7fb87e7bd910dc17eef06b (diff) | |
download | linux-5417c98c12f6eeb1252130bcea3b943f5e273be7.tar.xz |
f2fs: avoid to create an empty string as the extension_list
When creating a file, we need to set the temperature based on
extension_list. If the empty string is a valid extension_list,
the is_extension_exist will always returns true,
which affects the separation of hot and cold.
Signed-off-by: Wang Xiaojun <wangxiaojun11@huawei.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 15fe30d3aeb5..b1725620c07d 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -351,7 +351,7 @@ static ssize_t __sbi_store(struct f2fs_attr *a, set = false; } - if (strlen(name) >= F2FS_EXTENSION_LEN) + if (!strlen(name) || strlen(name) >= F2FS_EXTENSION_LEN) return -EINVAL; down_write(&sbi->sb_lock); |