containerd / overlaybd

Overlaybd: a block based remote image format. The storage backend of containerd/accelerated-container-image.
Apache License 2.0
259 stars 58 forks source link

[bugfix] workaround if some SegmentMapping refers to end of tar #350

Closed hsiangkao closed 1 week ago

hsiangkao commented 1 month ago

What this PR does / why we need it: Workaround if some SegmentMapping refers to end of tar (because the mapping doesn't record real remote mapping size), which could happen on EROFS meta indexes.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #

Please check the following list:

hsiangkao commented 1 month ago

As pread(2) says:

On success, pread() returns the number of bytes read (a return of zero indicates end of file) and pwrite() returns the number of bytes written.

Note that it is not an error for a successful call to transfer fewer bytes than requested

hsiangkao commented 1 month ago

Before: image After: image