From 64a71f0b8a37145a387029bd8ad35b7aa864add8 Mon Sep 17 00:00:00 2001 From: Filipe Manana Date: Wed, 23 Oct 2024 12:43:35 +0100 Subject: [PATCH] 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 Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/delayed-ref.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c index 9f8853fb9fa66..f74154c564320 100644 --- a/fs/btrfs/delayed-ref.c +++ b/fs/btrfs/delayed-ref.c @@ -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; -- 2.50.1