-
Notifications
You must be signed in to change notification settings - Fork 204
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
builder: fix lost hardlink #413
Conversation
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.
It seems to be an important fix, any test case to keep it from happening in the future?
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.
Correct me if I am wrong.
walk_inodes
is only used to getting chunk info from an inode, but hardlink inode pair should share the same chunk infos, so how are lost hardlink files related to walk_inodes
?
@liubogithub Will add a test case to the converter package since |
@liubogithub Not true, For example, if there is a hardlink pair |
a7d8545
to
109fc72
Compare
The merge operation in builder (nydus-image) use `RafsSuper::walk_inodes` method to walkthrough the whole filesystem inodes by DFS order, but it does not call the callback for the hardlink pair, which causes some hardlink files to be lost in the final bootstrap after merge. The root cause is that the `RafsSuper::get_inode` method always gets only the RafsInode of a particular file name in the hardlink pair because the ino numbers of the hardlink pair are the same. Fix by passing `RafsInode` trait object in `RafsSuper::walk_inodes` directly. Signed-off-by: Yan Song <imeoer@linux.alibaba.com>
109fc72
to
ad778db
Compare
The merge operation in builder (nydus-image) use
RafsSuper::walk_inodes
method to walkthrough the whole filesystem inodes by DFS order, but it
does not call the callback for the hardlink pair, which causes some hardlink
files to be lost in the final bootstrap after merge.
The root cause is that the
RafsSuper::get_inode
method always gets onlythe RafsInode of a particular file name in the hardlink pair because the ino
number of the hardlink pair are the same.
Fix by passing
RafsInode
trait object inRafsSuper::walk_inodes
directly.Signed-off-by: Yan Song imeoer@linux.alibaba.com