]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: Still do rehash when we get EEXIST
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 21 Mar 2019 01:39:52 +0000 (09:39 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Mar 2019 20:57:28 +0000 (13:57 -0700)
commit36428e9cbca02f4d5c3f4da35890c79ffc668f02
treefd643bfe2c653f0b674c4c91eeea0d120bf52018
parentd7f4aecdc653cc6776acc9f521d4274628419a35
rhashtable: Still do rehash when we get EEXIST

As it stands if a shrink is delayed because of an outstanding
rehash, we will go into a rescheduling loop without ever doing
the rehash.

This patch fixes this by still carrying out the rehash and then
rescheduling so that we can shrink after the completion of the
rehash should it still be necessary.

The return value of EEXIST captures this case and other cases
(e.g., another thread expanded/rehashed the table at the same
time) where we should still proceed with the rehash.

Fixes: 1a17cfe58273 ("rhashtable: Add nested tables")
Reported-by: Josh Elsasser <jelsasser@appneta.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Josh Elsasser <jelsasser@appneta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c