GNU bug report logs - #63850
cp fails for files > 2 GB if copy offload is unsupported

Previous Next

Package: coreutils;

Reported by: Sam James <sam <at> gentoo.org>

Date: Fri, 2 Jun 2023 15:50:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, Sam James <sam <at> gentoo.org>, 63850 <at> debbugs.gnu.org
Subject: bug#63850: cp fails for files > 2 GB if copy offload is unsupported
Date: Sat, 3 Jun 2023 19:39:51 +0100
On 03/06/2023 07:05, Paul Eggert wrote:
> On 2023-06-02 09:31, Pádraig Brady wrote:
>> I'm not sure it was working correctly before 9.3 either.
>> Before 9.3 we would have switched from copy_file_range() to read()/write()
> 
> Actually, cp shouldn't have been using copy_file_range at all, as the
> code is supposed to never use copy_file_range unless the Linux kernel
> version is 5.3 or later. See m4/copy-file-range.m4 and
> lib/copy-file-range.c.
> 
> Since the bug is being reported against kernel 4.19, someone needs to
> investigate why the Gentoo build is using the copy_file_range syscall on
> that kernel. Either the Gentoo build isn't properly compiling the
> replacement function in coreutils/lib/copy-file-range.c, or the
> replacement function is incorrectly deciding that the kernel is new
> enough, or something like that.
> 
> We shouldn't need to fiddle with src/copy.c on this.

Yes good call on the kernel version checks.

Though I think we should be a bit more accommodating for edge cases
in code as fundamental as coreutils copy routines.

Personally I would have a preference for accommodating the partial failure
as originally proposed in the patch at https://bugs.gnu.org/62404#11

Personally I would definitely reinstate the _runtime_ kernel version check,
for this bug and all the other copy_file_range() issues on older kernels.
The runtime to build time change was originally discussed at:
https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00118.html

cheers,
Pádraig




This bug report was last modified 2 years and 18 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.