Implement basic repair for broken directory hardlinks. #1
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.
Any hardlink inode with a parent other than the metadata directory is changed
to have the correct parent.
I have seen these. I can understand how this happens when a normal directory
is hardlined for the first time. The journal SHOULD prevent this from being a
problem but obviously this is not the case.
Directory hardlink inodes named "temp..." get deleted.
These directories were deleted while open when the volume was removed without
unmounting. Since these directories have already been deleted, deleting them
in fsck is the right thing to do. (Documented like that for files in the HFS+
spec.)
Directory hardlink inodes with names other than "temp..." or "dir_..." are moved
to "lost+found".
It would be better to rename them to "dir_..." in a first pass, there might still
be valid links to them. These links are deleted by a different repair step and I
did not see how to remove those other repair steps. Would probably lead to a bigger
rewrite of the hardlink check code so I decided to just move these to l+f.
I have never seen this anyways.