Btrfs: check items for correctness as we search
commita826d6dcb32d811b4c81df57a5ef1367516586b0
authorJosef Bacik <josef@redhat.com>
Wed, 16 Mar 2011 17:42:43 +0000 (16 13:42 -0400)
committerJosef Bacik <josef@redhat.com>
Thu, 17 Mar 2011 18:21:37 +0000 (17 14:21 -0400)
tree4853d5acf6cde4dfb0eeb19f5c74dc3d7934359b
parent850265335f792f5d39ab24e5fb7160bac28d77e5
Btrfs: check items for correctness as we search

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: Josef Bacik <josef@redhat.com>
fs/btrfs/ctree.c
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/extent_io.h