decnet: Fix disappearing sysctl entries
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 12 Mar 2013 00:41:28 +0000 (17:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Mar 2013 18:32:06 +0000 (11:32 -0700)
commitcf8b9671f59ce789d852c7cf5646478ef6d4a4d4
tree02a0acd99e5812a396980cf094e68bb721d4645e
parentc2fbc9de75108bba9aa8976fcf80e5bfe5283598
decnet: Fix disappearing sysctl entries

When decnet is built as a module a simple:
echo 0.0 >/proc/sys/net/decnet/node_address

results in most of the sysctl entries under /proc/sys/net/decnet and
/proc/sys/net/decnet/conf disappearing.

For more details see http://www.spinics.net/lists/netdev/msg226123.html.

This change applies the same workaround used in
net/core/sysctl_net_core.c and net/ipv6/sysctl_net_ipv6.c of creating
a skeleton of decnet sysctl entries before doing anything else.

The problem first appeared in kernel 2.6.27.  The later rewrite of
sysctl in kernel 3.4 restored the previous behavior and eliminated the
need for this workaround.

This patch was heavily inspired by a similar but more complex patch by
Larry Baker.

Reported-by: Larry Baker <baker@usgs.gov>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: David Miller <davem@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/decnet/af_decnet.c
net/decnet/sysctl_net_decnet.c