[PATCH v2] erofs-utils: mkfs: Implement 'dsunit' alignment on blobdev

Gao Xiang hsiangkao at linux.alibaba.com
Fri Aug 22 19:25:21 AEST 2025



On 2025/8/22 17:19, Friendy.Su at sony.com wrote:
>> +             off_t off = lseek(blobfile, 0, SEEK_CUR);
>> +
>> +             erofs_dbg("Try to round up 0x%llx to align on %d blocks (dsunit)",
>> +                             off, sbi->bmgr->dsunit);
>> +             off = roundup(off, sbi->bmgr->dsunit * erofs_blksiz(sbi));
>> +             if (lseek(blobfile, off, SEEK_SET) != off) {
>> +                     ret = -errno;
>> +                     erofs_err("lseek to blobdev 0x%llx error", off);
>> +                     goto err;
>> +             }
>> +             erofs_dbg("Aligned on 0x%llx", off);
> 
> Could we combine these two debugging messages into one?
> 
> Here, 'off' is changed after roundup(), we need show both 'before' and 'after' by one variable 'off',  it is hard to combine.
> Do you have better idea? ^_^

It's just a debugging message, just wonder if
the previous position is important?

If it's really important, you could use another variable
to keep the original one.

Thanks,
Gao Xiang


More information about the Linux-erofs mailing list