[PATCH 7/9] erofs-utils: fix incremental builds for tarerofs index mode

Gao Xiang hsiangkao at linux.alibaba.com
Tue Jun 18 16:48:57 AEST 2024


The blob data area should be considered in the total block number to
prevent overlap during incremental builds.

Fixes: b6749839e710 ("erofs-utils: generate preallocated extents for tarerofs")
Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
---
 lib/blobchunk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/blobchunk.c b/lib/blobchunk.c
index dc1bf3c..9af223d 100644
--- a/lib/blobchunk.c
+++ b/lib/blobchunk.c
@@ -517,7 +517,7 @@ int erofs_mkfs_dump_blobs(struct erofs_sb_info *sbi)
 		return 0;
 	}
 
-	bh = erofs_balloc(DATA, blobfile ? datablob_size : 0, 0, 0);
+	bh = erofs_balloc(DATA, datablob_size, 0, 0);
 	if (IS_ERR(bh))
 		return PTR_ERR(bh);
 
@@ -532,7 +532,7 @@ int erofs_mkfs_dump_blobs(struct erofs_sb_info *sbi)
 				sbi->bdev.fd, &pos_out, datablob_size);
 		ret = ret < datablob_size ? -EIO : 0;
 	} else {
-		ret = 0;
+		ret = erofs_io_ftruncate(&sbi->bdev, pos_out + datablob_size);
 	}
 	bh->op = &erofs_drop_directly_bhops;
 	erofs_bdrop(bh, false);
-- 
2.39.3



More information about the Linux-erofs mailing list