From: Mathieu Desnoyers Date: Sun, 11 Sep 2011 01:11:56 +0000 (-0700) Subject: rculfhash: Fix off-by-one in fini_table X-Git-Tag: v0.7.0~43^2~165 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=21263e2119a45df1dfa25e71e7a4dd15af73f791;p=userspace-rcu.git rculfhash: Fix off-by-one in fini_table Signed-off-by: Mathieu Desnoyers --- diff --git a/rculfhash.c b/rculfhash.c index 4b781f7..f6c901b 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -890,8 +890,12 @@ void fini_table(struct cds_lfht *ht, struct rcu_table *t, len = !i ? 1 : 1UL << (i - 1); dbg_printf("fini order %lu len: %lu\n", i, len); - /* Update table size */ - t->size = 1UL << (i - 1); + /* + * Update table size. Need to shrink this table prior to + * removal so gc lookups use non-logically-removed dummy + * nodes. + */ + t->size = 1UL << (i - 2); /* Unlink */ for (j = 0; j < len; j++) { struct cds_lfht_node *fini_node =