[ltt-dev] [PATCH 01/11] Fix dummy node insertion bug

Lai Jiangshan laijs at cn.fujitsu.com
Fri Oct 14 11:04:31 EDT 2011


dummy node is the first node of the identical-hash-value chain

Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
---
 rculfhash.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/rculfhash.c b/rculfhash.c
index 3ded228..d7a4df3 100644
--- a/rculfhash.c
+++ b/rculfhash.c
@@ -875,6 +875,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;
-- 
1.7.4.4





More information about the lttng-dev mailing list