[PATCH v2] erofs-utils: mkfs: Implement 'dsunit' alignment on blobdev
Gao Xiang
hsiangkao at linux.alibaba.com
Fri Aug 22 19:58:17 AEST 2025
On 2025/8/22 17:56, Gao Xiang wrote:
>
>
> On 2025/8/22 17:52, Friendy.Su at sony.com wrote:
>> + if (cfg.c_chunkbits && dsunit && 1u << (cfg.c_chunkbits - g_sbi.blkszbits) < dsunit) {
>> + erofs_warn("chunksize %u bytes is smaller than dsunit %u blocks, ignore dsunit !",
>> + 1u << cfg.c_chunkbits, dsunit);
>> + dsunit = 0;
>> + }
>>
>> 'ignore dsunit' means set it to default, default dsunit is 0. Is this correct?
>> > Then sbi->bmgr->dsunit will be set to 'dsunit'.
>
> I think it just ignores `dsunit` since the current behavior also
> ignores `dsunit` for blobchunks.
>
> Let's not introduce extra behavior otherwise it could have three
> different behaviors among different mkfs.erofs versions.
>
> So you could just drop `dsunit = 0` line.
So I tend to just kill `dsunit = 0` here, and change
`if (sbi->bmgr->dsunit > 1) {` into
`if (sbi->bmgr->dsunit >= 1u << (cfg.c_chunkbits - g_sbi.blkszbits)) {`
to match the previous `ignore` behavior for dsunit < chunksize.
Thanks,
Gao Xiang
More information about the Linux-erofs
mailing list