diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-12-01 01:03:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-06 15:59:06 -0500 |
commit | f7fce74e387e0563e5a165704664aa5ee8b2f48b (patch) | |
tree | 7c80f4ec69bb2fef3ad8513d3c9d83c6bd2035e2 /net/ipv4 | |
parent | 06a9701f4b3e3381dea96fee1cc8a3bb41b0a1f1 (diff) |
net: kill an RCU warning in inet_fill_link_af()
commits 9f0f7272 (ipv4: AF_INET link address family) and cf7afbfeb8c
(rtnl: make link af-specific updates atomic) used incorrect
__in_dev_get_rcu() in RTNL protected contexts, triggering PROVE_RCU
warnings.
Switch to __in_dev_get_rtnl(), wich is more appropriate, since we hold
RTNL.
Based on a report and initial patch from Amerigo Wang.
Reported-by: Amerigo Wang <amwang@redhat.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Thomas Graf <tgraf@infradead.org>
Reviewed-by: WANG Cong <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/devinet.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index d9f71bae45c..3b067704ab3 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1258,7 +1258,7 @@ errout: | |||
1258 | 1258 | ||
1259 | static size_t inet_get_link_af_size(const struct net_device *dev) | 1259 | static size_t inet_get_link_af_size(const struct net_device *dev) |
1260 | { | 1260 | { |
1261 | struct in_device *in_dev = __in_dev_get_rcu(dev); | 1261 | struct in_device *in_dev = __in_dev_get_rtnl(dev); |
1262 | 1262 | ||
1263 | if (!in_dev) | 1263 | if (!in_dev) |
1264 | return 0; | 1264 | return 0; |
@@ -1268,7 +1268,7 @@ static size_t inet_get_link_af_size(const struct net_device *dev) | |||
1268 | 1268 | ||
1269 | static int inet_fill_link_af(struct sk_buff *skb, const struct net_device *dev) | 1269 | static int inet_fill_link_af(struct sk_buff *skb, const struct net_device *dev) |
1270 | { | 1270 | { |
1271 | struct in_device *in_dev = __in_dev_get_rcu(dev); | 1271 | struct in_device *in_dev = __in_dev_get_rtnl(dev); |
1272 | struct nlattr *nla; | 1272 | struct nlattr *nla; |
1273 | int i; | 1273 | int i; |
1274 | 1274 | ||
@@ -1295,7 +1295,7 @@ static int inet_validate_link_af(const struct net_device *dev, | |||
1295 | struct nlattr *a, *tb[IFLA_INET_MAX+1]; | 1295 | struct nlattr *a, *tb[IFLA_INET_MAX+1]; |
1296 | int err, rem; | 1296 | int err, rem; |
1297 | 1297 | ||
1298 | if (dev && !__in_dev_get_rcu(dev)) | 1298 | if (dev && !__in_dev_get_rtnl(dev)) |
1299 | return -EAFNOSUPPORT; | 1299 | return -EAFNOSUPPORT; |
1300 | 1300 | ||
1301 | err = nla_parse_nested(tb, IFLA_INET_MAX, nla, inet_af_policy); | 1301 | err = nla_parse_nested(tb, IFLA_INET_MAX, nla, inet_af_policy); |
@@ -1319,7 +1319,7 @@ static int inet_validate_link_af(const struct net_device *dev, | |||
1319 | 1319 | ||
1320 | static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla) | 1320 | static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla) |
1321 | { | 1321 | { |
1322 | struct in_device *in_dev = __in_dev_get_rcu(dev); | 1322 | struct in_device *in_dev = __in_dev_get_rtnl(dev); |
1323 | struct nlattr *a, *tb[IFLA_INET_MAX+1]; | 1323 | struct nlattr *a, *tb[IFLA_INET_MAX+1]; |
1324 | int rem; | 1324 | int rem; |
1325 | 1325 | ||