Skip to contentSkip to conversation

erofs-utils: mkfs: fix double write of long xattr name prefixes

PATCH In review Jingbo Xu 2 participants 4 messages Aug 10, 2023

lore
Share & tools
lore

Jingbo Xu

author
#0 lore raw

PATCH 1/2 erofs-utils: mkfs: fix double write of long xattr name prefixes

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")
---
 include/erofs/tar.h | 11 +++++++++++
 mkfs/main.c         |  3 ---
 2 files changed, 11 insertions(+), 3 deletions(-)
include/erofs/tar.h +11 -0
index 8d3f8de..b7c2ef8 100644
@@ -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
mkfs/main.c +0 -3
index 9c2397c..c03a7a8 100644
@@ -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) {
Signature · 1 line
2.19.1.6.gb485710b
author
#1 lore raw

PATCH 2/2 erofs-utils: lib: remove prototypes of removed functions

Remove prototypes of those that have been deleted.

---
 include/erofs/tar.h | 3 ---
 1 file changed, 3 deletions(-)
include/erofs/tar.h +0 -3
index b7c2ef8..d5648f6 100644
@@ -29,10 +29,7 @@ struct erofs_tarfile {
 	bool index_mode, aufs;
 };
 
-int tarerofs_init_empty_dir(struct erofs_inode *inode);
 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
 }
Signature · 1 line
2.19.1.6.gb485710b