diff options
author | Dave Jones <davej@redhat.com> | 2008-07-25 04:45:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 13:53:29 -0400 |
commit | 924d9addb9b1474fc81a78a5c6706755efea7aaa (patch) | |
tree | 27dc56aa21fa948df8d50192225c1529f4c81c57 /lib/list_debug.c | |
parent | d955c78ac4699ac9c3fe07be62982cda13d13267 (diff) |
list debugging: use WARN() instead of BUG()
Arjan noted that the list_head debugging is BUG'ing when it detects
corruption. By causing the box to panic immediately, we're possibly
losing some bug reports. Changing this to a WARN() should mean we at the
least start seeing reports collected at kerneloops.org
Signed-off-by: Dave Jones <davej@redhat.com>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/list_debug.c')
-rw-r--r-- | lib/list_debug.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/lib/list_debug.c b/lib/list_debug.c index 45c03fd608dd..1a39f4e3ae1f 100644 --- a/lib/list_debug.c +++ b/lib/list_debug.c | |||
@@ -20,18 +20,14 @@ void __list_add(struct list_head *new, | |||
20 | struct list_head *prev, | 20 | struct list_head *prev, |
21 | struct list_head *next) | 21 | struct list_head *next) |
22 | { | 22 | { |
23 | if (unlikely(next->prev != prev)) { | 23 | WARN(next->prev != prev, |
24 | printk(KERN_ERR "list_add corruption. next->prev should be " | 24 | "list_add corruption. next->prev should be " |
25 | "prev (%p), but was %p. (next=%p).\n", | 25 | "prev (%p), but was %p. (next=%p).\n", |
26 | prev, next->prev, next); | 26 | prev, next->prev, next); |
27 | BUG(); | 27 | WARN(prev->next != next, |
28 | } | 28 | "list_add corruption. prev->next should be " |
29 | if (unlikely(prev->next != next)) { | 29 | "next (%p), but was %p. (prev=%p).\n", |
30 | printk(KERN_ERR "list_add corruption. prev->next should be " | 30 | next, prev->next, prev); |
31 | "next (%p), but was %p. (prev=%p).\n", | ||
32 | next, prev->next, prev); | ||
33 | BUG(); | ||
34 | } | ||
35 | next->prev = new; | 31 | next->prev = new; |
36 | new->next = next; | 32 | new->next = next; |
37 | new->prev = prev; | 33 | new->prev = prev; |
@@ -47,16 +43,12 @@ EXPORT_SYMBOL(__list_add); | |||
47 | */ | 43 | */ |
48 | void list_del(struct list_head *entry) | 44 | void list_del(struct list_head *entry) |
49 | { | 45 | { |
50 | if (unlikely(entry->prev->next != entry)) { | 46 | WARN(entry->prev->next != entry, |
51 | printk(KERN_ERR "list_del corruption. prev->next should be %p, " | 47 | "list_del corruption. prev->next should be %p, " |
52 | "but was %p\n", entry, entry->prev->next); | 48 | "but was %p\n", entry, entry->prev->next); |
53 | BUG(); | 49 | WARN(entry->next->prev != entry, |
54 | } | 50 | "list_del corruption. next->prev should be %p, " |
55 | if (unlikely(entry->next->prev != entry)) { | 51 | "but was %p\n", entry, entry->next->prev); |
56 | printk(KERN_ERR "list_del corruption. next->prev should be %p, " | ||
57 | "but was %p\n", entry, entry->next->prev); | ||
58 | BUG(); | ||
59 | } | ||
60 | __list_del(entry->prev, entry->next); | 52 | __list_del(entry->prev, entry->next); |
61 | entry->next = LIST_POISON1; | 53 | entry->next = LIST_POISON1; |
62 | entry->prev = LIST_POISON2; | 54 | entry->prev = LIST_POISON2; |