* [PATCH] bonding: unset primary slave via sysfs
@ 2013-01-28 17:20 Milos Vyletel
2013-01-29 11:54 ` Jiri Pirko
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Milos Vyletel @ 2013-01-28 17:20 UTC (permalink / raw)
To: netdev; +Cc: fubar, andy, Milos Vyletel
When bonding module is loaded with primary parameter and one decides to unset
primary slave using sysfs these settings are not preserved during bond device
restart. Primary slave is only unset once and it's not remembered in
bond->params structure.
Signed-off-by: Milos Vyletel <milos.vyletel@sde.cz>
---
drivers/net/bonding/bond_sysfs.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index ef8d2a0..155f3b4 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -1067,6 +1067,7 @@ static ssize_t bonding_store_primary(struct device *d,
pr_info("%s: Setting primary slave to None.\n",
bond->dev->name);
bond->primary_slave = NULL;
+ memset(bond->params.primary, 0, sizeof(bond->params.primary));
bond_select_active_slave(bond);
goto out;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] bonding: unset primary slave via sysfs
2013-01-28 17:20 [PATCH] bonding: unset primary slave via sysfs Milos Vyletel
@ 2013-01-29 11:54 ` Jiri Pirko
2013-01-29 18:35 ` Jay Vosburgh
2013-01-29 19:59 ` [PATCH v2] " Milos Vyletel
2 siblings, 0 replies; 8+ messages in thread
From: Jiri Pirko @ 2013-01-29 11:54 UTC (permalink / raw)
To: Milos Vyletel; +Cc: netdev, fubar, andy
Mon, Jan 28, 2013 at 06:20:52PM CET, milos.vyletel@sde.cz wrote:
>When bonding module is loaded with primary parameter and one decides to unset
>primary slave using sysfs these settings are not preserved during bond device
>restart. Primary slave is only unset once and it's not remembered in
>bond->params structure.
>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
>Signed-off-by: Milos Vyletel <milos.vyletel@sde.cz>
>---
> drivers/net/bonding/bond_sysfs.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
>index ef8d2a0..155f3b4 100644
>--- a/drivers/net/bonding/bond_sysfs.c
>+++ b/drivers/net/bonding/bond_sysfs.c
>@@ -1067,6 +1067,7 @@ static ssize_t bonding_store_primary(struct device *d,
> pr_info("%s: Setting primary slave to None.\n",
> bond->dev->name);
> bond->primary_slave = NULL;
>+ memset(bond->params.primary, 0, sizeof(bond->params.primary));
> bond_select_active_slave(bond);
> goto out;
> }
>--
>1.7.1
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] bonding: unset primary slave via sysfs
2013-01-28 17:20 [PATCH] bonding: unset primary slave via sysfs Milos Vyletel
2013-01-29 11:54 ` Jiri Pirko
@ 2013-01-29 18:35 ` Jay Vosburgh
2013-01-29 19:20 ` Milos Vyletel
2013-01-29 19:59 ` [PATCH v2] " Milos Vyletel
2 siblings, 1 reply; 8+ messages in thread
From: Jay Vosburgh @ 2013-01-29 18:35 UTC (permalink / raw)
To: Milos Vyletel; +Cc: netdev, andy
Milos Vyletel <milos.vyletel@sde.cz> wrote:
>When bonding module is loaded with primary parameter and one decides to unset
>primary slave using sysfs these settings are not preserved during bond device
>restart. Primary slave is only unset once and it's not remembered in
>bond->params structure.
>
>Signed-off-by: Milos Vyletel <milos.vyletel@sde.cz>
I think the patch is fine, although I did prefer the longer
commit message from the initial version (the one that explained how to
reproduce the problem).
-J
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
>---
> drivers/net/bonding/bond_sysfs.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
>index ef8d2a0..155f3b4 100644
>--- a/drivers/net/bonding/bond_sysfs.c
>+++ b/drivers/net/bonding/bond_sysfs.c
>@@ -1067,6 +1067,7 @@ static ssize_t bonding_store_primary(struct device *d,
> pr_info("%s: Setting primary slave to None.\n",
> bond->dev->name);
> bond->primary_slave = NULL;
>+ memset(bond->params.primary, 0, sizeof(bond->params.primary));
> bond_select_active_slave(bond);
> goto out;
> }
>--
>1.7.1
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] bonding: unset primary slave via sysfs
2013-01-29 18:35 ` Jay Vosburgh
@ 2013-01-29 19:20 ` Milos Vyletel
2013-01-29 19:27 ` Jay Vosburgh
0 siblings, 1 reply; 8+ messages in thread
From: Milos Vyletel @ 2013-01-29 19:20 UTC (permalink / raw)
To: Jay Vosburgh; +Cc: netdev, andy
----- Original Message -----
> Milos Vyletel <milos.vyletel@sde.cz> wrote:
>
> >When bonding module is loaded with primary parameter and one decides
> >to unset
> >primary slave using sysfs these settings are not preserved during
> >bond device
> >restart. Primary slave is only unset once and it's not remembered in
> >bond->params structure.
> >
> >Signed-off-by: Milos Vyletel <milos.vyletel@sde.cz>
>
> I think the patch is fine, although I did prefer the longer
> commit message from the initial version (the one that explained how
> to
> reproduce the problem).
>
> -J
>
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
>
Jay,
just to be sure, do you want me to resend this patch again with the
original commit message? It's no problem for me, I just don't want
to spam this list when not necessary.
Milos
>
> >---
> > drivers/net/bonding/bond_sysfs.c | 1 +
> > 1 files changed, 1 insertions(+), 0 deletions(-)
> >
> >diff --git a/drivers/net/bonding/bond_sysfs.c
> >b/drivers/net/bonding/bond_sysfs.c
> >index ef8d2a0..155f3b4 100644
> >--- a/drivers/net/bonding/bond_sysfs.c
> >+++ b/drivers/net/bonding/bond_sysfs.c
> >@@ -1067,6 +1067,7 @@ static ssize_t bonding_store_primary(struct
> >device *d,
> > pr_info("%s: Setting primary slave to None.\n",
> > bond->dev->name);
> > bond->primary_slave = NULL;
> >+ memset(bond->params.primary, 0, sizeof(bond->params.primary));
> > bond_select_active_slave(bond);
> > goto out;
> > }
> >--
> >1.7.1
> >
> >--
> >To unsubscribe from this list: send the line "unsubscribe netdev" in
> >the body of a message to majordomo@vger.kernel.org
> >More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] bonding: unset primary slave via sysfs
2013-01-29 19:20 ` Milos Vyletel
@ 2013-01-29 19:27 ` Jay Vosburgh
0 siblings, 0 replies; 8+ messages in thread
From: Jay Vosburgh @ 2013-01-29 19:27 UTC (permalink / raw)
To: Milos Vyletel; +Cc: netdev, andy
Milos Vyletel <milos.vyletel@sde.cz> wrote:
>----- Original Message -----
>> Milos Vyletel <milos.vyletel@sde.cz> wrote:
>>
>> >When bonding module is loaded with primary parameter and one decides
>> >to unset
>> >primary slave using sysfs these settings are not preserved during
>> >bond device
>> >restart. Primary slave is only unset once and it's not remembered in
>> >bond->params structure.
>> >
>> >Signed-off-by: Milos Vyletel <milos.vyletel@sde.cz>
>>
>> I think the patch is fine, although I did prefer the longer
>> commit message from the initial version (the one that explained how
>> to
>> reproduce the problem).
>>
>> -J
>>
>> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
>>
>
>Jay,
>
>just to be sure, do you want me to resend this patch again with the
>original commit message? It's no problem for me, I just don't want
>to spam this list when not necessary.
Yes. Detailed commit messages are not spam.
-J
>Milos
>
>>
>> >---
>> > drivers/net/bonding/bond_sysfs.c | 1 +
>> > 1 files changed, 1 insertions(+), 0 deletions(-)
>> >
>> >diff --git a/drivers/net/bonding/bond_sysfs.c
>> >b/drivers/net/bonding/bond_sysfs.c
>> >index ef8d2a0..155f3b4 100644
>> >--- a/drivers/net/bonding/bond_sysfs.c
>> >+++ b/drivers/net/bonding/bond_sysfs.c
>> >@@ -1067,6 +1067,7 @@ static ssize_t bonding_store_primary(struct
>> >device *d,
>> > pr_info("%s: Setting primary slave to None.\n",
>> > bond->dev->name);
>> > bond->primary_slave = NULL;
>> >+ memset(bond->params.primary, 0, sizeof(bond->params.primary));
>> > bond_select_active_slave(bond);
>> > goto out;
>> > }
>> >--
>> >1.7.1
---
-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] bonding: unset primary slave via sysfs
2013-01-28 17:20 [PATCH] bonding: unset primary slave via sysfs Milos Vyletel
2013-01-29 11:54 ` Jiri Pirko
2013-01-29 18:35 ` Jay Vosburgh
@ 2013-01-29 19:59 ` Milos Vyletel
2013-01-29 20:47 ` David Miller
2 siblings, 1 reply; 8+ messages in thread
From: Milos Vyletel @ 2013-01-29 19:59 UTC (permalink / raw)
To: netdev; +Cc: fubar, andy, Milos Vyletel
When bonding module is loaded with primary parameter and one decides to unset
primary slave using sysfs these settings are not preserved during bond device
restart. Primary slave is only unset once and it's not remembered in
bond->params structure. Below is example of recreation.
grep OPTS /etc/sysconfig/network-scripts/ifcfg-bond0
BONDING_OPTS="mode=active-backup miimon=100 primary=eth01"
grep "Primary Slave" /proc/net/bonding/bond0
Primary Slave: eth01 (primary_reselect always)
echo "" > /sys/class/net/bond0/bonding/primary
grep "Primary Slave" /proc/net/bonding/bond0
Primary Slave: None
sed -i -e 's/primary=eth01//' /etc/sysconfig/network-scripts/ifcfg-bond0
grep OPTS /etc/sysconfig/network-scripts/ifcfg-bond
BONDING_OPTS="mode=active-backup miimon=100 "
ifdown bond0 && ifup bond0
without patch:
grep "Primary Slave" /proc/net/bonding/bond0
Primary Slave: eth01 (primary_reselect always)
with patch:
grep "Primary Slave" /proc/net/bonding/bond0
Primary Slave: None
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Milos Vyletel <milos.vyletel@sde.cz>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
---
drivers/net/bonding/bond_sysfs.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index ef8d2a0..155f3b4 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -1067,6 +1067,7 @@ static ssize_t bonding_store_primary(struct device *d,
pr_info("%s: Setting primary slave to None.\n",
bond->dev->name);
bond->primary_slave = NULL;
+ memset(bond->params.primary, 0, sizeof(bond->params.primary));
bond_select_active_slave(bond);
goto out;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2] bonding: unset primary slave via sysfs
2013-01-29 19:59 ` [PATCH v2] " Milos Vyletel
@ 2013-01-29 20:47 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2013-01-29 20:47 UTC (permalink / raw)
To: milos.vyletel; +Cc: netdev, fubar, andy
From: Milos Vyletel <milos.vyletel@sde.cz>
Date: Tue, 29 Jan 2013 14:59:00 -0500
> When bonding module is loaded with primary parameter and one decides to unset
> primary slave using sysfs these settings are not preserved during bond device
> restart. Primary slave is only unset once and it's not remembered in
> bond->params structure. Below is example of recreation.
...
>
> Reviewed-by: Jiri Pirko <jiri@resnulli.us>
> Signed-off-by: Milos Vyletel <milos.vyletel@sde.cz>
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] bonding: unset primary slave via sysfs
@ 2013-01-25 18:41 Milos Vyletel
0 siblings, 0 replies; 8+ messages in thread
From: Milos Vyletel @ 2013-01-25 18:41 UTC (permalink / raw)
To: netdev
When bonding module is loaded with primary parameter and one decides to unset primary slave using sysfs these settings are not preserved during bond device restart. Primary slave is only unset once and it's not remembered in bond->params structure. Below is example of recreation. Fix is simple one-liner
# grep OPTS /etc/sysconfig/network-scripts/ifcfg-bond0
BONDING_OPTS="mode=active-backup miimon=100 primary=eth01"
# grep "Primary Slave" /proc/net/bonding/bond0
Primary Slave: eth01 (primary_reselect always)
# echo "" > /sys/class/net/bond0/bonding/primary
# grep "Primary Slave" /proc/net/bonding/bond0
Primary Slave: None
# sed -i -e 's/primary=eth01//' /etc/sysconfig/network-scripts/ifcfg-bond0
# grep OPTS /etc/sysconfig/network-scripts/ifcfg-bond
BONDING_OPTS="mode=active-backup miimon=100 "
# ifdown bond0 && ifup bond0
without patch:
# grep "Primary Slave" /proc/net/bonding/bond0
Primary Slave: eth01 (primary_reselect always)
with patch:
# grep "Primary Slave" /proc/net/bonding/bond0
Primary Slave: None
---
drivers/net/bonding/bond_sysfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 1877ed7..50f7eef 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -1053,6 +1053,7 @@ static ssize_t bonding_store_primary(struct device *d,
pr_info("%s: Setting primary slave to None.\n",
bond->dev->name);
bond->primary_slave = NULL;
+ memset(bond->params.primary, '\0', sizeof(bond->params.primary));
bond_select_active_slave(bond);
goto out;
}
--
1.8.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-01-29 20:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-28 17:20 [PATCH] bonding: unset primary slave via sysfs Milos Vyletel
2013-01-29 11:54 ` Jiri Pirko
2013-01-29 18:35 ` Jay Vosburgh
2013-01-29 19:20 ` Milos Vyletel
2013-01-29 19:27 ` Jay Vosburgh
2013-01-29 19:59 ` [PATCH v2] " Milos Vyletel
2013-01-29 20:47 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2013-01-25 18:41 [PATCH] " Milos Vyletel
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).