fix: decrement nlink on unlink and preserve inode/nlink on rename#276
Open
Koan-Bot wants to merge 1 commit intocpanel:masterfrom
Open
fix: decrement nlink on unlink and preserve inode/nlink on rename#276Koan-Bot wants to merge 1 commit intocpanel:masterfrom
Koan-Bot wants to merge 1 commit intocpanel:masterfrom
Conversation
Contributor
|
@Koan-Bot rebase |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
Rebase: fix: decrement nlink on unlink and preserve inode/nlink on renameBranch Actions
Automated by Kōan |
1dccd7c to
905ed39
Compare
Contributor
Author
Rebase: fix: decrement nlink on unlink and preserve inode/nlink on renameBranch Actions
Automated by Kōan |
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
unlink()now decrementsnlinkon the unlinked file and on any remaining hard links sharing the same inode.rename()now preservesinodeandnlinkmetadata.Why
After
link('/a', '/b')+unlink('/a'), both mocks retained stalenlinkvalues — the remaining hard link/bstill showednlink=2instead ofnlink=1. Similarly,rename('/old', '/new')lost inode identity and link count, making the renamed file appear as a different inode.How
unlink()method: scans%files_being_mockedfor mocks sharing the same inode and decrements theirnlinkbefore decrementing self__rename: copiesinodeandnlinkalongsidemode/uid/gidTesting
t/symlink_link.t: unlink after link decrements nlink on remaining hard link; single-file unlink decrements nlinkt/rename.t: rename preserves inode and nlink values🤖 Generated with Claude Code