[PATCH] More list debugging context
authorDave Jones <davej@redhat.com>
Thu, 7 Dec 2006 04:37:09 +0000 (20:37 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Thu, 7 Dec 2006 16:39:35 +0000 (08:39 -0800)
Print the other (hopefully) known good pointer when list_head debugging
too, which may yield additional clues.

Also fix for 80-columns to win akpm brownie points.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
lib/list_debug.c

index 7ba9d823d388665cdef6cb647a13cc0bd41ddb75..4350ba9655bd182c966c1fc40909ace292c8a4a6 100644 (file)
@@ -21,13 +21,15 @@ void __list_add(struct list_head *new,
                              struct list_head *next)
 {
        if (unlikely(next->prev != prev)) {
-               printk(KERN_ERR "list_add corruption. next->prev should be %p, but was %p\n",
-                       prev, next->prev);
+               printk(KERN_ERR "list_add corruption. next->prev should be "
+                       "prev (%p), but was %p. (next=%p).\n",
+                       prev, next->prev, next);
                BUG();
        }
        if (unlikely(prev->next != next)) {
-               printk(KERN_ERR "list_add corruption. prev->next should be %p, but was %p\n",
-                       next, prev->next);
+               printk(KERN_ERR "list_add corruption. prev->next should be "
+                       "next (%p), but was %p. (prev=%p).\n",
+                       next, prev->next, prev);
                BUG();
        }
        next->prev = new;