netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Joe Perches <joe@perches.com>
Cc: Ben Greear <greearb@candelatech.com>,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Arnd Bergmann <arnd@arndb.de>,
	netdev@vger.kernel.org
Subject: [patch] net/core/filter.c: Fix build error
Date: Thu, 26 May 2011 14:31:53 +0200	[thread overview]
Message-ID: <20110526123153.GA16002@elte.hu> (raw)
In-Reply-To: <efa062542c692c3f7743bf2d97b5987ab989e27e.1305999731.git.joe@perches.com>


* Joe Perches <joe@perches.com> wrote:

> A mis-configured filter can spam the logs with lots of stack traces.
> 
> Rate-limit the warnings and add printout of the bogus filter information.
> 
> Original-patch-by: Ben Greear <greearb@candelatech.com>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  net/core/filter.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 0eb8c44..0e3622f 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -350,7 +350,9 @@ load_b:
>  			continue;
>  		}
>  		default:
> -			WARN_ON(1);
> +			WARN_RATELIMIT(1, "Unknown code:%u jt:%u tf:%u k:%u\n",
> +				       fentry->code, fentry->jt,
> +				       fentry->jf, fentry->k);
>  			return 0;
>  		}

This change (now upstream) fails to build in about 20% of all 
randconfigs. Fix is below.

Thanks,

	Ingo

--------------------->
From b658026bc4915d16ff3e0f59b0edda11dbd6b991 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Thu, 26 May 2011 14:11:14 +0200
Subject: [PATCH] net/core/filter.c: Fix build error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix:

  net/core/filter.c:353:4: error: invalid storage class for function ‘DEFINE_RATELIMIT_STATE’

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 net/core/filter.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index 0e3622f..36f975f 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -38,6 +38,7 @@
 #include <asm/unaligned.h>
 #include <linux/filter.h>
 #include <linux/reciprocal_div.h>
+#include <linux/ratelimit.h>
 
 /* No hurry in this branch */
 static void *__load_pointer(const struct sk_buff *skb, int k, unsigned int size)

  reply	other threads:[~2011-05-26 12:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 18:30 [PATCH] sk-filter: Rate-limit WARNing, print dbg info greearb
2011-05-17 18:52 ` Joe Perches
2011-05-17 19:23   ` David Miller
2011-05-17 19:34     ` Ben Greear
2011-05-17 19:39       ` David Miller
2011-05-17 19:53       ` Joe Perches
     [not found]         ` <4DD2DB9D.6050306@candelatech.com>
2011-05-17 21:13           ` RFC: Add WARN_RATELIMIT to bug.h (was: Re: [PATCH] sk-filter: Rate-limit WARNing, print dbg info.) Joe Perches
2011-05-21 17:48             ` [PATCH 0/2] Add and use WARN_RATELIMIT Joe Perches
2011-05-21 17:48               ` [PATCH 1/2] bug.h: Add WARN_RATELIMIT Joe Perches
2011-05-21 17:48               ` [PATCH 2/2] net: filter: Use WARN_RATELIMIT Joe Perches
2011-05-26 12:31                 ` Ingo Molnar [this message]
2011-05-26 15:31                   ` [patch] net/core/filter.c: Fix build error Joe Perches
2011-05-26 18:38                     ` David Miller
2011-05-26 18:57                       ` Randy Dunlap
2011-05-26 19:00                         ` David Miller
2011-05-26 19:07                       ` Joe Perches
2011-05-26 19:09                       ` Ingo Molnar
2011-05-26 19:12                         ` Ingo Molnar
2011-05-23 21:38               ` [PATCH 0/2] Add and use WARN_RATELIMIT David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110526123153.GA16002@elte.hu \
    --to=mingo@elte.hu \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=greearb@candelatech.com \
    --cc=joe@perches.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).