erofs-utils: lib: fix incorrect nblocks in block list for chunked inodes
authorHongzhen Luo <hongzhen@linux.alibaba.com>
Wed, 11 Sep 2024 08:55:31 +0000 (16:55 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 11 Sep 2024 11:01:09 +0000 (19:01 +0800)
commit53756872a48490157f9d3827b1f8bbf1bfa35993
treeffe2774000c1b0af1ef064715271b113ed1cad0f
parent85ea711aafd3d1cab58ac757106536d742ec37f9
erofs-utils: lib: fix incorrect nblocks in block list for chunked inodes

Currently, the number of physical blocks (nblocks) for the last chunk
written to the block list file is incorrectly recorded as the inode
chunksize.

This patch writes the actual number of physical blocks for the inode in
the last chunk to the block list file.

Fixes: 7b46f7a0160a ("erofs-utils: lib: merge consecutive chunks if possible")
Fixes: b6749839e710 ("erofs-utils: generate preallocated extents for tarerofs")
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240911085531.2133723-1-hongzhen@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
lib/blobchunk.c