Subject: Re: [PATCH net 2/2] bonding: rename the dev upper link if the master's, name changed

From: Sergei Shtylyov <[email-masked]>
Date: Mon, 13 Jan 2014 21:54:10 +0400

On 13-01-2014 17:08, Ding Tianhong wrote:

> The bond_maste_rename() will rename the links for slave dev's upper dev link,

    s/maste/master/.

> if faild, it will rollback and rename the new name to old name for slave dev.

    s/faild/failed/.

> Add a new parameter called name to save the old bonding name in struct bonding.

> Signed-off-by: Ding Tianhong <[email-masked]>
> ---
>   drivers/net/bonding/bond_main.c | 35 +++++++++++++++++++++++++++++++++++
>   drivers/net/bonding/bonding.h   |  1 +
>   2 files changed, 36 insertions(+)

> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 4b8c58b..8c044c0 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -2799,11 +2799,41 @@ re_arm:
>
>   /*-------------------------- netdev event handling --------------------------*/
>
> +static int bond_master_rename(struct bonding *bond)
> +{
> +	struct slave *slave;
> +	struct list_head *iter;
> +	char ori_linkname[IFNAMSIZ + 7], new_linkname[IFNAMSIZ + 7];

    Perhaps s/ori/old/ is better?

> +	int err = 0;
> +
> +	sprintf(ori_linkname, "upper_%s", bond->name);
> +	sprintf(new_linkname, "upper_%s", bond->dev->name);
> +
> +	bond_for_each_slave(bond, slave, iter) {
> +

    No need for this empty line, I think.

> +		err = netdev_upper_dev_rename(slave->dev, bond->dev, ori_linkname,
> +					new_linkname);

    The continuation line should start right under 'slave' on the broken up line.

WBR, Sergei