containerd / continuity

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

Use ioctl_ficlonerange(2) instead of copy_file_range(2) #126

Closed AkihiroSuda closed 6 years ago

AkihiroSuda commented 6 years ago

The cp --reflink command uses the FICLONERANGE ioctl() command, but not copy_file_range(); in fact, no utilities use copy_file_range(), though it should be the default.

https://lwn.net/Articles/754506/

And there is also ioctl_fideduperange(2. really confusing.. :(

stevvooe commented 6 years ago

Why? Are you suggesting we change? It sounds like containerd makes the correct choice over cp.

AkihiroSuda commented 6 years ago

Does current containerd really dedupe?

AkihiroSuda commented 6 years ago

Sorry copy_file_range seems actually doing reflink (at least on XFS): https://github.com/containerd/continuity/pull/128

AkihiroSuda commented 6 years ago

But it looks like potentially there is case where copy_file_range does not do deduplication while ioctl_ficlonerange does, on some non-XFS filesystems?

https://twitter.com/lordcyphar/status/1039417947033194496