Subject: Re: [IFGROUPv4 2/3] Interface group: core (netlink) part

From: Laszlo Attila Toth <[email-masked]>
Date: Thu, 25 Oct 2007 17:31:32 +0200

Patrick McHardy írta:
> Laszlo Attila Toth wrote:
>> Interface groups let handle different interfaces together
>> especially in netfilter modules.
>> Modified net device structure and netlink interface.
>>
>> @@ -891,6 +895,13 @@ static int do_setlink(struct net_device *dev, 
>> struct ifinfomsg *ifm,
>>          }
>>      }
>>  
>> +    if (tb[IFLA_IFGROUP]) {
>> +        write_lock_bh(&dev_base_lock);
>> +        dev->ifgroup = nla_get_u32(tb[IFLA_IFGROUP]);
>> +        write_unlock_bh(&dev_base_lock);
>> +        modified = 1;
>> +    }
> 
> 
> The locking looks unnecessary, the rtnl should be enough.
> I'm not even sure why its used for operstate and linkmode,
> AFAICS they are also protected by the rtnl.
> 

Hm, ok. In this case operstate and linkmode can be unprotected as code 
cleanup, am I right? Or leave them unchanged?
And notification is only needed if something was changed.

--
Attila