diff options
-rw-r--r-- | kernel/srcu.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/srcu.c b/kernel/srcu.c index e34f2991ed41..01d5ccb8bfe3 100644 --- a/kernel/srcu.c +++ b/kernel/srcu.c | |||
@@ -298,9 +298,8 @@ int __srcu_read_lock(struct srcu_struct *sp) | |||
298 | { | 298 | { |
299 | int idx; | 299 | int idx; |
300 | 300 | ||
301 | idx = ACCESS_ONCE(sp->completed) & 0x1; | ||
301 | preempt_disable(); | 302 | preempt_disable(); |
302 | idx = rcu_dereference_index_check(sp->completed, | ||
303 | rcu_read_lock_sched_held()) & 0x1; | ||
304 | ACCESS_ONCE(this_cpu_ptr(sp->per_cpu_ref)->c[idx]) += 1; | 303 | ACCESS_ONCE(this_cpu_ptr(sp->per_cpu_ref)->c[idx]) += 1; |
305 | smp_mb(); /* B */ /* Avoid leaking the critical section. */ | 304 | smp_mb(); /* B */ /* Avoid leaking the critical section. */ |
306 | ACCESS_ONCE(this_cpu_ptr(sp->per_cpu_ref)->seq[idx]) += 1; | 305 | ACCESS_ONCE(this_cpu_ptr(sp->per_cpu_ref)->seq[idx]) += 1; |