[lkml]   [2006]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectHotplug race on name change
    > Without that patch, there is a race when registering network interfaces
    > and renaming it with udev rules, because initially the "address" in
    > sysfs doesn't contain useful data. See
    > Breaking the recommended way of assigning persistent network interface
    > names is, IMHO, a bug serious enough to be fixed in -stable.
    > Signed-off-by: Alexander E. Patrakov <>
    > ---
    > --- linux-
    > +++ linux-
    > @@ -2932,11 +2932,11 @@
    > switch(dev->reg_state) {
    > + dev->reg_state = NETREG_REGISTERED;
    > err = netdev_register_sysfs(dev);
    > if (err)
    > printk(KERN_ERR "%s: failed sysfs registration (%d)\n",
    > dev->name, err);
    > - dev->reg_state = NETREG_REGISTERED;
    > break;

    Introduces new races in netdev_register_sysfs if the name changes, because
    netdev_register_sysfs runs without RTNL at this point. So if some application gets
    in and changes the device name while netdev_register_sysfs is running, then
    the class_dev->class_id would end up not matching the netdevice->name.

    Not a big issue since, hotplug doesn't get run until the device is registered.
    Ideally, it would be possible to create the groups in the class device before it
    was registered. It won't work with existing class device interface.

    I am working on a patch to extend class_device to allow the creation of groups
    to be atomic (like the attributes are).
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2006-04-21 19:27    [W:0.022 / U:28.176 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site