containerd / continuity

A transport-agnostic, filesystem metadata manifest system
https://containerd.io
Apache License 2.0
139 stars 67 forks source link

Fix copy_file_range usage for files > 2GB #114

Closed cpuguy83 closed 6 years ago

cpuguy83 commented 6 years ago

copy_file_range (or any Linux syscall) will only ever copy 2GB at a time. In this case there is no error returned from the system call.

This fix uses copy_file_range in a loop until either 0 bytes are copied, or the desired amount has been copied (st.Size()).

cpuguy83 commented 6 years ago

ping @stevvooe @dmcgowan @AkihiroSuda @Random-Liu

This is a nasty gotcha. Considering this a P0 for moby/moby. I suspect cri-containerd volume copying and containerd's image unpack is broken for any directories that contain files > 2GB.

Random-Liu commented 6 years ago

LGTM. Will update the vendor once this is merged.

dmcgowan commented 6 years ago

Some comments on test, I will address those in a follow up. Thanks for getting this in.

LGTM