public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG]: bonding module parameter problem
@ 2002-01-09 22:13 José Luis Domingo López
  2002-01-10 22:57 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: José Luis Domingo López @ 2002-01-09 22:13 UTC (permalink / raw)
  To: Linux-Kernel

Hi:

There seems to be a problem in module bonding.o (just the interesting
part follows, kernel version is 2.4.17):
user@machine:/tmp$ /sbin/modinfo bonding
license:     "GPL"
warning: parameter max_bonds has max < min!
parm:  max_bonds unknown format character '('parm:  miimon int, description "Link check interval in milliseconds"

At /usr/src/linux/drivers/net/bonding.c, line 229:
MODULE_PARM(max_bonds, "1-" __MODULE_STRING(INT_MAX) "i");
MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");

And at /usr/src/linux/include/linux/kernel.h, line 19:
#define INT_MAX                ((int)(~0U>>1))

There are some places (/usr/src/linux/net/ipv4/netfilter/ip_conntrack_ftp.c
line 19) with similar macro invocations that work OK. It seems macro
MODULE_PARM gets confused with those parentheses in #define INT_MAX

This problem is still in 2.4.18-pre2, but seems that is solved upstream
(http://sf.net/projects/bonding/), see:
http://telia.dl.sourceforge.net/bonding/bonding-2.4.17-20020102

-- 
José Luis Domingo López
Linux Registered User #189436     Debian Linux Woody (P166 64 MB RAM)
 
jdomingo AT internautas DOT   org  => Spam at your own risk


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [BUG]: bonding module parameter problem
  2002-01-09 22:13 [BUG]: bonding module parameter problem José Luis Domingo López
@ 2002-01-10 22:57 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2002-01-10 22:57 UTC (permalink / raw)
  To: Jos; +Cc: linux-kernel, mark.huth, ctindel

On Wed, 9 Jan 2002 23:13:55 +0100
Jos <jdomingo@internautas.org> wrote:
> At /usr/src/linux/drivers/net/bonding.c, line 229:
> MODULE_PARM(max_bonds, "1-" __MODULE_STRING(INT_MAX) "i");
> MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");

This is wrong.  When I did my module rewrite patch, I noted a number of
mis-uses of the MODULE_PARM macro (mine does type checking, so the compiler
found them).

You are saying that max_bonds is an ARRAY of 1-INT_MAX integers!
The same mistake is made in the patch on sf.net/projects/bonding/.

Here is the patch against .17, for inspiration:

diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.4.17/drivers/net/bonding.c working-2.4.17-wagner/drivers/net/bonding.c
--- linux-2.4.17/drivers/net/bonding.c	Thu Dec 27 12:45:05 2001
+++ working-2.4.17-wagner/drivers/net/bonding.c	Fri Jan 11 09:46:08 2002
@@ -226,7 +226,7 @@
 static struct bonding *these_bonds =  NULL;
 static struct net_device *dev_bonds = NULL;
 
-MODULE_PARM(max_bonds, "1-" __MODULE_STRING(INT_MAX) "i");
+MODULE_PARM(max_bonds, "i");
 MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");
 MODULE_PARM(miimon, "i");
 MODULE_PARM_DESC(miimon, "Link check interval in milliseconds");

Cheers!
Rusty.
-- 
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-11  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-09 22:13 [BUG]: bonding module parameter problem José Luis Domingo López
2002-01-10 22:57 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox