• Liu Bo's avatar
    Btrfs: add one more sanity check for shared ref type · 64ecdb64
    Liu Bo authored
    Every shared ref has a parent tree block, which can be get from
    btrfs_extent_inline_ref_offset().  And the tree block must be aligned
    to the nodesize, so we'd know this inline ref is not valid if this
    block's bytenr is not aligned to the nodesize, in which case, most
    likely the ref type has been misused.
    
    This adds the above mentioned check and also updates
    print_extent_item() called by btrfs_print_leaf() to point out the
    invalid ref while printing the tree structure.
    Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    64ecdb64
print-tree.c 11.7 KB