btrfs: assert proper locks are held at tree_insert_offset()
authorFilipe Manana <fdmanana@suse.com>
Thu, 4 May 2023 11:04:23 +0000 (12:04 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:24 +0000 (13:59 +0200)
commit13c2018fcc27b0e2cebf0d3732c36b3ecfddc34c
tree6b85bb5f1a50784ffa157ca3f1eec781ab0159f9
parent0d6bac4d30b8bdefd1cb97296620141953f409d6
btrfs: assert proper locks are held at tree_insert_offset()

There are multiple code paths leading to tree_insert_offset(), and each
path takes the necessary locks before tree_insert_offset() is called,
since they do other things that require those locks to be held. This makes
it easy to miss the locking somewhere, so make tree_insert_offset() assert
that the required locks are being held by the calling task.

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/free-space-cache.c