Skip to contentSkip to conversation

erofs-utils: lib: support >2TiB tarballs for EROFS index-only images

PATCH New Gao Xiang 1 participant 1 message Jan 14 Library code

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs-utils: lib: support >2TiB tarballs for EROFS index-only images

Again, the liberofs code for chunked inodes needs to be refactored.

---
 lib/blobchunk.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
lib/blobchunk.c +10 -0
index c66bd2020e45..f213c2868774 100644
@@ -499,6 +499,16 @@ int tarerofs_write_chunkes(struct erofs_inode *inode, erofs_off_t data_offset)
 		blkaddr += erofs_blknr(sbi, len);
 		data_offset += len;
 	}
+
+	/*
+	 * XXX: it's safe for now, but we really need to refactor blobchunk
+	 * after 1.9 is out.
+	 */
+	if (blkaddr > UINT32_MAX) {
+		inode->u.chunkformat |= EROFS_CHUNK_FORMAT_48BIT;
+		erofs_info("48-bit block addressin enabled for indexing larger tar");
+		erofs_sb_set_48bit(sbi);
+	}
 	inode->datalayout = EROFS_INODE_CHUNK_BASED;
 	return 0;
 }
Signature · 1 line
2.43.5