On 2023-02-15 07:26, George Valkov wrote:
I tested your patch: both overwrite existing and clone to new produce a working 
copy. Here are the test results:
https://httpstorm.com/share/.openwrt/test/2023-02-06_coreutils-9.1/test-04-cf80f988eeb97cc3f8c65ae58e735d36f865277b-clone.txt

I see some test failures there, involving cp. Do you get the same set of test failures without the patch?

In the case when a dangling symlink is involved and depending on the arguments 
passed to cp, would it be possible to use CLONE_NOFOLLOW with fclonefileat or 
fall-back to a normal copy? Does dangling refer to source or destination?

Dangling refers to the destination. The latest proposed patch does use CLONE_NOFOLLOW, which means fclonefileat should not follow symlinks to the destination. (This behavior is not documented, unfortunately, but it's the only behavior that makes sense.)



Reply via email to