2003-08-18 22:06:15

by Phil Oester

[permalink] [raw]
Subject: [PATCH] Ratelimit SO_BSDCOMPAT warnings

Back in March, there was some discussion about ratelimiting the
BSDCOMPAT errors, and James Morris provided a patch to achieve
this.

http://www.ussg.iu.edu/hypermail/linux/kernel/0303.3/1078.html

To which David Miller stated the patch had been applied.

http://www.ussg.iu.edu/hypermail/linux/kernel/0303.3/1081.html

Unfortunately, it seems to have fallen through the cracks. Below
is the patch again, updated for 2.6.0-test3 - please apply.

Phil Oester

--- linux-2.6.0-test3-orig/net/core/sock.c Sat Aug 9 00:38:59 2003
+++ linux-2.6.0-test3/net/core/sock.c Mon Aug 18 18:01:15 2003
@@ -153,8 +153,13 @@

static void sock_warn_obsolete_bsdism(const char *name)
{
- printk(KERN_WARNING "process `%s' is using obsolete "
- "%s SO_BSDCOMPAT\n", current->comm, name);
+ static int warned;
+
+ if (!warned) {
+ warned = 1;
+ printk(KERN_WARNING "process `%s' is using obsolete "
+ "%s SO_BSDCOMPAT\n", current->comm, name);
+ }
}

/*


2003-08-18 22:15:45

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: [PATCH] Ratelimit SO_BSDCOMPAT warnings

On Mon, 18 Aug 2003 15:06:05 PDT, Phil Oester said:
> Back in March, there was some discussion about ratelimiting the
> BSDCOMPAT errors, and James Morris provided a patch to achieve
> this.

> Unfortunately, it seems to have fallen through the cracks. Below
> is the patch again, updated for 2.6.0-test3 - please apply.

> static void sock_warn_obsolete_bsdism(const char *name)
> {
> - printk(KERN_WARNING "process `%s' is using obsolete "
> - "%s SO_BSDCOMPAT\n", current->comm, name);
> + static int warned;
> +
> + if (!warned) {
> + warned = 1;


Umm.. am I dense, or does this only warn once for *the first program*
to do it after the system boots? And you don't get another warning about
any OTHER programs until you reboot in a few weeks (possibly)?

If so, why are we bothering at all? Once *per process* I could see, but
once per boot?


Attachments:
(No filename) (226.00 B)

2003-08-18 22:55:14

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] Ratelimit SO_BSDCOMPAT warnings

On Mon, 18 Aug 2003 18:15:40 -0400
[email protected] wrote:

> On Mon, 18 Aug 2003 15:06:05 PDT, Phil Oester said:
> > static void sock_warn_obsolete_bsdism(const char *name)
> > {
> > - printk(KERN_WARNING "process `%s' is using obsolete "
> > - "%s SO_BSDCOMPAT\n", current->comm, name);
> > + static int warned;
> > +
> > + if (!warned) {
> > + warned = 1;
>
> Umm.. am I dense, or does this only warn once for *the first program*
> to do it after the system boots? And you don't get another warning about
> any OTHER programs until you reboot in a few weeks (possibly)?

Yes, this patch does suck hard.

I see no reason to apply this, just fix your apps and the
warning will stop. There's only a handful of programs
that trigger this at all.

2003-08-19 00:36:46

by Jamie Lokier

[permalink] [raw]
Subject: Re: [PATCH] Ratelimit SO_BSDCOMPAT warnings

David S. Miller wrote:
> I see no reason to apply this, just fix your apps and the
> warning will stop. There's only a handful of programs
> that trigger this at all.

Unfortunately Red Hat's BIND is among the more prominent. :-/

-- Jamie

2003-08-19 00:37:51

by James Morris

[permalink] [raw]
Subject: Re: [PATCH] Ratelimit SO_BSDCOMPAT warnings

On Mon, 18 Aug 2003 [email protected] wrote:

> If so, why are we bothering at all? Once *per process* I could see, but
> once per boot?

Once per process is too complicated, and an aggregate of people reporting
the message should lead to all of the major apps being fixed.


- James
--
James Morris
<[email protected]>

2003-08-19 01:06:05

by Jamie Lokier

[permalink] [raw]
Subject: Re: [PATCH] Ratelimit SO_BSDCOMPAT warnings

Jamie Lokier wrote:
> David S. Miller wrote:
> > I see no reason to apply this, just fix your apps and the
> > warning will stop. There's only a handful of programs
> > that trigger this at all.
>
> Unfortunately Red Hat's BIND is among the more prominent. :-/

Sorry, I didn't mean to imply _just_ Red Hat. Probably all distros'
BINDs use SO_BSDCOMPAT. What I meant was this is the only program I
notice the warning from, when running a 2.5 kernel on an otherwise Red
Hat 9 system. And it comes up every time I connect to the net, when I
restart named with new forwarders, which is about hourly :/

-- Jamie

2003-08-19 14:36:59

by Phil Oester

[permalink] [raw]
Subject: Re: [PATCH] Ratelimit SO_BSDCOMPAT warnings

Admittedly, recompiling Bind after commenting out the #define from
asm/socket.h does also solve the errors. But it does seem overkill
to warn on every single use of this...

Phil

On Tue, Aug 19, 2003 at 02:05:50AM +0100, Jamie Lokier wrote:
> Jamie Lokier wrote:
> > David S. Miller wrote:
> > > I see no reason to apply this, just fix your apps and the
> > > warning will stop. There's only a handful of programs
> > > that trigger this at all.
> >
> > Unfortunately Red Hat's BIND is among the more prominent. :-/
>
> Sorry, I didn't mean to imply _just_ Red Hat. Probably all distros'
> BINDs use SO_BSDCOMPAT. What I meant was this is the only program I
> notice the warning from, when running a 2.5 kernel on an otherwise Red
> Hat 9 system. And it comes up every time I connect to the net, when I
> restart named with new forwarders, which is about hourly :/
>
> -- Jamie