]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
rhashtable: Fix rhlist duplicates insertion
authorPaul Blakey <paulb@mellanox.com>
Sun, 4 Mar 2018 15:29:48 +0000 (17:29 +0200)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 2 Apr 2018 10:19:48 +0000 (07:19 -0300)
commit7ca08768addbd8b0586983e51a57fdeedd9c0e66
treea25c6345d68315e5eb137cc91bfefa29d9efcb9e
parent5345f995118a03b6fea256f9fd63d7e5150f0875
rhashtable: Fix rhlist duplicates insertion

BugLink: http://bugs.launchpad.net/bugs/1760585
[ Upstream commit d3dcf8eb615537526bd42ff27a081d46d337816e ]

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: ca26893f05e8 ('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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
include/linux/rhashtable.h
lib/rhashtable.c