From: Jay Vosburgh <fubar@us.ibm.com>
To: Jiri Pirko <jpirko@redhat.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
bonding-devel@lists.sourceforge.net
Subject: Re: [PATCH net-next-2.6] bonding: set primary param via sysfs
Date: Fri, 18 Sep 2009 16:02:31 -0700 [thread overview]
Message-ID: <10714.1253314951@death.nxdomain.ibm.com> (raw)
In-Reply-To: <20090918121321.GB2801@psychotron.redhat.com>
Jiri Pirko <jpirko@redhat.com> wrote:
>Primary module parameter passed to bonding is pernament. That means if you
>release the primary slave and enslave it again, it becomes the primary slave
>again. But if you set primary slave via sysfs, the primary slave is only set
>once and it's not remembered in bond->params structure. Therefore the setting is
>lost after releasing the primary slave. This simple one-liner fixes this.
>
>Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>
>diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
>index 6044e12..ff449de 100644
>--- a/drivers/net/bonding/bond_sysfs.c
>+++ b/drivers/net/bonding/bond_sysfs.c
>@@ -1182,6 +1182,7 @@ static ssize_t bonding_store_primary(struct device *d,
> ": %s: Setting %s as primary slave.\n",
> bond->dev->name, slave->dev->name);
> bond->primary_slave = slave;
>+ strcpy(bond->params.primary, slave->dev->name);
> bond_select_active_slave(bond);
> goto out;
> }
Looks good, fixes another bug I'd not heard of previously.
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
next prev parent reply other threads:[~2009-09-18 23:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-18 12:13 [PATCH net-next-2.6] bonding: set primary param via sysfs Jiri Pirko
2009-09-18 20:21 ` [Bonding-devel] " Nicolas de Pesloüan
2009-09-18 23:02 ` Jay Vosburgh [this message]
2009-10-01 21:39 ` 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=10714.1253314951@death.nxdomain.ibm.com \
--to=fubar@us.ibm.com \
--cc=bonding-devel@lists.sourceforge.net \
--cc=davem@davemloft.net \
--cc=jpirko@redhat.com \
--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).