From: Veaceslav Falico <vfalico@redhat•com>
To: Ding Tianhong <dingtianhong@huawei•com>
Cc: Jay Vosburgh <fubar@us•ibm.com>,
"David S. Miller" <davem@davemloft•net>,
Netdev <netdev@vger•kernel.org>
Subject: Re: [PATCH net-next 3/4] bonding: do not save non-existent device to bond primary in sysfs
Date: Thu, 9 Jan 2014 12:47:48 +0100 [thread overview]
Message-ID: <20140109114748.GG5786@redhat.com> (raw)
In-Reply-To: <52CE8616.2010902@huawei.com>
On Thu, Jan 09, 2014 at 07:20:54PM +0800, Ding Tianhong wrote:
>Do not save non-existent device to bond primary in sysfs.
Again, no - this interface might be enslaved after we've set the
parameters, as it usually does.
>
>Signed-off-by: Ding Tianhong <dingtianhong@huawei•com>
>---
> drivers/net/bonding/bond_options.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
>index 945a666..9b4518f 100644
>--- a/drivers/net/bonding/bond_options.c
>+++ b/drivers/net/bonding/bond_options.c
>@@ -501,6 +501,12 @@ int bond_option_primary_set(struct bonding *bond, const char *primary)
> goto out;
> }
>
>+ if (!__dev_get_by_name(dev_net(bond->dev), primary)) {
>+ pr_err("%s: unable to set non-existent device %s to primary.\n",
>+ bond->dev->name, primary);
>+ goto out;
>+ }
>+
> bond_for_each_slave(bond, slave, iter) {
> if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) {
> pr_info("%s: Setting %s as primary slave.\n",
>--
>1.8.0
>
>
prev parent reply other threads:[~2014-01-09 11:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-09 11:20 [PATCH net-next 3/4] bonding: do not save non-existent device to bond primary in sysfs Ding Tianhong
2014-01-09 11:47 ` Veaceslav Falico [this message]
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=20140109114748.GG5786@redhat.com \
--to=vfalico@redhat$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=dingtianhong@huawei$(echo .)com \
--cc=fubar@us$(echo .)ibm.com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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