mkfs.f2fs: skip extension name that is too long
authorChao Yu <chao2.yu@samsung.com>
Mon, 30 Nov 2015 10:41:07 +0000 (10:41 +0000)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 2 Dec 2015 21:38:02 +0000 (13:38 -0800)
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>
mkfs/f2fs_format.c

index a29d7ef..212df60 100644 (file)
@@ -157,8 +157,13 @@ static void configure_extension_list(void)
        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;