]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: remove assertion when searching for a key in a node/leaf
authorFilipe Manana <fdmanana@suse.com>
Wed, 20 Feb 2019 11:11:43 +0000 (11:11 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Feb 2019 13:19:23 +0000 (14:19 +0100)
commit381955b43370d1bab64ad73ad9e6956ce785fc58
treeb64bf4f94fe13788f18c5c02c3581309dcc150db
parent9ec3127f9982967cb86111986f44dd9a2ca39bb2
Btrfs: remove assertion when searching for a key in a node/leaf

At ctree.c:key_search(), the assertion that verifies the first key on a
child extent buffer corresponds to the key at a specific slot in the
parent has a disadvantage: we effectively hit a BUG_ON() which requires
rebooting the machine later. It also does not tell any information about
which extent buffer is affected, from which root, the expected and found
keys, etc.

However as of commit b163b2d9c746b2 ("btrfs: Validate child tree block's
level and first key"), that assertion is not needed since at the time we
read an extent buffer from disk we validate that its first key matches the
key, at the respective slot, in the parent extent buffer. Therefore just
remove the assertion at key_search().

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c