From: Amol Grover Date: Sun, 16 Feb 2020 07:43:30 +0000 (+0530) Subject: posix-timers: Pass lockdep expression to RCU lists X-Git-Tag: v5.7-rc1~174^2~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5fb1c2a5bbf79ccca8d17cf97f66085be5808027;p=thirdparty%2Fkernel%2Flinux.git posix-timers: Pass lockdep expression to RCU lists head is traversed using hlist_for_each_entry_rcu outside an RCU read-side critical section but under the protection of hash_lock. Hence, add corresponding lockdep expression to silence false-positive lockdep warnings, and harden RCU lists. [ tglx: Removed the macro and put the condition right where it's used ] Signed-off-by: Amol Grover Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200216074330.GA14025@workstation-portable --- diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index ff0eb30de346d..07709ac30439a 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -121,7 +121,8 @@ static struct k_itimer *__posix_timers_find(struct hlist_head *head, { struct k_itimer *timer; - hlist_for_each_entry_rcu(timer, head, t_hash) { + hlist_for_each_entry_rcu(timer, head, t_hash, + lockdep_is_held(&hash_lock)) { if ((timer->it_signal == sig) && (timer->it_id == id)) return timer; }