Fix dummy node insertion bug
authorLai Jiangshan <laijs@cn.fujitsu.com>
Mon, 17 Oct 2011 14:34:36 +0000 (10:34 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Oct 2011 14:34:36 +0000 (10:34 -0400)
dummy node is the first node of the identical-hash-value chain

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c

index 6e07878a1c3db3c2afac4700727491a2aa8be3ea..a736b868ae7dac21c1d4d60d561cfcfbb1d223e9 100644 (file)
@@ -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;
This page took 0.02731 seconds and 4 git commands to generate.