You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cp --reflink=always on an unsupported volume copies the file via fallback but still exits 1 with 'failed to clone' — the target exists yet the command reports failure #1369
Probe-verified (same-source mingw+Wine harness, two runs, GNU coreutils 9.4):
Fixture: file f containing payload\n. Command: cp --reflink=always f C:\v2reflink\out.txt where the destination volume does not support cloning.
WinuxCmd: prints cp: failed to clone 'C:\v2reflink\out.txt' from 'f': Not supported, exit 1 — but the destination file exists afterwards with the full correct contents (a silent fallback copy happened despite --reflink=always).
GNU (cp --reflink=always across filesystems): exit 1 with a clone failure and no destination file is created.
Expected (GNU)
--reflink=always means "clone or fail": on failure the command exits non-zero without producing the copy. A fallback copy that is then reported as a failure is the worst of both worlds — scripts see an error, clean up nothing, and a stray file with valid contents remains.
Source
src/commands/cp.cpp: the reflink error path falls through to the regular copy engine and then still returns the clone failure.
Regression seed
In-repo test named with this issue number: the cross-volume fixture above; assert exit 1 and destination absent afterwards.
Fixed by #1403 (commit 275785f): on the two failure paths after destination creation, cp closes the handle and deletes the half-written target — --reflink=always on an unsupported volume now fails loudly and leaves no destination behind; the auto fallback is unchanged. Regression pin issue1369_reflink_always_failure_leaves_no_destination landed with the PR.
Activity
Merge pull request #1403 from unixwin/fix/winx5-fileops
caomengxuan666 commentedon Oct 27, 2026
Fixed by #1403 (commit 275785f): on the two failure paths after destination creation, cp closes the handle and deletes the half-written target — --reflink=always on an unsupported volume now fails loudly and leaves no destination behind; the auto fallback is unchanged. Regression pin
issue1369_reflink_always_failure_leaves_no_destinationlanded with the PR.