[PATCH] erofs-utils: tar: support archives without end-of-archive entry
Gao Xiang
hsiangkao at linux.alibaba.com
Tue Sep 30 18:08:47 AEST 2025
On 2025/9/30 16:01, Gao Xiang wrote:
>
>
> On 2025/9/30 15:42, Ivan Mikheykin wrote:
>> Hello!
>>
>> On 9/29/25 5:50 PM, Gao Xiang wrote:
>>
>>> Could you confirm how docker/containerd or podman parses such image?
>>
>> I confirm that images with such layers work well at least in containerd with overlayfs. We encounter problems during experiments with containerd and erofs. Also, GNU tar and BSD tar are good without end-of-archive zeros.
>>
>>>
>>> Because the POSIX standard says:
>>> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html
>>> "At the end of the archive file there shall be two 512-byte blocks filled
>>> with binary zeros, interpreted as an end-of-archive indicator."
>>>
>>> So such tar layers will be non-standard, I wonder we need at least
>>> a erofs_warn() message for such tars at least.
>>>
>>
>> Good point. I think I can add erofs_warn() message to the patch.
>
> Yes, please.
>
>>
>>
>> P.S. I've noticed an interesting detail after submitting the patch. Produced erofs image reports an enormous file size after conversion error:
>>
>> $ mkfs.erofs --tar=f --aufs --quiet -Enoinline_data test.erofs test-no-end.tar
>> -rw-r--r-- 1 user admin 2199023255552 Sep 29 13:43 test.erofs
>
> Yes, that is expected according to the current codebase
> since it uses a sparse file to keep temproary data and
> truncate when successful.
>
> I guess we should remove the image entirely if mkfs
> fails instead.
BTW, also I suggest you use `--sort=none` to get rid of
this extra copy, see:
https://github.com/containerd/containerd/blob/main/docs/snapshotters/erofs.md
>
> Thanks,
> Gao Xiang
>
>> $ du -sh test.erofs
>> 4,0K test.erofs
>>
>
More information about the Linux-erofs
mailing list