btrfs: tree-checker: Add extent items check
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 4 repliesIn review
Changelog from the cover letter
v1.1:
- If branches optimization
Make some if branches more readable.
- Range notion update
Use regular set notion ([],[),(],()) to show possible value range.
- Fix a wrong range notion
The valid range for tree level is [0, MAX_LEVEL - 1], not [0, MAX_LEVEL -1)
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs: tree-checker: Add EXTENT_ITEM and METADATA_ITEM checkfs/ | +250 | 3 replies | |
| 2/3 | btrfs: tree-checker: Add simple keyed refs checkfs/ | +39 | 0 replies | |
| 3/3 | btrfs: tree-checker: Add EXTENT_DATA_REF checkfs/ fs/ fs/ | +50 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH v1.1 0/3] btrfs: tree-checker: Add extent items check
Finally, we are going to add tree-checker support for extent items, which includes:
- EXTENT_ITEM/METADATA_ITEM
Which futher contains inline backrefs of:
* TREE_BLOCK_REF
* SHARED_BLOCK_REF
* EXETNT_DATA_REF
* SHARED_DATA_REF
- TREE_BLOCK_REF
- SHARED_BLOCK_REF
- EXTENT_DATA_REF
- SHARED_DATA_REF
Keyed version of the above types
The complexity of the on-disk format can be found in the first patch, which contains a basic introduction as comment.
Hidden pitfalls are everywhere, e.g. inlined EXTENT_DATA_REF don't use iref->offset, but put its own data at iref->offset.
But SHARED_DATA_REF uses iref->offset, and put extra data after iref.
Such on-disk layout makes sense, but definitely a mess to read. Thankfully we at least have print-tree code from btrfs-progs as a reference.
Changelog:
v1.1:
- If branches optimization
Make some if branches more readable.
- Range notion update
Use regular set notion ([],[),(],()) to show possible value range.
- Fix a wrong range notion
The valid range for tree level is [0, MAX_LEVEL - 1], not [0, MAX_LEVEL -1)
Qu Wenruo (3):
btrfs: tree-checker: Add EXTENT_ITEM and METADATA_ITEM check
btrfs: tree-checker: Add simple keyed refs check
btrfs: tree-checker: Add EXTENT_DATA_REF check
fs/btrfs/ctree.h | 1 + fs/btrfs/extent-tree.c | 2 +- fs/btrfs/tree-checker.c | 336 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 338 insertions(+), 1 deletion(-)
Signature · 1 line
2.22.0