From: NeilBrown Date: Mon, 23 Apr 2018 22:29:13 +0000 (+1000) Subject: rhashtable: reset iter when rhashtable_walk_start sees new table X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b41cc04b662ac96bbb291fb66b7b8aab5bc0a8c9;p=openwrt%2Fstaging%2Fblogic.git rhashtable: reset iter when rhashtable_walk_start sees new table The documentation claims that when rhashtable_walk_start_check() detects a resize event, it will rewind back to the beginning of the table. This is not true. We need to set ->slot and ->skip to be zero for it to be true. Acked-by: Herbert Xu Signed-off-by: NeilBrown Signed-off-by: David S. Miller --- diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 6d490f51174e..81edf1ab38ab 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -737,6 +737,8 @@ int rhashtable_walk_start_check(struct rhashtable_iter *iter) if (!iter->walker.tbl && !iter->end_of_table) { iter->walker.tbl = rht_dereference_rcu(ht->tbl, ht); + iter->slot = 0; + iter->skip = 0; return -EAGAIN; }