Subject: Re: bug#68504: [PATCH v3] Add copy-on-write support to scm_copy_file.

From: Tomas Volf <[email-masked]>
Date: Wed, 13 Mar 2024 00:19:24 +0100

On 2024-03-12 14:06:34 +0100, Ludovic Courtès wrote:
>
> Finally pushed as e1690f3fd251d69b3687ec12c6f4b41034047f0f.  Note that I
> added copyright lines for you, let me know if I got it wrong.

Thank you for merging it, and thanks for the copyright, looks correct :)

> As a followup, we should add support for ‘copy_file_range’ when FICLONE
> cannot be used; glibc supports it on all platforms but it returns ENOSYS
> on GNU/Hurd currently.
>
> WDYT?

Sure, I am willing to do my part.  I managed to find this blog post[0], so after
some minor troubles I did manage to get a VM with GNU/Hurd running.  Next I will
read up on copy_file_range and try to put together a patch.

Just to make sure, your idea here is exactly what?  Always try to use
copy_file_range before the regular copy?  So the flow would be

For 'always case:

    CoW  ---fail-->  FAIL

For 'auto case:

    CoW  ---fail-->  copy_file_range  ---fail-->  current copy  ---fail-->  FAIL

For 'never case:

    copy_file_range  ---fail-->  current copy  ---fail-->  FAIL

Is that an accurate summary?  Or did you mean only as a fallback for the CoW, so
only for 'auto, but not for the 'never?

Tomas

0: https://guix.gnu.org/en/blog/2020/a-hello-world-virtual-machine-running-the-hurd/

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.