From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ding Tianhong <dingtianhong@huawei.com>,
Jay Vosburgh <fubar@us.ibm.com>,
Veaceslav Falico <vfalico@redhat.com>,
Eric Dumazet <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>,
Netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net 2/2] bonding: rename the dev upper link if the master's, name changed
Date: Mon, 13 Jan 2014 21:54:10 +0400 [thread overview]
Message-ID: <52D42842.5010709@cogentembedded.com> (raw)
In-Reply-To: <52D3E55B.8080401@huawei.com>
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 <dingtianhong@huawei.com>
> ---
> 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
next prev parent reply other threads:[~2014-01-13 17:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-13 13:08 [PATCH net 2/2] bonding: rename the dev upper link if the master's, name changed Ding Tianhong
2014-01-13 17:54 ` Sergei Shtylyov [this message]
2014-01-14 1:49 ` Ding Tianhong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52D42842.5010709@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=davem@davemloft.net \
--cc=dingtianhong@huawei.com \
--cc=edumazet@google.com \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=vfalico@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.