]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: Fix rhlist duplicates insertion
authorPaul Blakey <paulb@mellanox.com>
Sun, 4 Mar 2018 15:29:48 +0000 (17:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Mar 2018 15:44:02 +0000 (10:44 -0500)
commit8f115e7722c47a6df84dd60d055498028cf0e96f
treeb9d783bcc753f9a78d238535a30a55050413eca8
parent8cf01ed2cbde52b5da621f992e5367fcbcebe00f
rhashtable: Fix rhlist duplicates insertion

When inserting duplicate objects (those with the same key),
current rhlist implementation messes up the chain pointers by
updating the bucket pointer instead of prev next pointer to the
newly inserted node. This causes missing elements on removal and
travesal.

Fix that by properly updating pprev pointer to point to
the correct rhash_head next pointer.

Issue: 1241076
Change-Id: I86b2c140bcb4aeb10b70a72a267ff590bb2b17e7
Fixes: 4e629a1d0743 ('rhashtable: Add rhlist interface')
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rhashtable.h
lib/rhashtable.c