diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-03-24 00:50:19 +1100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-23 22:07:51 -0400 |
commit | d88252f9bb74d266653542b753f9ab404e8b88db (patch) | |
tree | 80d4a55b46bfbe2e93748cab6345b5dd678a4b6b /lib/rhashtable.c | |
parent | e167359be0c7d856445aa97e1bf82b5a55eb55b2 (diff) | |
download | linux-d88252f9bb74d266653542b753f9ab404e8b88db.tar.bz2 |
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/rhashtable.c')
-rw-r--r-- | lib/rhashtable.c | 3 |
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: 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; |