diff mbox

bonding: unset primary slave via sysfs

Message ID 1359393652-2804-1-git-send-email-milos.vyletel@sde.cz
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Milos Vyletel Jan. 28, 2013, 5:20 p.m. UTC
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(-)

Comments

Jiri Pirko Jan. 29, 2013, 11:54 a.m. UTC | #1
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
--
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
Jay Vosburgh Jan. 29, 2013, 6:35 p.m. UTC | #2
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
>

--
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
Milos Vyletel Jan. 29, 2013, 7:20 p.m. UTC | #3
----- 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
> 
--
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
Jay Vosburgh Jan. 29, 2013, 7:27 p.m. UTC | #4
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

--
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
diff mbox

Patch

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;
 	}