Re: [PATCH] 2.5.39 list_head debugging

Zach Brown (zab@zabbo.net)
Sun, 29 Sep 2002 10:30:24 -0400


> > This patch adds some straight-forward assertions that check the
> > validity of arguments to the list_* inlines. [...]
>
> + BUG_ON(list == NULL);
> + BUG_ON(list->next == NULL);
> + BUG_ON(list->prev == NULL);

oh, sorry, I'm reminded that list->next == NULL check is indeed needed.
list_empty(list) will fail when the elements are null (list->NULL !=
list) but the entry isn't on any lists.

so we can lose the first check, sure, it was just cute, but I'd like to
keep checking for null member pointers. They already found a bug in
vmscan.c where list_empty(mapping->blahblah) was failing for the swapper
mapping even though it was on no lists. (harmless? perhaps, but not
the symantics list_head is trying to provide)

- z
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/