All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] docs/RCU: Add the missing rcu_read_unlock()
@ 2023-06-13  0:57 Alan Huang
  2023-06-13  3:16 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Huang @ 2023-06-13  0:57 UTC (permalink / raw)
  To: paulmck; +Cc: corbet, rcu, linux-doc, Alan Huang

We should exit the RCU read-side critical section before re-entering.

Signed-off-by: Alan Huang <mmpgouride@gmail.com>
---
 Documentation/RCU/rculist_nulls.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/RCU/rculist_nulls.rst b/Documentation/RCU/rculist_nulls.rst
index 9a734bf54..0612a6387 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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-13  3:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-13  0:57 [PATCH v2] docs/RCU: Add the missing rcu_read_unlock() Alan Huang
2023-06-13  3:16 ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.