[PATCH 01/11] erofs-utils: mkfs: don't generate encoded extents for ztailpacking

Gao Xiang hsiangkao at linux.alibaba.com
Fri Jul 18 16:54:09 AEST 2025


.. Need more library work for ztailpacking.

Fixes: f978245e9da8 ("erofs-utils: support encoded extents")
Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
---
 lib/compress.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/compress.c b/lib/compress.c
index a57bb6a3..22fb5d6d 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -1142,7 +1142,8 @@ static void *z_erofs_write_indexes(struct z_erofs_compress_ictx *ctx)
 	struct z_erofs_extent_item *ei, *n;
 	void *metabuf;
 
-	if (erofs_sb_has_48bit(sbi)) {
+	/* TODO: support writing encoded extents for ztailpacking later. */
+	if (erofs_sb_has_48bit(sbi) && !inode->idata_size) {
 		metabuf = z_erofs_write_extents(ctx);
 		if (metabuf != ERR_PTR(-EAGAIN)) {
 			if (IS_ERR(metabuf))
@@ -1181,6 +1182,8 @@ static void *z_erofs_write_indexes(struct z_erofs_compress_ictx *ctx)
 	ctx->metacur = metabuf + Z_EROFS_LEGACY_MAP_HEADER_SIZE;
 	ctx->clusterofs = 0;
 	list_for_each_entry_safe(ei, n, &ctx->extents, list) {
+		DBG_BUGON(ei->list.next != &ctx->extents &&
+			  ctx->clusterofs + ei->e.length < erofs_blksiz(sbi));
 		z_erofs_write_full_indexes(ctx, &ei->e);
 
 		list_del(&ei->list);
-- 
2.43.5



More information about the Linux-erofs mailing list