btrfs: add missing annotation for btrfs_lock_cluster()
authorJules Irenge <jbi.octave@gmail.com>
Tue, 31 Mar 2020 20:46:41 +0000 (21:46 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:16 +0000 (11:25 +0200)
Sparse reports a warning at btrfs_lock_cluster()

warning: context imbalance in btrfs_lock_cluster()
- wrong count

The root cause is the missing annotation at btrfs_lock_cluster()
Add the missing __acquires(&cluster->refill_lock) annotation.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c

index 54a64d1e18c6b60c3e891257815753e4046bcf33..752b229cbb1362490d4dcfb245523dd114453b47 100644 (file)
@@ -3369,6 +3369,7 @@ static struct btrfs_block_group *btrfs_lock_cluster(
                   struct btrfs_block_group *block_group,
                   struct btrfs_free_cluster *cluster,
                   int delalloc)
+       __acquires(&cluster->refill_lock)
 {
        struct btrfs_block_group *used_bg = NULL;