All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: Jay Vosburgh <jay.vosburgh@canonical.com>, netdev@vger.kernel.org
Cc: Veaceslav Falico <vfalico@gmail.com>,
	Andy Gospodarek <gospo@cumulusnetworks.com>,
	David Miller <davem@davemloft.net>
Subject: Re: [PATCH net] bonding: fix panic on non-ARPHRD_ETHER enslave failure
Date: Sat, 7 Nov 2015 02:31:14 +0100	[thread overview]
Message-ID: <563D5462.1040907@cumulusnetworks.com> (raw)
In-Reply-To: <9700.1446859403@famine>

On 11/07/2015 02:23 AM, Jay Vosburgh wrote:
> 	Since commit 7d5cd2ce529b, when bond_enslave fails on devices that
> are not ARPHRD_ETHER, if needed, it resets the bonding device back to
> ARPHRD_ETHER by calling ether_setup.
> 
> 	Unfortunately, ether_setup clobbers dev->flags, clearing IFF_UP
> if the bond device is up, leaving it in a quasi-down state without
> having actually gone through dev_close.  For bonding, if any periodic
> work queue items are active (miimon, arp_interval, etc), those will
> remain running, as they are stopped by bond_close.  At this point, if
> the bonding module is unloaded or the bond is deleted, the system will
> panic when the work function is called.
> 
> 	This panic is resolved by calling dev_close on the bond itself
> prior to calling ether_setup.
> 
> Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
> Fixes: 7d5cd2ce5292 ("bonding: correctly handle bonding type change on enslave failure")
> 
> ---
>  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 b4351ca..9e0f8a7 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1749,6 +1749,7 @@ err_undo_flags:
>  					    slave_dev->dev_addr))
>  			eth_hw_addr_random(bond_dev);
>  		if (bond_dev->type != ARPHRD_ETHER) {
> +			dev_close(bond_dev);
>  			ether_setup(bond_dev);
>  			bond_dev->flags |= IFF_MASTER;
>  			bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
> 

Oh, I've missed it. Very good catch!

Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Thanks,
 Nik
 

  reply	other threads:[~2015-11-07  1:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07  1:23 [PATCH net] bonding: fix panic on non-ARPHRD_ETHER enslave failure Jay Vosburgh
2015-11-07  1:31 ` Nikolay Aleksandrov [this message]
2015-11-07 18:19 ` 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=563D5462.1040907@cumulusnetworks.com \
    --to=nikolay@cumulusnetworks.com \
    --cc=davem@davemloft.net \
    --cc=gospo@cumulusnetworks.com \
    --cc=jay.vosburgh@canonical.com \
    --cc=netdev@vger.kernel.org \
    --cc=vfalico@gmail.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.