lkml.org 
[lkml]   [2006]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] [patch 3/6] [Network namespace] Network devices isolation
    On Fri, Jun 09, 2006 at 11:02:05PM +0200, dlezcano@fr.ibm.com wrote:
    > struct net_device *dev_get_by_name(const char *name)
    > {
    > + struct net_ns_dev_list *dev_list = &(net_ns()->dev_list);
    > struct net_device *dev;
    >
    > - read_lock(&dev_base_lock);
    > + read_lock(&dev_list->lock);
    > dev = __dev_get_by_name(name);
    > if (dev)
    > dev_hold(dev);
    > - read_unlock(&dev_base_lock);
    > + read_unlock(&dev_list->lock);
    > return dev;

    And what would stop renames done via different lists from creating a
    conflict? Incidentally, WTF protects the device name while we are
    doing that lookup?

    While we are at it, what are you going to do with sysfs?
    ls /sys/class/net and watch the fun...
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-06-18 20:59    [W:0.021 / U:59.244 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site