* [PATCH net-next 3/4] bonding: do not save non-existent device to bond primary in sysfs
@ 2014-01-09 11:20 Ding Tianhong
2014-01-09 11:47 ` Veaceslav Falico
0 siblings, 1 reply; 2+ messages in thread
From: Ding Tianhong @ 2014-01-09 11:20 UTC (permalink / raw)
To: Jay Vosburgh, Veaceslav Falico, David S. Miller, Netdev
Do not save non-existent device to bond primary in sysfs.
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next 3/4] bonding: do not save non-existent device to bond primary in sysfs
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
0 siblings, 0 replies; 2+ messages in thread
From: Veaceslav Falico @ 2014-01-09 11:47 UTC (permalink / raw)
To: Ding Tianhong; +Cc: Jay Vosburgh, David S. Miller, Netdev
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
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-09 11:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).