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

We have 3 callers for find_ref_head() so assert at find_ref_head() that we
have the delayed refs lock held, removing the assertion from one of its
callers (btrfs_find_delayed_ref_head()).

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:41:17 +01:00 committed by David Sterba
parent 5f54384c73
commit 7226ed7d44

View File

@ -407,6 +407,8 @@ static struct btrfs_delayed_ref_head *find_ref_head(
struct rb_node *n;
struct btrfs_delayed_ref_head *entry;
lockdep_assert_held(&dr->lock);
n = root->rb_node;
entry = NULL;
while (n) {
@ -1195,8 +1197,6 @@ btrfs_find_delayed_ref_head(const struct btrfs_fs_info *fs_info,
struct btrfs_delayed_ref_root *delayed_refs,
u64 bytenr)
{
lockdep_assert_held(&delayed_refs->lock);
return find_ref_head(fs_info, delayed_refs, bytenr, false);
}