Skip to content

Commit

Permalink
btrfs: assert delayed refs lock is held at find_ref_head()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
fdmanana authored and kdave committed Nov 11, 2024
1 parent 5f54384 commit 7226ed7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/delayed-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 7226ed7

Please sign in to comment.