mkfs.f2fs: skip extension name that is too long

The length of extension name has a limit of 8 bytes. If an extension
exceeds the limitation, it will not be added to the extension_list.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index a29d7ef..212df60 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -157,8 +157,13 @@
 	ue = strtok(ext_str, ", ");
 	while (ue != NULL) {
 		name_len = strlen(ue);
+		if (name_len >= 8) {
+			MSG(0, "\tWarn: Extension name (%s) is too long\n", ue);
+			goto next;
+		}
 		if (!is_extension_exist(ue))
 			memcpy(sb.extension_list[i++], ue, name_len);
+next:
 		ue = strtok(NULL, ", ");
 		if (i >= F2FS_MAX_EXTENSION)
 			break;