Message ID | 20150313015410.GA28133@gondor.apana.org.au |
---|---|
State | Accepted, archived |
Headers | show |
From: Herbert Xu <herbert@gondor.apana.org.au> Date: Fri, 13 Mar 2015 12:54:10 +1100 > 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> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 9666efec..f8c5063 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -614,8 +614,8 @@ void *rhashtable_lookup_compare(struct rhashtable *ht, const void *key, rcu_read_lock(); tbl = rht_dereference_rcu(ht->tbl, ht); - hash = key_hashfn(ht, tbl, key); restart: + hash = key_hashfn(ht, tbl, key); rht_for_each_rcu(he, tbl, hash) { if (!compare(rht_obj(ht, he), arg)) continue;