btrfs: assert delayed refs lock is held at add_delayed_ref_head()

The delayed refs lock must be held when calling add_delayed_ref_head(),
so assert that it's being held.

Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Filipe Manana 2024-10-23 12:48:15 +01:00 committed by David Sterba
parent 64a71f0b8a
commit a8985ac6be

View File

@ -886,6 +886,7 @@ add_delayed_ref_head(struct btrfs_trans_handle *trans,
bool qrecord_inserted = false;
delayed_refs = &trans->transaction->delayed_refs;
lockdep_assert_held(&delayed_refs->lock);
/* Record qgroup extent info if provided */
if (qrecord) {