btrfs: assert tree is locked when clearing extent map from logging
authorFilipe Manana <fdmanana@suse.com>
Mon, 19 Sep 2022 14:06:36 +0000 (15:06 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 29 Sep 2022 15:08:31 +0000 (17:08 +0200)
commit74333c7d87914ef1c250d3ea9441e88e15039bd8
treed93c0d5161d699c7f62bb3f033ed5b75464c4ce4
parent2e0cdaa0288bbe3d6a05937bc7b61aa9da0cb2bf
btrfs: assert tree is locked when clearing extent map from logging

When calling clear_em_logging() we should have a write lock on the extent
map tree, as we will try to merge the extent map with the previous and
next ones in the tree. So assert that we have a write lock.

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/extent_map.c