From: Ding Tianhong <dingtianhong@huawei.com>
To: <fubar@us.ibm.com>, <vfalico@redhat.com>, <andy@greyhouse.net>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>
Subject: [PATCH net-next 4/4] bonding: don't ensalve loopback device
Date: Fri, 21 Feb 2014 16:08:55 +0800 [thread overview]
Message-ID: <1392970135-11904-5-git-send-email-dingtianhong@huawei.com> (raw)
In-Reply-To: <1392970135-11904-1-git-send-email-dingtianhong@huawei.com>
I could not see any effect that enslave a loopback device, so don't
enslave such device for bonding.
Use pr_err to instead of pr_debug when return error.
Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Veaceslav Falico <vfalico@redhat.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
drivers/net/bonding/bond_main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 4fa8ea7..b75c815 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1176,9 +1176,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
bond_dev->name, slave_dev->name);
}
+ if (slave_dev->flags & IFF_LOOPBACK) {
+ pr_err("Error: cannot enslave loopback device\n");
+ return -EINVAL;
+ }
+
/* already enslaved */
if (slave_dev->flags & IFF_SLAVE) {
- pr_debug("Error: Device was already enslaved\n");
+ pr_err("Error: Device was already enslaved\n");
return -EBUSY;
}
--
1.8.0
next prev parent reply other threads:[~2014-02-21 8:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-21 8:08 [PATCH net-next 0/4] bonding: Fix some minor issues for bonding Ding Tianhong
2014-02-21 8:08 ` [PATCH net-next 1/4] bonding: netpoll: remove unwanted slave_dev_support_netpoll() Ding Tianhong
2014-02-21 8:08 ` [PATCH net-next 2/4] bonding: use rcu_dereference() to access curr_active_slave Ding Tianhong
2014-02-21 8:08 ` [PATCH net-next 3/4] bonding: remove no longer needed lock for bond_xxx_info_query() Ding Tianhong
2014-02-21 8:08 ` Ding Tianhong [this message]
2014-02-24 23:28 ` [PATCH net-next 4/4] bonding: don't ensalve loopback device 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=1392970135-11904-5-git-send-email-dingtianhong@huawei.com \
--to=dingtianhong@huawei.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=vfalico@redhat.com \
/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