[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <10714.1253314951@death.nxdomain.ibm.com>
Date: Fri, 18 Sep 2009 16:02:31 -0700
From: Jay Vosburgh <fubar@...ibm.com>
To: Jiri Pirko <jpirko@...hat.com>
cc: netdev@...r.kernel.org, davem@...emloft.net,
bonding-devel@...ts.sourceforge.net
Subject: Re: [PATCH net-next-2.6] bonding: set primary param via sysfs
Jiri Pirko <jpirko@...hat.com> wrote:
>Primary module parameter passed to bonding is pernament. That means if you
>release the primary slave and enslave it again, it becomes the primary slave
>again. But if you set primary slave via sysfs, the primary slave is only set
>once and it's not remembered in bond->params structure. Therefore the setting is
>lost after releasing the primary slave. This simple one-liner fixes this.
>
>Signed-off-by: Jiri Pirko <jpirko@...hat.com>
>
>diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
>index 6044e12..ff449de 100644
>--- a/drivers/net/bonding/bond_sysfs.c
>+++ b/drivers/net/bonding/bond_sysfs.c
>@@ -1182,6 +1182,7 @@ static ssize_t bonding_store_primary(struct device *d,
> ": %s: Setting %s as primary slave.\n",
> bond->dev->name, slave->dev->name);
> bond->primary_slave = slave;
>+ strcpy(bond->params.primary, slave->dev->name);
> bond_select_active_slave(bond);
> goto out;
> }
Looks good, fixes another bug I'd not heard of previously.
Signed-off-by: Jay Vosburgh <fubar@...ibm.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists