diff options
author | Phil Sutter <phil@nwl.cc> | 2017-07-21 16:51:31 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-24 14:13:58 -0700 |
commit | e859afe1ee0c5ae981c55387ccd45eba258a7842 (patch) | |
tree | b2c0df42a39c4458a782eace46523fe9fd95bdb5 /kernel/acct.c | |
parent | 1d9b86de3776aa0e809745e5c9e272b79a7ac09b (diff) | |
download | linux-e859afe1ee0c5ae981c55387ccd45eba258a7842.tar.bz2 |
lib: test_rhashtable: fix for large entry counts
During concurrent access testing, threadfunc() concatenated thread ID
and object index to create a unique key like so:
| tdata->objs[i].value = (tdata->id << 16) | i;
This breaks if a user passes an entries parameter of 64k or higher,
since 'i' might use more than 16 bits then. Effectively, this will lead
to duplicate keys in the table.
Fix the problem by introducing a struct holding object and thread ID and
using that as key instead of a single integer type field.
Fixes: f4a3e90ba5739 ("rhashtable-test: extend to test concurrency")
Reported by: Manuel Messner <mm@skelett.io>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/acct.c')
0 files changed, 0 insertions, 0 deletions