From 393619474ec0ba2a16dee12ec78fd43164f1e9b7 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Fri, 13 Mar 2015 12:54:10 +1100 Subject: [PATCH] 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 Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- lib/rhashtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, 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; -- 2.39.5