erofs-utils: mkfs: fix double write of long xattr name prefixes
authorJingbo Xu <jefflexu@linux.alibaba.com>
Thu, 10 Aug 2023 06:46:32 +0000 (14:46 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Fri, 11 Aug 2023 00:57:18 +0000 (08:57 +0800)
Fix double write of long xattr name prefixes in non-tarerofs mode.

Besides fix the compiling error of tar.h.  Include "internal.h" to
introduce prototypes of `struct erofs_inode` and `struct erofs_sb_info`.

Fixes: 95d315fd7958 ("erofs-utils: introduce tarerofs")
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230810064633.56218-1-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
include/erofs/tar.h
mkfs/main.c

index 8d3f8decfc9b493a48c2bc48ab1e90d8edd4b6fd..b7c2ef897dea59a74564926476e8134d082aa261 100644 (file)
@@ -2,8 +2,15 @@
 #ifndef __EROFS_TAR_H
 #define __EROFS_TAR_H
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 #include <sys/stat.h>
 
+#include "internal.h"
+
 struct erofs_pax_header {
        struct stat st;
        bool use_mtime;
@@ -27,4 +34,8 @@ int tarerofs_parse_tar(struct erofs_inode *root, struct erofs_tarfile *tar);
 int tarerofs_reserve_devtable(struct erofs_sb_info *sbi, unsigned int devices);
 int tarerofs_write_devtable(struct erofs_sb_info *sbi, struct erofs_tarfile *tar);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 9c2397cbf78f24e76c786fe4b49baf898e205d7a..c03a7a8a6a8787750f63e586a3a4c5078fa7260f 100644 (file)
@@ -912,9 +912,6 @@ int main(int argc, char **argv)
 
        erofs_inode_manager_init();
 
-       if (cfg.c_extra_ea_name_prefixes)
-               erofs_xattr_write_name_prefixes(&sbi, packedfile);
-
        if (!tar_mode) {
                err = erofs_build_shared_xattrs_from_path(&sbi, cfg.c_src_path);
                if (err) {