Re: [PATCH] Extend list debugging to cover hlists

From: Arjan van de Ven
Date: Fri May 02 2008 - 14:32:53 EST


On Fri, 2 May 2008 12:27:46 -0600
Matthew Wilcox <matthew@xxxxxx> wrote:

> +void hlist_check(struct hlist_node *n)
> +{
> + if (unlikely(*n->pprev != n)) {
> + printk(KERN_ERR "hlist corruption. *pprev should be
> %p, "
> + "but was %p\n", n, *n->pprev);
> + BUG();
> + }
> + if (unlikely(n->next != NULL && n->next->pprev != &n->next))
> {
> + printk(KERN_ERR "hlist corruption. n->next->pprev
> should be"
> + "%p, but was %p\n", &n->next,
> n->next->pprev);
> + BUG();
> + }
> +}
> +EXPORT_SYMBOL(hlist_check);
>


Hi,
I like the concept of the patch; however...
BUG() is a tad on the rude side... how about WARN_ON(1) ?
--
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/