Skip to content
Snippets Groups Projects
  1. Jul 28, 2023
  2. Feb 27, 2023
  3. Nov 08, 2022
  4. Nov 01, 2022
  5. Oct 28, 2022
  6. Oct 10, 2022
  7. Aug 19, 2022
  8. Aug 01, 2022
  9. Jul 29, 2022
    • Jonathan Lebon's avatar
      fdio: fix fd offset handling with `FICLONE` · 7a2f26a3
      Jonathan Lebon authored
      When using `FICLONE`, the kernel does a full file clone and disregards the
      fd offsets. Users of this API however assume that it *is*
      offset-sensitive. So we need to verify that the fd offsets are at the
      start of the files before we call `FICLONE`. This was done in systemd also
      in:
      
      https://github.com/systemd/systemd/commit/c622fbdb8d37
      
      The commit message does not explain this but `ioctl_ficlone(2)` says:
      
          The `FICLONE` ioctl clones entire files.
      
      (Compare with `FICLONERANGE`, which takes a struct with offsets and the
      length).
      
      Similarly, we need to seek to the end of the file descriptors on success
      so that we're consistent with the behaviour of the other backends
      available (`copy_file_range`, `sendfile` and manual copying). This also
      matches what systemd does nowadays:
      
      https://github.com/systemd/systemd/blob/80f967311ac5/src/shared/copy.c#L199
      7a2f26a3
  10. Jul 27, 2022
  11. May 10, 2022
  12. Apr 24, 2022
  13. Apr 21, 2022
Loading