Fixed hardlink group not being broken on the destination#3478
Open
wonwuakpa-msft wants to merge 14 commits into
Open
Fixed hardlink group not being broken on the destination#3478wonwuakpa-msft wants to merge 14 commits into
wonwuakpa-msft wants to merge 14 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes an Azure Files NFS hardlink-preservation edge case where overwriting an existing destination path could unintentionally preserve the destination inode (and therefore keep/affect an existing hardlink group), causing the destination hardlink topology and/or content to diverge from the source.
Changes:
- For Azure Files NFS transfers, detect when the destination path is part of a hardlink group (LinkCount > 1) and delete it before
Createto ensure the hardlink group is broken when overwriting that path. - Add new NFS end-to-end scenarios validating that destination hardlink groups are correctly broken/split to match source topology.
- Add/clarify hardlink handling enum documentation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
ste/sender-azureFile.go |
Deletes destination NFS files that are part of a hardlink group before recreating, preventing inode preservation from keeping unintended hardlink relationships. |
e2etest/zt_newe2e_nfs_scenarios_test.go |
Adds new NFS scenarios and a helper to validate LinkCount/FileID via SDK properties. |
common/fe-ste-models.go |
Adds a clarifying comment for HardlinkHandlingType.Preserve(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ge-azcopy into wendi/nfs-sc04 pull
dphulkar-msft
approved these changes
Jun 24, 2026
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.
Bugs 4, 11, 12 addressed
Logs
AzCopy scenario 4 run log
Root Cause
When performing
copy --hardlinks=preservewith a source that has file B as independent and destination with A+B in a hardlink group, AzCopy was not unlinking B from the destination hardlink group to match the source. This was because the Create File call was called on the already existing destination path and it would preserve the destination inode (therefore keeping it in the same hardlink group).Bug Fix
We now unlink anchor files from its group before creating it. We call
.Delete()on the file before proceeding to the existing Create call. This now leaves B as an independent file to match the source as expected.