diff options
author | NeilBrown <neilb@suse.com> | 2018-04-24 08:29:13 +1000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-24 13:21:45 -0400 |
commit | b41cc04b662ac96bbb291fb66b7b8aab5bc0a8c9 (patch) | |
tree | bb7b31dd529c7fe044ae0737e8c3fecd94d368fc /lib/rhashtable.c | |
parent | 82266e98dd4d8e7d5b8e4a0fedeb91f2eb29d306 (diff) | |
download | linux-b41cc04b662ac96bbb291fb66b7b8aab5bc0a8c9.tar.gz linux-b41cc04b662ac96bbb291fb66b7b8aab5bc0a8c9.tar.bz2 linux-b41cc04b662ac96bbb291fb66b7b8aab5bc0a8c9.zip |
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 <herbert@gondor.apana.org.au>
Signed-off-by: NeilBrown <neilb@suse.com>
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, 2 insertions, 0 deletions
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; } |