-
Notifications
You must be signed in to change notification settings - Fork 75
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
More strictly checking in thin_check ? #62
Comments
Sounds good On Tue, 17 May 2016 12:16 Ming-Hung Tsai, notifications@github.com wrote:
|
Would you like to do it recently? If not, I could help on it these weeks. |
I'm on vacation at the moment so won't get chance to look at it for a few On Tue, 17 May 2016 14:09 Ming-Hung Tsai, notifications@github.com wrote:
|
Some ideas about getting the total number of mapped blocks of the bottom level trees: method1. (The simplest way) Use walk_mapping_tree() to walk every nodes of all the bottom level trees, including the shared nodes (i.e., set btree_damage_visitor::avoid_repeated_visits_ to false). Then, count the mapped blocks in a customized mapping_visitor. However, due to the visiting shared nodes, we'll spend more time in walking the data mapping tree. method2. Write a special btree_damage_visitor to count the number of mapped blocks of each subtree, without repeated visiting. This approach increases the code complexity and consumes more memory (maybe 32MB or even more, because I need to track the number of child-entries for each btree node) Which one do you prefer? |
Reply to myself: Finally I choose method1 for its simplicity. I wrote another checker class for the mapping tree, which works like class mapping_tree_emitter: traverse the bottom-level trees individually, then check the number of mapped blocks and the highest mapped block after traversal. The code is almost completed. Now some problems arise: 1 . index_store::count_metadata() and index_entry_counter::visit() don't validate the beneath bitmap blocks. I wish to check the metadata space map (including all the bitmap blocks) in "thin_check --skip-mappings" because it's mandatory. However, both index_store::count_metadata() and index_entry_counter::visit() don't validate the beneath bitmap blocks.
Is there any concern to validate the bitmap inside index_store::count_metadata() and index_entry_counter::visit() ? 2 . counting_visitor should have the ability to pass errors to thin_check, to report errors in space map btree nodes. (In contrast, data space map bitmap errors could be reported by ValueCounter.) There are some solutions: (1) Add a function to block_counter for counting broken blocks (2) Apply the chain-of-responsibility pattern on btree::visitor. For example, btree_damage_visitor, counting_visitor, and btree_value_extractor form a chain. The btree_damage_visitor has the responsibility to report errors, then passes good nodes to the succeeding counting_visitor. Finally, the btree_value_extractor passes the mapped values to ValueVisitor. The benefit is, we can do damage visiting and reference counting in a single traversal, but it requires a large code base change. |
Is this feature complete and merge to main branch? |
Not yet. The ongoing Rust version has a significant performance improvement, which solves the trade-off between the execution time and precision. |
Hi Joe,
Currently, thin_check checks mapping tree and detail tree separately,
which cannot check the compatibility of each other. For example, incompatible
device IDs, or the data mapping root points to a wrong subtree (I had encountered once on an old kernel).
I suggest to do some more checking in quick mode (with --skip-mappings):
And do this in extended mode (no --skip-mappings):
How do you think?
The text was updated successfully, but these errors were encountered: