]> git.ipfire.org Git - thirdparty/coreutils.git/commit
copy: disallow copy_file_range() on Linux kernels before 5.3
authorPádraig Brady <P@draigBrady.com>
Wed, 12 May 2021 22:47:38 +0000 (23:47 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 12 May 2021 23:14:22 +0000 (00:14 +0100)
commitba5e6885d2c255648cddb87b4e795659c1990374
treea1d6cd5925140aedc6a6d415e6a78ac97f66e73a
parent6b499720fecae935dc00e236d6aefe94d9010482
copy: disallow copy_file_range() on Linux kernels before 5.3

copy_file_range() before Linux kernel release 5.3 had many issues,
as described at https://lwn.net/Articles/789527/, which was
referenced from https://lwn.net/Articles/846403/; a more general
article discussing the generality of copy_file_range().
Linux kernel 5.3 was released in September 2019, which is new enough
that we need to actively avoid older kernels.

* src/copy.c (functional_copy_file_range): A new function
that returns false for Linux kernels before version 5.3.
(sparse_copy): Call this new function to gate use of
copy_file_range().
src/copy.c