From ff9ccc0f86b4691410f3432dc326ee5a371267a8 Mon Sep 17 00:00:00 2001 From: John Ogness Date: Mon, 21 Oct 2024 12:20:03 +0000 Subject: [PATCH] rintk: Add notation to console_srcu locking stable inclusion from stable-v6.12-rc1 commit eda25860bf6e71932311f1b5acdf8fc05cd84ff3 category: bugfix bugzilla: 190343 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eda25860bf6e71932311f1b5acdf8fc05cd84ff3 -------------------------------- kernel/printk/printk.c:284:5: sparse: sparse: context imbalance in 'console_srcu_read_lock' - wrong count at exit include/linux/srcu.h:301:9: sparse: sparse: context imbalance in 'console_srcu_read_unlock' - unexpected unlock Fixes: 6c4afa79147e ("printk: Prepare for SRCU console list protection") Signed-off-by: John Ogness Reviewed-by: Petr Mladek Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20240820063001.36405-2-john.ogness@linutronix.de Signed-off-by: Petr Mladek Signed-off-by: Xiaomeng Zhang --- kernel/printk/printk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index b4e390e0b4bd..1ab3185846a7 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -288,6 +288,7 @@ EXPORT_SYMBOL(console_list_unlock); * Return: A cookie to pass to console_srcu_read_unlock(). */ int console_srcu_read_lock(void) + __acquires(&console_srcu) { return srcu_read_lock_nmisafe(&console_srcu); } @@ -301,6 +302,7 @@ EXPORT_SYMBOL(console_srcu_read_lock); * Counterpart to console_srcu_read_lock() */ void console_srcu_read_unlock(int cookie) + __releases(&console_srcu) { srcu_read_unlock_nmisafe(&console_srcu, cookie); } -- Gitee