• Josef Bacik's avatar
    Btrfs: check items for correctness as we search · a826d6dc
    Josef Bacik authored
    Currently if we have corrupted items things will blow up in spectacular ways.
    So as we read in blocks and they are leaves, check the entire leaf to make sure
    all of the items are correct and point to valid parts in the leaf for the item
    data the are responsible for.  If the item is corrupt we will kick back EIO and
    not read any of the copies since they are likely to not be correct either.  This
    will catch generic corruptions, it will be up to the individual callers of
    btrfs_search_slot to make sure their items are right.  Thanks,
    Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
    a826d6dc
ctree.c 112 KB