[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1204162026480.6225@ja.ssi.bg>
Date: Mon, 16 Apr 2012 20:31:40 +0300 (EEST)
From: Julian Anastasov <ja@....bg>
To: Hans Schillstrom <hans.schillstrom@...csson.com>
cc: "horms@...ge.net.au" <horms@...ge.net.au>,
"wensong@...ux-vs.org" <wensong@...ux-vs.org>,
"lvs-devel@...r.kernel.org" <lvs-devel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"netfilter-devel@...r.kernel.org" <netfilter-devel@...r.kernel.org>,
"hans@...illstrom.com" <hans@...illstrom.com>
Subject: Re: [PATCH 2/2] IPVS: make failure of netns init more stable
Hello,
On Mon, 16 Apr 2012, Hans Schillstrom wrote:
> > But I see some inconsistency in net/core/net_namespace.c:
> > __register_pernet_operations when CONFIG_NET_NS is enabled
> > does not call ops_free after failed ops_init while when
> > CONFIG_NET_NS is not enabled ops_free is called. The
> > problem is that we leak the ops->size data allocated for the
> > failed net. I think, the fix should be ops_init to free the data.
>
> Are you sure ?
> In my code it does...
>
> static int __register_pernet_operations(struct list_head *list,
> struct pernet_operations *ops)
> at line 417
> ..
> for_each_net(net) {
> error = ops_init(ops, net);
> if (error)
> goto out_undo;
There is line here that registers current net for
cleanup only after ops_init success:
list_add_tail(&net->exit_list, &net_exit_list);
If ops_init fails for first net then net_exit_list will
be empty.
> ...
> line 426
> out_undo:
> /* If I have an error cleanup all namespaces I initialized */
> list_del(&ops->list);
> ops_exit_list(ops, &net_exit_list);
> ops_free_list(ops, &net_exit_list);
> return error;
> }
Regards
--
Julian Anastasov <ja@....bg>
--
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