Re: [PATCH] Fix race condition about network device name allocation

Dan Aloni
2007-06-14T06:07:54Z

On Wed, Jun 13, 2007 at 09:36:31AM -0700, Stephen Hemminger wrote:
> On Wed, 13 Jun 2007 12:45:21 +0300
> Dan Aloni <da-x@monatomic.org> wrote:
>
> > On Mon, May 14, 2007 at 08:58:40AM -0700, Stephen Hemminger wrote:
> > > Kenji Kaneshige found this race between device removal and
> > > registration. On unregister it is possible for the old device to
> > > exist, because sysfs file is still open. A new device with 'eth%d'
> > > will select the same name, but sysfs kobject register will fial.
> > >
> > > The following changes the shutdown order slightly. It hold a removes the sysfs
> > > entries earlier (on unregister_netdevice), but holds a kobject reference.
> > > Then when todo runs the actual last put free happens.
> > >
> > > Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
> >
> > That patch breaks the bonding driver. After reverting it I avoid this crash:
> >
>[..]
> >
>
> I assume this happens when bonded slave device is removed?

Yes, it's just a simple removal via sysfs.

> Which kernel version?

2.6.21.5

--
Dan Aloni
XIV LTD, http://www.xivstorage.com
da-x (at) monatomic.org, dan (at) xiv.co.il