From: Filipe Manana Date: Wed, 23 Oct 2024 11:43:35 +0000 (+0100) Subject: btrfs: assert delayed refs lock is held at find_first_ref_head() X-Git-Tag: v6.13-rc1~213^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=64a71f0b8a37145a387029bd8ad35b7aa864add8;p=thirdparty%2Flinux.git 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 --- 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;