On 2/10/23 13:35, George Valkov wrote: > Since the source and it’s clone have separate metadata, > it should be possible to change it on the clone, to comply with standards. Attached is a hacky patch to do that. It also uses the new CLONE_ACL flag. The old code apparently mishandled ACLs; the new code tries to do a better job. This whole area is a mess, but the patch should improve correctness on macOS, while also being efficient in the usual case. > It feels more natural when the metadata is kept intact for the two files. That depends on the application. The longstanding tradition for cp is to preserve metadata if you use 'cp -p', and to not preserve with plain cp. For interactive use you can use an alias or a little script if you prefer -p to be enabled by default. > Here is a good example: I create a tarball on my OpenWRT router. Extract on the Mac. That's fine, because 'tar' historically has preserved the timestamp and (if you're root) permissions. Plain cp has not. > I found this link in one of the mailing lists you sent, it explains what was wrong > with the original SEEK_DATA and SEEK_HOLE approach on macOS GNU cp does a pass over the file with SEEK_HOLE and SEEK_DATA, so if I understand things correctly it shouldn't run into the problem mentioned there. In other words, that email doesn't appear to explain our current problem.