rculfhash: deal with resize to size 1 corner-case
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 8 Sep 2011 00:15:20 +0000 (17:15 -0700)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 8 Sep 2011 00:15:20 +0000 (17:15 -0700)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c

index cd60f5f4db8e7409668b3598ec073fdff5ce5752..b74739f29a30f1953b3e6447fcf8daa44e069354 100644 (file)
@@ -803,7 +803,7 @@ int _cds_lfht_remove(struct cds_lfht *ht, struct rcu_table *t,
         */
 
        if (dummy_removal)
-               index = hash & ((t->size >> 1) - 1);
+               index = hash & ((t->size == 1) ? 0 : (t->size >> 1) - 1);
        else
                index = hash & (t->size - 1);
        order = get_count_order_ulong(index + 1);
This page took 0.02554 seconds and 4 git commands to generate.