Skip to content

Copy a complete file into place instead of moving it when it’s outside the base path or can’t be renamed - #388

Merged
mnightingale merged 3 commits into
masterfrom
fix/cross-volume-rename
Oct 15, 2026
Merged

mnightingale merged 3 commits into
masterfrom
fix/cross-volume-rename

Conversation

@mnightingale

Copy link
Copy Markdown
Contributor

When a repair finds a complete copy of a missing file under another name, it renames that copy into place. That suits a file renamed by mistake in the same directory, but not a file that belongs elsewhere. Through libpar2, an application can load A/set.par2 and pass B/file.dat as a source of blocks. The repair then moves the application’s file out of B. If B is on another volume the rename fails, and the whole repair fails with it, even though every block was available. The CLI can hit the second problem when a directory inside the base path is a mount point.

Now a copy that can’t be renamed is copied into place block by block, with a new wcRenameFailed warning. A copy outside the base path is always copied and left where it is. Copies inside the base path are still renamed as before.

The CLI ignores files outside the base path, but libpar2 deliberately doesn’t follow it. Upcoming in-place repair and donor files both rely on reading blocks from files elsewhere without moving them.

@mnightingale
mnightingale merged commit 87f62a2 into master Oct 15, 2026
15 checks passed
@mnightingale mnightingale mentioned this pull request Oct 15, 2026
@mnightingale
mnightingale deleted the fix/cross-volume-rename branch October 15, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant