mm/zsmalloc: add missing annotation for migrate_read_lock()
authorJules Irenge <jbi.octave@gmail.com>
Tue, 7 Apr 2020 03:08:21 +0000 (20:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Apr 2020 17:43:41 +0000 (10:43 -0700)
Sparse reports a warning at migrate_read_lock()()

 warning: context imbalance in migrate_read_lock() - wrong count at exit

The root cause is the missing annotation at migrate_read_lock()
Add the missing __acquires(&zspage->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Minchan Kim <minchan@kernel.org>
Link: http://lkml.kernel.org/r/20200214204741.94112-11-jbi.octave@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/zsmalloc.c

index 22d17ecfe7df464412426e2dc4079c541f28ae4d..da70817b4ed8614e917720cf533fdf0fb69cf0b1 100644 (file)
@@ -1833,7 +1833,7 @@ static void migrate_lock_init(struct zspage *zspage)
        rwlock_init(&zspage->lock);
 }
 
-static void migrate_read_lock(struct zspage *zspage)
+static void migrate_read_lock(struct zspage *zspage) __acquires(&zspage->lock)
 {
        read_lock(&zspage->lock);
 }