linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] rculist: Fix list_entry_rcu to read ptr with rcu_dereference_raw
@ 2015-03-24 10:31 Patrick Marlier
  2015-03-25 14:30 ` Paul E. McKenney
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Marlier @ 2015-03-24 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul E. McKenney, Josh Triplett

Change to read effectively ptr with rcu_dereference_raw and not the
__ptr variable on the stack.

Signed-off-by: Patrick Marlier <patrick.marlier@gmail.com>
---
  include/linux/rculist.h | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index a18b16f..9d9baea 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -247,10 +247,7 @@ static inline void list_splice_init_rcu(struct 
list_head *list,
   * primitives such as list_add_rcu() as long as it's guarded by 
rcu_read_lock().
   */
  #define list_entry_rcu(ptr, type, member) \
-({ \
-   typeof(*ptr) __rcu *__ptr = (typeof(*ptr) __rcu __force *)ptr; \
-   container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \
-})
+   container_of((typeof(ptr))rcu_dereference_raw(ptr), type, member)

  /**
   * Where are list_empty_rcu() and list_first_entry_rcu()?
-- 
2.1.0


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

end of thread, other threads:[~2015-04-14 20:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-24 10:31 [PATCH 1/3] rculist: Fix list_entry_rcu to read ptr with rcu_dereference_raw Patrick Marlier
2015-03-25 14:30 ` Paul E. McKenney
2015-03-25 15:01   ` Patrick Marlier
2015-03-28 10:42     ` Paul E. McKenney
2015-03-28 10:47       ` Paul E. McKenney
2015-04-13 11:39         ` Patrick Marlier
2015-04-14 20:34           ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).