btrfs: split assert into two different asserts when removing block group
authorFilipe Manana <fdmanana@suse.com>
Tue, 21 Nov 2023 13:38:35 +0000 (13:38 +0000)
committerDavid Sterba <dsterba@suse.com>
Fri, 15 Dec 2023 19:27:01 +0000 (20:27 +0100)
commit3128b548c759da4263b44306093d3a1751dcc58d
tree7ab87a22237ec8d5b807b77e9947f8ed5d0d94f9
parent5031660a1b6a7ca7f9a1c55ebf0c157255826915
btrfs: split assert into two different asserts when removing block group

When starting a transaction to remove a block group we have one ASSERT
that checks we found an extent map and that the extent map's start offset
matches the desired chunk offset. In case one of the conditions fails, we
get a stack trace that point to the respective line of code, however we
can't tell which condition failed: either there's no extent map or we got
one with an unexpected start offset. To make such an issue easier to debug
and analyse, split the assertion into two, one for each condition. This
was actually triggered during development of another upcoming change.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c