Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1562472 > unrolled thread
| Started by | Kefeng Wang <wangkefeng.wang@huawei.com> |
|---|---|
| First post | 2017-01-19 09:40 +0100 |
| Last post | 2017-01-19 17:30 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] ipv6: addrconf: Avoid addrconf_disable_change() using RCU read-side lock Kefeng Wang <wangkefeng.wang@huawei.com> - 2017-01-19 09:40 +0100
Re: [PATCH] ipv6: addrconf: Avoid addrconf_disable_change() using RCU read-side lock David Miller <davem@davemloft.net> - 2017-01-19 17:30 +0100
| From | Kefeng Wang <wangkefeng.wang@huawei.com> |
|---|---|
| Date | 2017-01-19 09:40 +0100 |
| Subject | [PATCH] ipv6: addrconf: Avoid addrconf_disable_change() using RCU read-side lock |
| Message-ID | <t1gqe-7Ax-27@gated-at.bofh.it> |
Just like commit 4acd4945cd1e ("ipv6: addrconf: Avoid calling
netdevice notifiers with RCU read-side lock"), it is unnecessary
to make addrconf_disable_change() use RCU iteration over the
netdev list, since it already holds the RTNL lock, or we may meet
Illegal context switch in RCU read-side critical section.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
net/ipv6/addrconf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index c1e124b..f60e88e 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -5540,8 +5540,7 @@ static void addrconf_disable_change(struct net *net, __s32 newf)
struct net_device *dev;
struct inet6_dev *idev;
- rcu_read_lock();
- for_each_netdev_rcu(net, dev) {
+ for_each_netdev(net, dev) {
idev = __in6_dev_get(dev);
if (idev) {
int changed = (!idev->cnf.disable_ipv6) ^ (!newf);
@@ -5550,7 +5549,6 @@ static void addrconf_disable_change(struct net *net, __s32 newf)
dev_disable_change(idev);
}
}
- rcu_read_unlock();
}
static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int newf)
--
1.7.12.4
[toc] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-01-19 17:30 +0100 |
| Subject | Re: [PATCH] ipv6: addrconf: Avoid addrconf_disable_change() using RCU read-side lock |
| Message-ID | <t1nL3-3PP-21@gated-at.bofh.it> |
| In reply to | #1562472 |
From: Kefeng Wang <wangkefeng.wang@huawei.com>
Date: Thu, 19 Jan 2017 16:26:21 +0800
> Just like commit 4acd4945cd1e ("ipv6: addrconf: Avoid calling
> netdevice notifiers with RCU read-side lock"), it is unnecessary
> to make addrconf_disable_change() use RCU iteration over the
> netdev list, since it already holds the RTNL lock, or we may meet
> Illegal context switch in RCU read-side critical section.
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Applied and queued up for -stable, thanks.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web