]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitf322610cff94ee7d007cf8034aa48a5697eead93
tree4abc550b1c59f4bf449dd05baad44ce39320557c
parenteb7f2cb504a234ce30b92ac7057ca53ef156c04c
rhashtable: Still do rehash when we get EEXIST

BugLink: https://bugs.launchpad.net/bugs/1838116
[ Upstream commit 408f13ef358aa5ad56dc6230c2c7deb92cf462b1 ]

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: da20420f83ea ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
lib/rhashtable.c