]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: tree-checker: Check chunk item at tree block read time
authorQu Wenruo <wqu@suse.com>
Wed, 20 Mar 2019 05:42:33 +0000 (13:42 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:32 +0000 (19:02 +0200)
commita29d97838ce437278516c9958def56228913461c
tree15961e83f25f21a2b9ab09d629b3b5d3f7dce7c0
parentb83f4bab5a60af6d49f2171abaa21fb6ecc3fa94
btrfs: tree-checker: Check chunk item at tree block read time

Since we have btrfs_check_chunk_valid() in tree-checker, let's do
chunk item verification in tree-checker too.

Since the tree-checker is run at endio time, if one chunk leaf fails
chunk verification, we can still retry the other copy, making btrfs more
robust to fuzzed image as we may still get a good chunk item.

Also since we have done chunk verification in tree block read time, skip
the btrfs_check_chunk_valid() call in read_one_chunk() if we're reading
chunk items from leaf.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
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/tree-checker.c
fs/btrfs/volumes.c