Skip to contentSkip to conversation

erofs-utils: set opaque flag for directories in tarerofs mode

PATCH In review Gao Xiang 2 participants 2 messages Apr 2, 2024 Library code

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs-utils: set opaque flag for directories in tarerofs mode

Opaque dir flag is needed if the tar tree is used immediately for the upcoming append mode.

---
 lib/tar.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/tar.c +5 -0
index 7c271f6..b45657d 100644
@@ -909,6 +909,11 @@ restart:
 	} else if (opq) {
 		DBG_BUGON(d->type == EROFS_FT_UNKNOWN);
 		DBG_BUGON(!d->inode);
+		/*
+		 * needed if the tar tree is used soon, thus we have no chance
+		 * to generate it from xattrs.  No impact to mergefs.
+		 */
+		d->inode->opaque = true;
 		ret = erofs_set_opaque_xattr(d->inode);
 		goto out;
 	} else if (th->typeflag == '1') {	/* hard link cases */
Signature · 1 line
2.39.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Gao Xiang

Opaque dir flag is needed if the tar tree is used immediately for the upcoming append mode.

---
 lib/tar.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/tar.c +0 -0
index 7c271f6..b45657d 100644
@@ -909,6 +909,11 @@ restart:
 	} else if (opq) {

lib/tar.c restart: · line 919

Quoted 10 lines
lib/tar.c +5 -0
 		DBG_BUGON(d->type == EROFS_FT_UNKNOWN);
 		DBG_BUGON(!d->inode);
+		/*
+		 * needed if the tar tree is used soon, thus we have no chance
+		 * to generate it from xattrs.  No impact to mergefs.
+		 */
+		d->inode->opaque = true;
 		ret = erofs_set_opaque_xattr(d->inode);
 		goto out;
 	} else if (th->typeflag == '1') {	/* hard link cases */

LGTM.

Signature · 2 lines
Thanks,
Jingbo