All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH net-next 04/11] ipv4: no longer reference init_net in ip4_frags_ns_ctl_table[]
Date: Fri, 24 May 2019 09:03:33 -0700	[thread overview]
Message-ID: <20190524160340.169521-5-edumazet@google.com> (raw)
In-Reply-To: <20190524160340.169521-1-edumazet@google.com>

(struct net *)->ipv4.fqdir will soon be a pointer, so make
sure ip4_frags_ns_ctl_table[] does not reference init_net.

ip4_frags_ns_ctl_register() can perform the needed initialization
for all netns.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/ip_fragment.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index f1831367cc2b188bdcc93f25818dda13e4348427..fb035f4f36ca72c6a9013830a3fb327d802b3e00 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -544,30 +544,24 @@ static int dist_min;
 static struct ctl_table ip4_frags_ns_ctl_table[] = {
 	{
 		.procname	= "ipfrag_high_thresh",
-		.data		= &init_net.ipv4.fqdir.high_thresh,
 		.maxlen		= sizeof(unsigned long),
 		.mode		= 0644,
 		.proc_handler	= proc_doulongvec_minmax,
-		.extra1		= &init_net.ipv4.fqdir.low_thresh
 	},
 	{
 		.procname	= "ipfrag_low_thresh",
-		.data		= &init_net.ipv4.fqdir.low_thresh,
 		.maxlen		= sizeof(unsigned long),
 		.mode		= 0644,
 		.proc_handler	= proc_doulongvec_minmax,
-		.extra2		= &init_net.ipv4.fqdir.high_thresh
 	},
 	{
 		.procname	= "ipfrag_time",
-		.data		= &init_net.ipv4.fqdir.timeout,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec_jiffies,
 	},
 	{
 		.procname	= "ipfrag_max_dist",
-		.data		= &init_net.ipv4.fqdir.max_dist,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec_minmax,
@@ -600,13 +594,13 @@ static int __net_init ip4_frags_ns_ctl_register(struct net *net)
 		if (!table)
 			goto err_alloc;
 
-		table[0].data = &net->ipv4.fqdir.high_thresh;
-		table[0].extra1 = &net->ipv4.fqdir.low_thresh;
-		table[1].data = &net->ipv4.fqdir.low_thresh;
-		table[1].extra2 = &net->ipv4.fqdir.high_thresh;
-		table[2].data = &net->ipv4.fqdir.timeout;
-		table[3].data = &net->ipv4.fqdir.max_dist;
 	}
+	table[0].data	= &net->ipv4.fqdir.high_thresh;
+	table[0].extra1	= &net->ipv4.fqdir.low_thresh;
+	table[1].data	= &net->ipv4.fqdir.low_thresh;
+	table[1].extra2	= &net->ipv4.fqdir.high_thresh;
+	table[2].data	= &net->ipv4.fqdir.timeout;
+	table[3].data	= &net->ipv4.fqdir.max_dist;
 
 	hdr = register_net_sysctl(net, "net/ipv4", table);
 	if (!hdr)
-- 
2.22.0.rc1.257.g3120a18244-goog


  parent reply	other threads:[~2019-05-24 16:03 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24 16:03 [PATCH net-next 00/11] inet: frags: avoid possible races at netns dismantle Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 01/11] inet: rename netns_frags to fqdir Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 02/11] net: rename inet_frags_exit_net() to fqdir_exit() Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 03/11] net: rename struct fqdir fields Eric Dumazet
2019-05-24 16:03 ` Eric Dumazet [this message]
2019-05-24 16:03 ` [PATCH net-next 05/11] ipv6: no longer reference init_net in ip6_frags_ns_ctl_table[] Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 06/11] netfilter: ipv6: nf_defrag: no longer reference init_net in nf_ct_frag6_sysctl_table Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 07/11] ieee820154: 6lowpan: no longer reference init_net in lowpan_frags_ns_ctl_table Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 08/11] net: rename inet_frags_init_net() to fdir_init() Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 09/11] net: add a net pointer to struct fqdir Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 10/11] net: dynamically allocate fqdir structures Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 11/11] inet: frags: rework rhashtable dismantle Eric Dumazet
2019-05-28  6:34   ` Herbert Xu
2019-05-28 13:31     ` Eric Dumazet
2019-05-29  5:40       ` [PATCH] inet: frags: Remove unnecessary smp_store_release/READ_ONCE Herbert Xu
2019-05-29  5:43         ` Dmitry Vyukov
2019-05-29  5:47           ` Herbert Xu
2019-05-31  8:24             ` Dmitry Vyukov
2019-05-31 14:45               ` Herbert Xu
2019-05-31 15:45                 ` Eric Dumazet
2019-05-31 16:29                   ` Andrea Parri
2019-05-31 17:11                     ` Eric Dumazet
2019-06-07 12:06                       ` Dmitry Vyukov
2019-05-31 17:11                   ` Paul E. McKenney
2019-05-31 17:18                     ` Eric Dumazet
2019-05-29 21:30         ` Eric Dumazet
2019-05-30 18:51         ` David Miller
2019-05-26 21:26 ` [PATCH net-next 00/11] inet: frags: avoid possible races at netns dismantle David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190524160340.169521-5-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.