Repository navigation
vfs: fixes corrupt file identity on backend rename failure - #10060
Open
biagiop1986 wants to merge 1 commit into
Open
biagiop1986 wants to merge 1 commit into
biagiop1986 wants to merge 1 commit into
Conversation
biagiop1986
force-pushed
the
fix-rename-rollback
branch
from
October 12, 2026 09:24
228f364 to
7f06d2e
Compare
If a backend move/copy fails during a File.Rename operation, the VFS node is left in a corrupted state: it still resides in the source directory's item map, but its internal pointers (f.d, f.dPath, f.leaf) point to the target destination. This causes subsequent operations on the file to inject virtual entries into the destination directory instead of the source directory, permanently poisoning the destination cache. This patch tracks the original file properties and explicitly rolls them back if the underlying renameCall returns an error. Fixes rclone#10059
biagiop1986
force-pushed
the
fix-rename-rollback
branch
from
October 12, 2026 09:33
7f06d2e to
c22d38f
Compare
Author
|
Rebased onto master to include the last commits that correct the earlier |
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.
What does this change do?
In a rename operation, the VFS node's internal state is updated to the destination state before invoking the backend call
renameCall. If this returns an error, the state is not rolled back and the node remains in a corrupted state: still residing at the old path, but with its internal pointing to the new location. This patch saves the previous state and restores in case of failure in the backend call. A test is added as well.Linked issue
Fixes #10059
For new or changed backends
Checklist
test_allpasses for this backend and if submitting a new backend can provide a test account for the integration tester - see CONTRIBUTING.md.