]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: do not abuse GFP_ATOMIC in inet_netconf_notify_devconf()
authorEric Dumazet <edumazet@google.com>
Fri, 8 Jul 2016 03:18:24 +0000 (05:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Jul 2016 22:12:25 +0000 (18:12 -0400)
commit7c02c5a8976d0c9f8606630923af846c8c9a278f
tree89493cdb11e72b554373adfa2de627407ef908e1
parentc96f2d6820cd9c7e88da89f609fc40b3943e1392
ipv4: do not abuse GFP_ATOMIC in inet_netconf_notify_devconf()

inet_forward_change() runs with RTNL held.
We are allowed to sleep if required.

If we use __in_dev_get_rtnl() instead of __in_dev_get_rcu(),
we no longer have to use GFP_ATOMIC allocations in
inet_netconf_notify_devconf(), meaning we are less likely to miss
notifications under memory pressure, and wont touch precious memory
reserves either and risk dropping incoming packets.

inet_netconf_get_devconf() can also use GFP_KERNEL allocation.

Fixes: 10e0db62f60a ("rtnl/ipv4: use netconf msg to advertise forwarding status")
Fixes: 9b98a7fc8848 ("rtnl/ipv4: add support of RTM_GETNETCONF")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/devinet.c