libocfs2: fix non-zero value in Next Leaf field in the rightmost leaf metadata block #68
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.
One of our customers reported read-only filesystem. fsck.ocfs2 -ny showed the following issue:
Pass 1: Checking inodes and blocks
[EXTENT_LIST_FREE] Extent list in owner 658435 claims 231 as the next free chain record, but fsck believes the largest valid value is 227. Clamp the next record value? n
debugfs.ocfs2 also showed the corruption:
The "Next Free Rec" had overshoot the "Count".
Upon running fsck.ocfs2 -fy, the fsck managed to fix only the root metadata block and updated it with a new "Last Extblk"
However fsck.ocfs2 did not set "Next Leaf" to zero in the updated "Last Extblk".
This patch addresses this issue by checking the last leaf metadata block and setting "Next Leaf" to zero if not done.