f2fs: avoid to create an empty string as the extension_list
PATCH v2 1/1 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 <[email protected]>
---
v1->v2:let the caller do the check on @name
--- fs/f2fs/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/sysfs.c +1 -1
@@ -337,7 +337,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);
Signature · 8 lines
2.25.4 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 6 lines · Wang Xiaojun
When creating a file, we need to set the temperature based on
extension_list. If the empty string is a validextension_list, theis_extension_existwill always returns true, which affects the separation of hot and cold.Signed-off-by Wang Xiaojun <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel