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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -29,8 +29,10 @@ algorithms:
  rcu_read_lock()
  obj = lockless_lookup(key);
  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;
    }
    /*
    * Because a writer could delete object, and a writer could
    * reuse these object before the RCU grace period, we