From 194fdbd18a42d2c23f4a53cc692f1fa03d31ec64 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Mon, 17 Oct 2011 10:34:36 -0400 Subject: [PATCH] Fix dummy node insertion bug dummy node is the first node of the identical-hash-value chain Signed-off-by: Lai Jiangshan Signed-off-by: Mathieu Desnoyers --- rculfhash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rculfhash.c b/rculfhash.c index 6e07878..a736b86 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -887,6 +887,9 @@ struct cds_lfht_node *_cds_lfht_add(struct cds_lfht *ht, goto insert; if (likely(clear_flag(iter)->p.reverse_hash > node->p.reverse_hash)) goto insert; + /* dummy node is the first node of the identical-hash-value chain */ + if (dummy && clear_flag(iter)->p.reverse_hash == node->p.reverse_hash) + goto insert; next = rcu_dereference(clear_flag(iter)->p.next); if (unlikely(is_removed(next))) goto gc_node; -- 2.34.1