Hi Friendy, On 2025/8/23 17:14, Gao Xiang wrote:
...
--- lib/blobchunk.c | 18 ++++++++++++++++++ man/mkfs.erofs.1 | 15 +++++++++++++++ mkfs/main.c | 12 ++++++++++++ 3 files changed, 45 insertions(+) diff --git a/lib/blobchunk.c b/lib/blobchunk.c index bbc69cf..69c70e9 100644 --- a/lib/blobchunk.c +++ b/lib/blobchunk.c @@ -309,6 +309,24 @@ int erofs_blob_write_chunked_file(struct erofs_inode *inode, int fd, minextblks = BLK_ROUND_UP(sbi, inode->i_size); interval_start = 0; + /* + * dsunit <= chunksize, deduplication will not cause unalignment, + * we can do align with confidence + */ + if (sbi->bmgr->dsunit > 1 && + sbi->bmgr->dsunit <= 1u << (chunkbits - sbi->blkszbits)) {Sigh, I meant (sbi->bmgr->dsunit >= 1u << (chunkbits - sbi->blkszbits)) Let's ignore sbi->bmgr->dsunit < 1u << (chunkbits - sbi->blkszbits).
Sorry, your patch is absolutely correct. I was looking at this in rush, sorry for the noise. I will submit this later soon. (busy in other personal stuffs this weekend.) Thanks, Gao Xiang
Thanks, Gao Xiang
