From: Wengang <wen.gang.wang@oracle.com>
To: Jay Vosburgh <jay.vosburgh@canonical.com>, eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] bonding: clear header_ops when last slave detached (v2)
Date: Wed, 19 Nov 2014 13:22:07 +0800 [thread overview]
Message-ID: <546C28FF.7060507@oracle.com> (raw)
In-Reply-To: <1416374292-10993-1-git-send-email-wen.gang.wang@oracle.com>
Hi Jay and Eric,
Could you please review the 2nd prompt?
thanks,
wengang
于 2014年11月19日 13:18, Wengang Wang 写道:
> When last slave of a bonding master is removed, the bonding then does not work.
> When packet_snd is called against with a master net_device, it accesses
> header_ops. In case the header_ops is not valid any longer(say ipoib module
> unloaded), it will then access an invalid memory address.
> This patch try to fix this issue by clearing header_ops when last slave
> detached.
>
> Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
> ---
> drivers/net/bonding/bond_main.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index c9ac06c..52a7e4b 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1730,6 +1730,7 @@ static int __bond_release_one(struct net_device *bond_dev,
> bond->slave_cnt--;
>
> if (!bond_has_slaves(bond)) {
> + bond->dev->header_ops = NULL;
> call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev);
> call_netdevice_notifiers(NETDEV_RELEASE, bond->dev);
> }
next prev parent reply other threads:[~2014-11-19 5:20 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-19 5:18 [PATCH] bonding: clear header_ops when last slave detached (v2) Wengang Wang
2014-11-19 5:22 ` Wengang [this message]
2014-11-19 5:39 ` Eric Dumazet
2014-11-19 7:00 ` Wengang
2014-11-19 22:26 ` Cong Wang
2014-11-19 22:56 ` Cong Wang
2014-11-20 6:41 ` Eric Dumazet
2014-11-20 17:34 ` Cong Wang
2014-11-20 20:41 ` Eric Dumazet
2014-11-20 21:57 ` Cong Wang
2014-11-20 22:03 ` Eric Dumazet
2014-11-20 22:13 ` Cong Wang
2014-11-20 22:53 ` Jay Vosburgh
2014-11-21 18:17 ` Cong Wang
2014-11-21 18:54 ` Jay Vosburgh
2014-11-24 3:05 ` Wengang
2014-11-21 18:55 ` David Miller
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=546C28FF.7060507@oracle.com \
--to=wen.gang.wang@oracle.com \
--cc=eric.dumazet@gmail.com \
--cc=jay.vosburgh@canonical.com \
--cc=netdev@vger.kernel.org \
/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 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).