overlaybd icon indicating copy to clipboard operation
overlaybd copied to clipboard

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

Open hsiangkao opened this issue 1 year ago • 2 comments

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:

  • [ ] Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • [ ] Does this change require a documentation update?
  • [ ] Does this introduce breaking changes that would require an announcement or bumping the major version?
  • [ ] Do all new files have an appropriate license header?

hsiangkao avatar Oct 18 '24 04:10 hsiangkao

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 avatar Oct 18 '24 05:10 hsiangkao

Before: image After: image

hsiangkao avatar Oct 18 '24 09:10 hsiangkao