• Qu Wenruo's avatar
    btrfs: tree-checker: Add simple keyed refs check · e2406a6f
    Qu Wenruo authored
    For TREE_BLOCK_REF, SHARED_DATA_REF and SHARED_BLOCK_REF we need to
    check:
                  | TREE_BLOCK_REF | SHARED_BLOCK_REF | SHARED_BLOCK_REF
    --------------+----------------+-----------------+------------------
    key->objectid |    Alignment   |     Alignment    |    Alignment
    key->offset   |    Any value   |     Alignment    |    Alignment
    item_size     |        0       |        0         |   sizeof(le32) (*)
    
    *: sizeof(struct btrfs_shared_data_ref)
    
    So introduce a check to check all these 3 key types together.
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    e2406a6f
tree-checker.c 42.1 KB