From: Hans Schillstrom <hans.schillstrom@ericsson.com>
To: Julian Anastasov <ja@ssi.bg>
Cc: "horms@verge.net.au" <horms@verge.net.au>,
"wensong@linux-vs.org" <wensong@linux-vs.org>,
"lvs-devel@vger.kernel.org" <lvs-devel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"netfilter-devel@vger.kernel.org"
<netfilter-devel@vger.kernel.org>,
"hans@schillstrom.com" <hans@schillstrom.com>
Subject: Re: [PATCH 2/2] IPVS: make failure of netns init more stable
Date: Mon, 16 Apr 2012 19:45:15 +0200 [thread overview]
Message-ID: <201204161945.16182.hans.schillstrom@ericsson.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1204162026480.6225@ja.ssi.bg>
On Monday 16 April 2012 19:31:40 Julian Anastasov wrote:
>
> 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.
Yes, you are right as allways :-)
>
> > ...
> > 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@ssi.bg>
>
--
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>
next prev parent reply other threads:[~2012-04-16 17:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-16 11:39 [PATCH 1/2] IPVS: take care of return value from protocol init_netns Hans Schillstrom
2012-04-16 11:39 ` [PATCH 2/2] IPVS: make failure of netns init more stable Hans Schillstrom
2012-04-16 14:25 ` Julian Anastasov
2012-04-16 17:16 ` Hans Schillstrom
2012-04-16 17:31 ` Julian Anastasov
2012-04-16 17:45 ` Hans Schillstrom [this message]
2012-04-17 11:15 ` Hans Schillstrom
2012-04-17 20:57 ` Julian Anastasov
-- strict thread matches above, loose matches on Subject: below --
2012-04-18 12:37 Re[2]: " Hans Schillstrom
2012-04-23 13:22 ` Simon Horman
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=201204161945.16182.hans.schillstrom@ericsson.com \
--to=hans.schillstrom@ericsson.com \
--cc=hans@schillstrom.com \
--cc=horms@verge.net.au \
--cc=ja@ssi.bg \
--cc=lvs-devel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=wensong@linux-vs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).