From: Patrick McHardy <kaber@trash.net>
To: panther@balabit.hu
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [IFGROUPv4 2/3] Interface group: core (netlink) part
Date: Thu, 25 Oct 2007 17:40:57 +0200 [thread overview]
Message-ID: <4720B909.7000108@trash.net> (raw)
In-Reply-To: <4720B6D4.8080404@balabit.hu>
Laszlo Attila Toth wrote:
> 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?
There seems to be a single case where operstate is used without
the rtnl (under dev_base_lock), in dev_get_flags() invoked by
dev_ifsioc_locked(). But that looks like a bug, there are many
callers of dev_change_flags() that only take the rtnl. So this
would be more a fix than a cleanup.
> And notification is only needed if something was changed.
Yes.
prev parent reply other threads:[~2007-10-25 15:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-25 15:03 [IFGROUPv4 0/3 (+3)] Interface group patches Laszlo Attila Toth
2007-10-25 15:03 ` [IFGROUPv4 1/3] rtnetlink: setlink changes atomic with single notification Laszlo Attila Toth
2007-10-25 15:03 ` [IFGROUPv4 2/3] Interface group: core (netlink) part Laszlo Attila Toth
2007-10-25 15:03 ` [IFGROUPv4 3/3] Netfilter Interface group match Laszlo Attila Toth
2007-10-25 15:03 ` [IFGROUPv4 iptables] " Laszlo Attila Toth
2007-10-25 15:03 ` [IFGROUPv4 iproute 1/2] Added IFLA_NET_NS_PID as in kernel v2.6.24-rc1 Laszlo Attila Toth
2007-10-25 15:03 ` [IFGROUPv4 iproute 2/2] Interface group as new ip link option Laszlo Attila Toth
2007-10-25 15:25 ` [IFGROUPv4 iptables] Interface group match Patrick McHardy
2007-10-25 15:18 ` [IFGROUPv4 3/3] Netfilter " Patrick McHardy
2007-10-25 15:14 ` [IFGROUPv4 2/3] Interface group: core (netlink) part Patrick McHardy
2007-10-25 15:31 ` Laszlo Attila Toth
2007-10-25 15:40 ` Patrick McHardy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4720B909.7000108@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=panther@balabit.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).