diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-03-23 14:50:19 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-24 03:07:51 +0100 |
commit | d88252f9bb74d266653542b753f9ab404e8b88db (patch) | |
tree | 80d4a55b46bfbe2e93748cab6345b5dd678a4b6b /lib/rhashtable.c | |
parent | Merge tag 'linux-can-next-for-4.1-20150323' of git://git.kernel.org/pub/scm/l... (diff) | |
download | linux-d88252f9bb74d266653542b753f9ab404e8b88db.tar.xz linux-d88252f9bb74d266653542b753f9ab404e8b88db.zip |
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 '')
-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; |