Re: [patch] radix-tree: fix small lockless radix-tree bug

From: Andrew Morton
Date: Thu Jun 12 2008 - 15:35:36 EST


On Fri, 13 Jun 2008 05:03:45 +1000
Nick Piggin <nickpiggin@xxxxxxxxxxxx> wrote:

> @@ -124,6 +175,17 @@ static void radix_tree_node_rcu_free(str
> {
> struct radix_tree_node *node =
> container_of(head, struct radix_tree_node, rcu_head);
> +
> + /*
> + * must only free zeroed nodes into the slab. radix_tree_shrink
> + * can leave us with a non-NULL entry in the first slot, so clear
> + * that here to make sure.
> + */
> + tag_clear(node, 0, 0);
> + tag_clear(node, 1, 0);
> + node->slots[0] = NULL;
> + node->count = 0;
> +
> kmem_cache_free(radix_tree_node_cachep, node);
> }

oic, that stuff got moved from the synchronous case into the RCU callback
case.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/