Skip to content

Commit

Permalink
rhashtable: reset iter when rhashtable_walk_start sees new table
Browse files Browse the repository at this point in the history
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 <herbert@gondor.apana.org.au>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
NeilBrown authored and David S. Miller committed Apr 24, 2018
1 parent 82266e9 commit b41cc04
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rhashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b41cc04

Please sign in to comment.