diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-03-12 21:54:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-12 23:02:30 -0400 |
commit | 393619474ec0ba2a16dee12ec78fd43164f1e9b7 (patch) | |
tree | 892a4eeba956db8f8abc28420ec29ac4cb0e7e53 /lib/rhashtable.c | |
parent | a5b6846f9e1a080493210013385c28faecee36f0 (diff) |
rhashtable: Fix read-side crash during rehash
This patch fixes a typo rhashtable_lookup_compare where we fail
to recompute the hash when looking up the new table. This causes
elements to be missed and potentially a crash during a resize.
Reported-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/rhashtable.c')
-rw-r--r-- | lib/rhashtable.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index adea791ea3ab..fc0d451279f0 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
@@ -606,8 +606,8 @@ void *rhashtable_lookup_compare(struct rhashtable *ht, const void *key, | |||
606 | rcu_read_lock(); | 606 | rcu_read_lock(); |
607 | 607 | ||
608 | tbl = rht_dereference_rcu(ht->tbl, ht); | 608 | tbl = rht_dereference_rcu(ht->tbl, ht); |
609 | hash = key_hashfn(ht, tbl, key); | ||
610 | restart: | 609 | restart: |
610 | hash = key_hashfn(ht, tbl, key); | ||
611 | rht_for_each_rcu(he, tbl, hash) { | 611 | rht_for_each_rcu(he, tbl, hash) { |
612 | if (!compare(rht_obj(ht, he), arg)) | 612 | if (!compare(rht_obj(ht, he), arg)) |
613 | continue; | 613 | continue; |