From: Gao Xiang Date: Tue, 18 Jun 2024 08:24:12 +0000 (+0800) Subject: erofs-utils: fix incremental builds for tarerofs index mode X-Git-Tag: v1.8~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5a674e5ca08ac5ccbd367c5993adf6210c6143f;p=platform%2Fupstream%2Ferofs-utils.git erofs-utils: fix incremental builds for tarerofs index mode 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 Link: https://lore.kernel.org/r/20240618082414.47876-7-hsiangkao@linux.alibaba.com --- 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);