From: Stephen Hemminger <shemminger@vyatta.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jay Vosburgh <fubar@us.ibm.com>,
"David S. Miller" <davem@davemloft.net>,
bonding-devel@lists.sf.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: BUG: bonding module can only be loaded once
Date: Tue, 9 Jun 2009 08:02:32 -0700 [thread overview]
Message-ID: <20090609080232.45f81833@nehalam> (raw)
In-Reply-To: <200906091406.45463.arnd@arndb.de>
On Tue, 9 Jun 2009 14:06:44 +0200
Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 09 June 2009, Stephen Hemminger wrote:
> > In order to create multiple bonding dynamically, it is common practice to
> > load the bonding module multiple times. This got broken in recent kernels
> > 2.6.29 and later.
> >
> > Doing the following will OOPS:
> > modprobe -o bond0 bonding
> > modprobe -o bond1 bonding
> >
> > 2.6.29 actually OOPS on error handling, but that is fixed in 2.6.30.
> > But 2.6.30 still has the regression (caused by sysfs).
> >
> > This regression was introduced by changes to sysfs and proc that
> > made duplicate insertion a problem.
>
> Well, I guess it's more like the changes just made it obvious that
> it's wrong to do this. Registering the same entries in procfs or sysfs
> means that the user will only be able to talk to one of the two
> bonding drivers through these interfaces.
>
> The log messages you quoted are not actually Oops but rather WARNING,
> which is (in this case) not fatal at all, just an indication that the
> root user did something he should not have:
>
> > [ 134.012578] WARNING: at fs/proc/generic.c:590 proc_register+0x154/0x191()
> > [ 134.012583] proc_dir_entry 'net/bonding' already registered
>
> > [ 134.014516] WARNING: at fs/sysfs/dir.c:487 sysfs_add_one+0xcc/0xe4()
> > [ 134.014521] sysfs: cannot create duplicate filename '/class/net/bonding_masters'
>
> The bonding driver could work around this by checking if the directories
> already exist before registering them. One can also add rtnl_link_ops to
> the driver for dynamically adding more interfaces.
>
> If you combine the two, you can even print a helpful message like 'please
> use "ip link add type bonding" instead of "modprobe -o bond0 bonding"'.
>
> In the mean time, you could probably work around this by ignoring the error
> condition (see below), but I would suspect that there may be more problems
> with the concept of just loading the module again. The best advice to
> users is probably to configure the maximum number of bonding devices they
> might need with the max_bonds= module parameter (if I understand that
> parameter correctly.
>
> Arnd <><
>
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -5203,7 +5203,7 @@ static int __init bonding_init(void)
>
> res = bond_create_sysfs();
> if (res)
> - goto err;
> + pr_info("Loading bonding module without sysfs interface\n");
>
> register_netdevice_notifier(&bond_netdev_notifier);
> register_inetaddr_notifier(&bond_inetaddr_notifier);
That only makes it limp along, and there still are warnings.
The point is that who ever added the WARN() in proc and sysfs, effectively
broke a bonding usage model.
--
next prev parent reply other threads:[~2009-06-09 15:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-08 22:11 BUG: bonding module can only be loaded once Stephen Hemminger
2009-06-09 12:06 ` Arnd Bergmann
2009-06-09 15:02 ` Stephen Hemminger [this message]
2009-06-09 15:33 ` Patrick McHardy
2009-06-09 16:14 ` Jay Vosburgh
2009-06-09 16:27 ` Patrick McHardy
2009-06-09 17:23 ` [PATCH] bonding: fix multiple module load problem Stephen Hemminger
2009-06-09 17:37 ` [Bonding-devel] " Jay Vosburgh
2009-06-09 17:24 ` [Bonding-devel] BUG: bonding module can only be loaded once Jay Vosburgh
2009-06-09 22:14 ` Patrick McHardy
2009-06-10 13:19 ` Patrick McHardy
2009-06-10 6:07 ` [PATCH] bonding: fix multiple module load problem Stephen Hemminger
2009-06-11 12:44 ` 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=20090609080232.45f81833@nehalam \
--to=shemminger@vyatta.com \
--cc=arnd@arndb.de \
--cc=bonding-devel@lists.sf.net \
--cc=davem@davemloft.net \
--cc=fubar@us.ibm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.