Skip to contentSkip to conversation

Ratelimit SO_BSDCOMPAT warnings

PATCH In review Phil Oester 5 participants 7 messages Aug 18, 2003 – Aug 19, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

net/core/sock.c Mon Aug 18 18:01:15 2003 renamed from net/core/sock.c Sat Aug 9 00:38:59 2003 +7 -2
@@ -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);
+       }
 }
 
 /*
#1 lore raw
Quoted 9 lines · Phil Oester

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) {

net/core/sock.c Mon Aug 18 18:01:15 2003 line 159

Quoted 6 lines
net/core/sock.c Mon Aug 18 18:01:15 2003 renamed from net/core/sock.c Sat Aug 9 00:38:59 2003 +4 -2
-       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?

#2 lore raw
Quoted 10 lines · On Mon, 18 Aug 2003 18:15:40 -0400 [email protected] wrote:

net/core/sock.c Mon Aug 18 18:01:15 2003 line 159

Quoted 8 lines · Phil Oester

static void sock_warn_obsolete_bsdism(const char *name) {

net/core/sock.c Mon Aug 18 18:01:15 2003 renamed from net/core/sock.c Sat Aug 9 00:38:59 2003 +4 -2
-       printk(KERN_WARNING "process `%s' is using obsolete "
-              "%s SO_BSDCOMPAT\n", current->comm, name);
+       static int warned;
+
+       if (!warned) {
+               warned = 1;
Quoted 3 lines

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.

#3 lore raw
Quoted 3 lines · David S. Miller

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

#4 lore raw
In reply to Jamie Lokier
Quoted 6 lines · Jamie Lokier
Quoted 3 lines · David S. Miller

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

#5 lore raw

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

Quoted 15 lines · Jamie Lokier
Quoted 6 lines · Jamie Lokier
Quoted 3 lines · David S. Miller

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