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

The delayed refs lock must be held when calling find_first_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:43:35 +01:00
committed by David Sterba
parent 7226ed7d44
commit 64a71f0b8a

View File

@@ -384,6 +384,8 @@ static struct btrfs_delayed_ref_head *find_first_ref_head(
struct rb_node *n;
struct btrfs_delayed_ref_head *entry;
lockdep_assert_held(&dr->lock);
n = rb_first_cached(&dr->href_root);
if (!n)
return NULL;