From: Alan Huang Date: Tue, 13 Jun 2023 00:57:01 +0000 (+0000) Subject: docs/RCU: Add the missing rcu_read_unlock() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=bc25e7c3598e56992120505ea09f6cf0651da63b;p=linux.git docs/RCU: Add the missing rcu_read_unlock() We should exit the RCU read-side critical section before re-entering. Signed-off-by: Alan Huang Signed-off-by: Paul E. McKenney --- diff --git a/Documentation/RCU/rculist_nulls.rst b/Documentation/RCU/rculist_nulls.rst index 9a734bf54b766..0612a6387d8ec 100644 --- a/Documentation/RCU/rculist_nulls.rst +++ b/Documentation/RCU/rculist_nulls.rst @@ -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