dm vdo dedupe: silence sparse warnings about locking context imbalances
authorMike Snitzer <snitzer@kernel.org>
Tue, 6 Feb 2024 02:04:20 +0000 (21:04 -0500)
committerMike Snitzer <snitzer@kernel.org>
Tue, 20 Feb 2024 18:43:18 +0000 (13:43 -0500)
Annotate both open_index() and close_index() with
__must_hold(&zones->lock) to silence these sparse warnings:
 warning: context imbalance in 'close_index' - unexpected unlock
 warning: context imbalance in 'open_index' - unexpected unlock

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Susan LeGendre-McGhee <slegendr@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
drivers/md/dm-vdo/dedupe.c

index 8533f1669a01be4f7f1197ee53df36316bb499a7..4b00135511dd1da6a4df24be7f070a7aa1e2e041 100644 (file)
@@ -2092,6 +2092,7 @@ static void finish_uds_queue(void *ptr __always_unused)
 }
 
 static void close_index(struct hash_zones *zones)
+       __must_hold(&zones->lock)
 {
        int result;
 
@@ -2113,6 +2114,7 @@ static void close_index(struct hash_zones *zones)
 }
 
 static void open_index(struct hash_zones *zones)
+       __must_hold(&zones->lock)
 {
        /* ASSERTION: We enter in IS_CLOSED state. */
        int result;