coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'cp' now uses openat etc. when copying to directories


From: Bernhard Voelker
Subject: Re: 'cp' now uses openat etc. when copying to directories
Date: Sat, 15 Jan 2022 20:55:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1

On 1/13/22 21:03, Paul Eggert wrote:
> I installed the attached so that GNU 'cp' now uses directory-relative 
> syscalls like 'openat', 'mkdirat' and 'chmodat' when the target is a 
> directory. The idea is to make it easier to modify 'cp' in the future so 
> that it can use xfts for recursive copies.

good idea, the *at functions are the more modern ones.

> Even without xfts this should be a win, for uses of 'cp' to a directory, 
> as it should be a bit faster and should avoid some race conditions. 
> However, there are a lot of glitchy little things in this patch so I'm 
> sending this heads-up as a warning that I may have introduced a bug.

yep, `make check-very-expensive` fails due to 3x segmentation faults:

  FAIL: tests/cp/cp-parents
  FAIL: tests/cp/parent-perm-race
  FAIL: tests/mv/hard-3

Furthermore, 'make syntax-check' complains about:

  prohibit_readlink
  src/copy.c:1266:          if (0 <= readlinkat (dst_dirfd, dst_relname, dummy, 
sizeof dummy))
  maint.mk: do not use readlink(at); use via xreadlink or areadlink*
  make: *** [cfg.mk:446: sc_prohibit_readlink] Error 1

Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]