From: Lai Jiangshan Date: Mon, 17 Oct 2011 14:34:36 +0000 (-0400) Subject: Fix dummy node insertion bug X-Git-Tag: v0.7.0~43^2~88 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=194fdbd18a42d2c23f4a53cc692f1fa03d31ec64;p=urcu.git 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 --- 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;