Dmitriy Vyukov 7def0f952e lib: fix data race in rhashtable_rehash_one
rhashtable_rehash_one() uses complex logic to update entry->next field,
after INIT_RHT_NULLS_HEAD and NULLS_MARKER expansion:

entry->next = 1 | ((base + off) << 1)

This can be compiled along the lines of:

entry->next = base + off
entry->next <<= 1
entry->next |= 1

Which will break concurrent readers.

NULLS value recomputation is not needed here, so just remove
the complex logic.

The data race was found with KernelThreadSanitizer (KTSAN).

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-09-22 17:36:07 -07:00
..
2015-08-25 21:13:16 +08:00
2015-07-27 14:06:24 +02:00
2015-07-17 16:39:53 -07:00
2015-09-08 14:35:59 -07:00
2015-07-28 08:50:42 +01:00
2015-09-08 14:35:59 -07:00
2015-06-25 17:00:40 -07:00
2015-06-25 17:00:40 -07:00
2015-07-20 10:52:48 -07:00