Commit 773e3f93 authored by Paul E. McKenney's avatar Paul E. McKenney

rcu: move check from rcu_dereference_bh to rcu_read_lock_bh_held

As suggested by Linus, push the irqs_disabled() down to the
rcu_read_lock_bh_held() level so that all callers get the benefit
of the correct check.
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent b3a084b9
...@@ -454,7 +454,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) ...@@ -454,7 +454,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
* Makes rcu_dereference_check() do the dirty work. * Makes rcu_dereference_check() do the dirty work.
*/ */
#define rcu_dereference_bh(p) \ #define rcu_dereference_bh(p) \
rcu_dereference_check(p, rcu_read_lock_bh_held() || irqs_disabled()) rcu_dereference_check(p, rcu_read_lock_bh_held())
/** /**
* rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched
......
...@@ -86,7 +86,7 @@ int rcu_read_lock_bh_held(void) ...@@ -86,7 +86,7 @@ int rcu_read_lock_bh_held(void)
{ {
if (!debug_lockdep_rcu_enabled()) if (!debug_lockdep_rcu_enabled())
return 1; return 1;
return in_softirq(); return in_softirq() || irqs_disabled();
} }
EXPORT_SYMBOL_GPL(rcu_read_lock_bh_held); EXPORT_SYMBOL_GPL(rcu_read_lock_bh_held);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment