cp: reuse the open dest fd when a reflink clone falls back - #14136
Open
sylvestre wants to merge 2 commits into
Open
cp: reuse the open dest fd when a reflink clone falls back #14136sylvestre wants to merge 2 commits into
sylvestre wants to merge 2 commits into
Conversation
|
GNU testsuite comparison: |
Contributor
|
fixes #13185 ? |
With a umask that strips the owner write bit (e.g. 333), the dest is created read-only, so re-opening it by path after a failed ioctl_ficlone raised EACCES and left an empty file behind. While reworking the fallback: - report the ioctl_ficlone error instead of a stale errno, and remove a freshly created dest when --reflink=always fails, matching GNU - keep the sparse copy size as u64 to avoid a 32-bit panic on >= 4 GiB sources, and stop the copy loop on early EOF - avoid a step_by(0) panic when an empty source gains data mid-copy Fixes https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2164777
Only a failure to preserve the SELinux security context empties the destination; other attribute failures leave the copied data in place. Restrict the truncation to context errors, and make it work when the destination mode has no write bit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@julian-klode @BAMF0