aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-03-23 09:50:19 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-23 22:07:51 -0400
commitd88252f9bb74d266653542b753f9ab404e8b88db (patch)
tree80d4a55b46bfbe2e93748cab6345b5dd678a4b6b /lib
parente167359be0c7d856445aa97e1bf82b5a55eb55b2 (diff)
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 <herbert@gondor.apana.org.au> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/rhashtable.c3
1 files changed, 3 insertions, 0 deletions
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:
477 iter->skip = 0; 477 iter->skip = 0;
478 } 478 }
479 479
480 /* Ensure we see any new tables. */
481 smp_rmb();
482
480 iter->walker->tbl = rht_dereference_rcu(tbl->future_tbl, ht); 483 iter->walker->tbl = rht_dereference_rcu(tbl->future_tbl, ht);
481 if (iter->walker->tbl) { 484 if (iter->walker->tbl) {
482 iter->slot = 0; 485 iter->slot = 0;