btrfs: tree-checker: Add EXTENT_DATA_REF check
authorQu Wenruo <wqu@suse.com>
Fri, 9 Aug 2019 01:24:24 +0000 (09:24 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:12 +0000 (14:59 +0200)
commit0785a9aacf9de9cd6a89a628b3b5d6b7e9ce5316
treea751a9f57a0619023dd641f2f2d449dabeb70dbc
parente2406a6f13bdc7df43bf7e4e66cb06348daef618
btrfs: tree-checker: Add EXTENT_DATA_REF check

EXTENT_DATA_REF is a little like DIR_ITEM which contains hash in its
key->offset.

This patch will check the following contents:
- Key->objectid
  Basic alignment check.

- Hash
  Hash of each extent_data_ref item must match key->offset.

- Offset
  Basic alignment check.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/tree-checker.c