From: Herbert Xu Date: Mon, 23 Mar 2015 13:50:19 +0000 (+1100) Subject: rhashtable: Add barrier to ensure we see new tables in walker X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d88252f9bb74d266653542b753f9ab404e8b88db;p=linux-beck.git rhashtable: Add barrier to ensure we see new tables in walker The walker is a lockless reader so it too needs an smp_rmb before reading the future_tbl field in order to see any new tables that may contain elements that we should have walked over. Signed-off-by: Herbert Xu Acked-by: Thomas Graf Signed-off-by: David S. Miller --- diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 83cfedd6612a..618a3f00d712 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -477,6 +477,9 @@ next: iter->skip = 0; } + /* Ensure we see any new tables. */ + smp_rmb(); + iter->walker->tbl = rht_dereference_rcu(tbl->future_tbl, ht); if (iter->walker->tbl) { iter->slot = 0;