diff options
author | Patrick McHardy <kaber@trash.net> | 2008-04-24 01:10:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-24 01:10:48 -0400 |
commit | c9c1014b2bd014c7ec037bbb6f58818162fdb265 (patch) | |
tree | deace0019cbe1600d94e0de85791faa5eb14358e /net/core | |
parent | 6440be177f56e0b52dd81df82b78875d9a07d5f9 (diff) |
[RTNETLINK]: Fix bogus ASSERT_RTNL warning
ASSERT_RTNL uses mutex_trylock to test whether the rtnl_mutex is
held. This bogus warnings when running in atomic context, which
f.e. happens when adding secondary unicast addresses through
macvlan or vlan or when synchronizing multicast addresses from
wireless devices.
Mid-term we might want to consider moving all address updates
to process context since the locking seems overly complicated,
for now just fix the bogus warning by changing ASSERT_RTNL to
use mutex_is_locked().
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/rtnetlink.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index bc39e417694a..cf857c4dc7b1 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -82,6 +82,11 @@ int rtnl_trylock(void) | |||
82 | return mutex_trylock(&rtnl_mutex); | 82 | return mutex_trylock(&rtnl_mutex); |
83 | } | 83 | } |
84 | 84 | ||
85 | int rtnl_is_locked(void) | ||
86 | { | ||
87 | return mutex_is_locked(&rtnl_mutex); | ||
88 | } | ||
89 | |||
85 | static struct rtnl_link *rtnl_msg_handlers[NPROTO]; | 90 | static struct rtnl_link *rtnl_msg_handlers[NPROTO]; |
86 | 91 | ||
87 | static inline int rtm_msgindex(int msgtype) | 92 | static inline int rtm_msgindex(int msgtype) |
@@ -1402,6 +1407,7 @@ EXPORT_SYMBOL(rtnetlink_put_metrics); | |||
1402 | EXPORT_SYMBOL(rtnl_lock); | 1407 | EXPORT_SYMBOL(rtnl_lock); |
1403 | EXPORT_SYMBOL(rtnl_trylock); | 1408 | EXPORT_SYMBOL(rtnl_trylock); |
1404 | EXPORT_SYMBOL(rtnl_unlock); | 1409 | EXPORT_SYMBOL(rtnl_unlock); |
1410 | EXPORT_SYMBOL(rtnl_is_locked); | ||
1405 | EXPORT_SYMBOL(rtnl_unicast); | 1411 | EXPORT_SYMBOL(rtnl_unicast); |
1406 | EXPORT_SYMBOL(rtnl_notify); | 1412 | EXPORT_SYMBOL(rtnl_notify); |
1407 | EXPORT_SYMBOL(rtnl_set_sk_err); | 1413 | EXPORT_SYMBOL(rtnl_set_sk_err); |