-
Notifications
You must be signed in to change notification settings - Fork 268
Remap tree support for btrfs check #1086
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
Open
maharmstone
wants to merge
11
commits into
kdave:devel
Choose a base branch
from
maharmstone:remap-tree-check
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Add btrfs_translate_remap() from the kernel, so that we can read metadata from block groups that have been remapped. Signed-off-by: Mark Harmstone <[email protected]>
Port the changes made in the kernel version of btrfs_check_chunk_valid() back to progs, so that it no longer fails when encountering a block group that has been remapped. Signed-off-by: Mark Harmstone <[email protected]>
The remap tree does not have backrefs in the extent tree. Fix btrfs check so that it doesn't throw an error because these aren't present, but does throw an error if they unexpectedly found. Signed-off-by: Mark Harmstone <[email protected]>
Add a check in check_extent_type() that the remap tree is in the correct block group type. Signed-off-by: Mark Harmstone <[email protected]>
Fix check_extent_refs() so that it no longer gives a "ref mismatch" error when processing the remap tree, due to missing backrefs. Signed-off-by: Mark Harmstone <[email protected]>
…ock groups The remap tree doesn't have backrefs, so we can't use these to calculate the expected `used` value for the block group like we normally do. Instead, keep a running total when we're walking through its nodes. Signed-off-by: Mark Harmstone <[email protected]>
Remapped block groups don't have any entries in the free-space tree, as no new allocations can be made from them. Instead of walking the free-space tree, walk the remap tree and treat the holes between the remap or identity remaps as free space. Signed-off-by: Mark Harmstone <[email protected]>
We can't find the used blocks in the remap tree from the extent root, so instead visit each of the internal ndoes in the remap tree. Signed-off-by: Mark Harmstone <[email protected]>
Fully remapped chunks have zero stripes. Fix a couple of instances where we're assuming that num_stripes will be at least 1. Signed-off-by: Mark Harmstone <[email protected]>
Add some miscelleaneous string identifiers for the remap tree, the items within it, and its incompat flag. Signed-off-by: Mark Harmstone <[email protected]>
Contributor
Author
|
GitHub is having trouble at the moment, I think that's why the CI failed |
…ump-tree` Add print_remap_key(), so that remap items and remap backref items get dumped correctly when running `btrfs inspect-internal dump-tree`. Signed-off-by: Mark Harmstone <[email protected]>
e601d2a to
2855b8a
Compare
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.
Add support for remap tree to btrfs check, as well as a couple of things to make it so it works with
btrfs inspect-internal dump-tree.This is fairly comprehensive, but it's still missing checking of the remap tree itself (make sure it doesn't contain any unexpected items, make sure there's no overlaps, make sure each remap has a corresponding remap backref). I've also got some code for
btrfstune --convert-to-remap-treethat still needs to be cleaned up.