]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: Fix reader/rehash race
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 12 Mar 2015 11:07:49 +0000 (22:07 +1100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Mar 2015 03:02:30 +0000 (23:02 -0400)
commit34babac87c94546d7232c56afd880fd201b612f6
tree4631c01eb33d6f8bbcf018f47d31d19ad4fac5a4
parent1926061f4b59bc77cdb79219a1afb5f8a84a4b6a
rhashtable: Fix reader/rehash race

There is a potential race condition between readers and the rehasher.
In particular, the rehasher could have started a rehash while the
reader finishes a scan of the old table but fails to see the new
table pointer.

This patch closes this window by adding smp_wmb/smp_rmb.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c