Thread (7 messages) 7 messages, 3 authors, 2008-11-26

Re: [PATCH] net: make skb_truesize_bug() call WARN()

From: Arjan van de Ven <hidden>
Date: 2008-11-25 17:53:33
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

On Tue, 25 Nov 2008 16:42:03 +0000
Ben Hutchings [off-list ref] wrote:
On Tue, 2008-11-25 at 08:32 -0800, Arjan van de Ven wrote:
quoted
From 97a8ab520c378568e172c555a156b469137a3828 Mon Sep 17 00:00:00
2001 From: Arjan van de Ven [off-list ref]
Date: Tue, 25 Nov 2008 08:30:04 -0800
Subject: [PATCH] net: make skb_truesize_bug() call WARN()

The truesize message check is important enough to make it print
"BUG" to the user console... lets also make it important enough to
spit a backtrace/module list etc so that kerneloops.org can track
them.

Signed-off-by: Arjan van de Ven <redacted>
---
 net/core/skbuff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 391be91..1a1f4d1 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -149,7 +149,7 @@ void skb_under_panic(struct sk_buff *skb, int
sz, void *here) 
 void skb_truesize_bug(struct sk_buff *skb)
 {
-	printk(KERN_ERR "SKB BUG: Invalid truesize (%u) "
+	WARN(1, KERN_ERR "SKB BUG: Invalid truesize (%u) "
 	       "len=%u, sizeof(sk_buff)=%Zd\n",
 	       skb->truesize, skb->len, sizeof(struct sk_buff));
 }
The bug reports I've seen (with my Debian hat on, not relating to
sfc) show that configurations that trigger this warning are likely to
trigger many times over and there's nothing the user can do about
it.  So by all means do make the warning more obvious, but please
make it WARN_ON_ONCE and then use printk qualified by net_ratelimit().
if there's no value in those subsequent printk's.. why not just this?

From 97a8ab520c378568e172c555a156b469137a3828 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <redacted>
Date: Tue, 25 Nov 2008 08:30:04 -0800
Subject: [PATCH] net: make skb_truesize_bug() call WARN()

The truesize message check is important enough to make it print "BUG" to the
user console... lets also make it important enough to spit a backtrace/module list
etc so that kerneloops.org can track them.

Signed-off-by: Arjan van de Ven <redacted>
---
 net/core/skbuff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 391be91..1a1f4d1 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -149,7 +149,7 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here)
 
 void skb_truesize_bug(struct sk_buff *skb)
 {
-	printk(KERN_ERR "SKB BUG: Invalid truesize (%u) "
+	WARN_ONCE(1, KERN_ERR "SKB BUG: Invalid truesize (%u) "
 	       "len=%u, sizeof(sk_buff)=%Zd\n",
 	       skb->truesize, skb->len, sizeof(struct sk_buff));
 }
-- 
1.6.0.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help