[PATCH tip/core/rcu 1/2] rcu: Make bugginess of code sample more evident

From: Paul E. McKenney
Date: Mon Mar 18 2013 - 16:55:43 EST

From: "Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx>

One of the code samples in whatisRCU.txt shows a bug, but someone scanning
the document quickly might mistake it for a valid use of RCU. Add some
screaming comments to help keep speed-readers on track.

Reported-by: Nathan Zimmer <nzimmer@xxxxxxx>
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
Documentation/RCU/whatisRCU.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
index 0cc7820..10df0b8 100644
--- a/Documentation/RCU/whatisRCU.txt
+++ b/Documentation/RCU/whatisRCU.txt
@@ -265,9 +265,9 @@ rcu_dereference()
p = rcu_dereference(head.next);
- x = p->address;
+ x = p->address; /* BUG!!! */
- y = p->data;
+ y = p->data; /* BUG!!! */

Holding a reference from one RCU read-side critical section

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/