[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1472829718.5439.29.camel@edumazet-glaptop3.roam.corp.google.com>
Date: Fri, 02 Sep 2016 08:21:58 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Ahern <dsa@...ulusnetworks.com>
Cc: Mahesh Bandewar <mahesh@...dewar.net>,
Jay Vosburgh <j.vosburgh@...il.com>,
Andy Gospodarek <gospo@...ulusnetworks.com>,
Veaceslav Falico <vfalico@...il.com>,
David Miller <davem@...emloft.net>,
Mahesh Bandewar <maheshb@...gle.com>,
Eric Dumazet <edumazet@...gle.com>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net] bonding: Fix bonding crash
On Fri, 2016-09-02 at 08:57 -0600, David Ahern wrote:
> I hit this same problem yesterday but with the bridge. I forgot I had
> a macvlan device on an interface and tried to enslave it to a bridge.
> It failed with EBUSY without crashing the kernel so it is one example
> that handles the conflict, and the bridge also calls the register
> before the enslaving is done.
>
Sure, some netdev_rx_handler_register() users are simpler than bonding,
this was the point Jiri raised. Hey guys just use team instead of
bonding ;)
If you carefully look at bridge code, you'll find other kind of errors
for sure ;)
For example, should dev_disable_lro() be called before or after
netdev_rx_handler_register() ? ;)
Mahesh proposal allows for simplification, since one level can be
removed from the error rollback chain.
Ideally the netdev_rx_handler_register() should be called only when no
further errors can be detected in the 'enslaving' process, otherwise
some live packets could come and be incorrectly processed/dropped by a
not fully initialized driver.
So it is a chicken and egg problem, if you allow
netdev_rx_handler_register() to return an error, while it is so easy
to early check what could go wrong with it.
Powered by blists - more mailing lists