-
Notifications
You must be signed in to change notification settings - Fork 469
fix: Correctly handle symbolic link renames #3648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3648 +/- ##
==========================================
+ Coverage 82.33% 82.36% +0.03%
==========================================
Files 146 146
Lines 22624 22646 +22
==========================================
+ Hits 18627 18652 +25
+ Misses 3447 3445 -2
+ Partials 550 549 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly fixes an issue preventing symbolic links from being renamed. The approach of making SymlinkInode implement the BucketOwnedInode interface and updating the Rename logic is sound. The changes are well-structured and supported by a good set of new tests covering various scenarios. I've added a couple of minor suggestions to improve an error message for better debugging and to enhance a test assertion for better failure diagnosis. Great work!
Description
A recent refactoring of the
Renameoperation ininternal/fs/fs.gointroduced an issue that prevented sym links from being renamed.The new implementation incorrectly assumed that all inodes being renamed would implement the
inode.BucketOwnedInodeinterface. SinceSymlinkInodedid not, any attempt to rename a symlink would fail with the error:Rename: input/output error, child inode (id <X>) is not owned by any bucket.This change resolves the issue by making
SymlinkInodeimplement theBucketOwnedInodeinterface. This involves:bucketfield toSymlinkInode.NewSymlinkInodefunction and its call sites to correctly propagate bucket information.Renamefunction to correctly handle symlinks as bucket-owned inodes.With this fix, renaming symbolic links now works as expected.
Link to the issue in case of a bug fix.
https://b.corp.google.com/issues/436756784
Testing details
Any backward incompatible change? If so, please explain.