[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1425932487.8261.10.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Mon, 09 Mar 2015 13:21:27 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: David Miller <davem@...emloft.net>, edumazet@...gle.com,
netdev@...r.kernel.org, stephen@...workplumber.org,
nicolas.dichtel@...nd.com, roopa@...ulusnetworks.com,
hannes@...essinduktion.org, ddutt@...ulusnetworks.com,
vipin@...ulusnetworks.com, shmulik.ladkani@...il.com,
dsahern@...il.com
Subject: Re: [PATCH net-next 6/6] tcp_metrics: Use a single hash table for
all network namespaces.
On Mon, 2015-03-09 at 14:35 -0500, Eric W. Biederman wrote:
> Eric Dumazet <eric.dumazet@...il.com> writes:
>
> > On Mon, 2015-03-09 at 13:31 -0500, Eric W. Biederman wrote:
> >
> >> @@ -1167,17 +1173,22 @@ static void __net_exit tcp_net_metrics_exit(struct net *net)
> >> {
> >> unsigned int i;
> >>
> >> - for (i = 0; i < (1U << net->ipv4.tcp_metrics_hash_log) ; i++) {
> >> + if (net != &init_net) {
> >> + tcp_metrics_flush_all(net);
> >> + return;
> >> + }
> >
> > Note this _very_ unlikely (read: not possible) that
> > tcp_net_metrics_exit() will ever be called on init_net
> >
> > So I would remove all this code.
>
> If the line:
> ret = genl_register_family_with_ops(&tcp_metrics_nl_family,
> tcp_metrics_nl_ops);
>
> fails then this code will be called with net == &init_net.
So, what is wrong calling.
tcp_metrics_flush_all(net)
even if net == &init_net ?
The only code needed after the purge is
kvfree(tcp_metrics_hash);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists