Commit bc25e7c3 authored by Alan Huang's avatar Alan Huang Committed by Paul E. McKenney

docs/RCU: Add the missing rcu_read_unlock()

We should exit the RCU read-side critical section before re-entering.
Signed-off-by: default avatarAlan Huang <mmpgouride@gmail.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 401013e2
...@@ -29,8 +29,10 @@ algorithms: ...@@ -29,8 +29,10 @@ algorithms:
rcu_read_lock() rcu_read_lock()
obj = lockless_lookup(key); obj = lockless_lookup(key);
if (obj) { if (obj) {
if (!try_get_ref(obj)) // might fail for free objects if (!try_get_ref(obj)) { // might fail for free objects
rcu_read_unlock();
goto begin; goto begin;
}
/* /*
* Because a writer could delete object, and a writer could * Because a writer could delete object, and a writer could
* reuse these object before the RCU grace period, we * reuse these object before the RCU grace period, we
......
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