All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fixes for netns initializations
@ 2012-04-24 21:29 Julian Anastasov
  2012-04-24 21:29 ` [PATCH v2 1/2] ipvs: reset ipvs pointer in netns Julian Anastasov
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Julian Anastasov @ 2012-04-24 21:29 UTC (permalink / raw)
  To: Simon Horman; +Cc: lvs-devel

	This changeset fixes problems with failed netns
initializations. Hans should provide similar fix for
LBLC and LBLCR. This is for the stable tree.

Julian Anastasov (2):
  ipvs: reset ipvs pointer in netns
  ipvs: add check in ftp for initialized core

 net/netfilter/ipvs/ip_vs_core.c |    2 ++
 net/netfilter/ipvs/ip_vs_ftp.c  |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

-- 
1.7.3.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/2] ipvs: reset ipvs pointer in netns
  2012-04-24 21:29 [PATCH v2 0/2] Fixes for netns initializations Julian Anastasov
@ 2012-04-24 21:29 ` Julian Anastasov
  2012-04-25  7:49   ` Hans Schillstrom
  2012-04-24 21:29 ` [PATCH v2 2/2] ipvs: add check in ftp for initialized core Julian Anastasov
  2012-04-26  6:24 ` [PATCH v2 0/2] Fixes for netns initializations Simon Horman
  2 siblings, 1 reply; 7+ messages in thread
From: Julian Anastasov @ 2012-04-24 21:29 UTC (permalink / raw)
  To: Simon Horman; +Cc: lvs-devel

	Make sure net->ipvs is reset on netns cleanup or failed
initialization. It is needed for IPVS applications to know that
IPVS core is not loaded in netns.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
---
 net/netfilter/ipvs/ip_vs_core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 2555816..260b9ef 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1924,6 +1924,7 @@ protocol_fail:
 control_fail:
 	ip_vs_estimator_net_cleanup(net);
 estimator_fail:
+	net->ipvs = NULL;
 	return -ENOMEM;
 }
 
@@ -1936,6 +1937,7 @@ static void __net_exit __ip_vs_cleanup(struct net *net)
 	ip_vs_control_net_cleanup(net);
 	ip_vs_estimator_net_cleanup(net);
 	IP_VS_DBG(2, "ipvs netns %d released\n", net_ipvs(net)->gen);
+	net->ipvs = NULL;
 }
 
 static void __net_exit __ip_vs_dev_cleanup(struct net *net)
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/2] ipvs: add check in ftp for initialized core
  2012-04-24 21:29 [PATCH v2 0/2] Fixes for netns initializations Julian Anastasov
  2012-04-24 21:29 ` [PATCH v2 1/2] ipvs: reset ipvs pointer in netns Julian Anastasov
@ 2012-04-24 21:29 ` Julian Anastasov
  2012-04-25  7:49   ` Hans Schillstrom
  2012-04-26  6:24 ` [PATCH v2 0/2] Fixes for netns initializations Simon Horman
  2 siblings, 1 reply; 7+ messages in thread
From: Julian Anastasov @ 2012-04-24 21:29 UTC (permalink / raw)
  To: Simon Horman; +Cc: lvs-devel

	Avoid crash when registering ip_vs_ftp after
the IPVS core initialization for netns fails. Do this by
checking for present core (net->ipvs).

Signed-off-by: Julian Anastasov <ja@ssi.bg>
---
 net/netfilter/ipvs/ip_vs_ftp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index 538d74e..e39f693 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -439,6 +439,8 @@ static int __net_init __ip_vs_ftp_init(struct net *net)
 	struct ip_vs_app *app;
 	struct netns_ipvs *ipvs = net_ipvs(net);
 
+	if (!ipvs)
+		return -ENOENT;
 	app = kmemdup(&ip_vs_ftp, sizeof(struct ip_vs_app), GFP_KERNEL);
 	if (!app)
 		return -ENOMEM;
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/2] ipvs: reset ipvs pointer in netns
  2012-04-24 21:29 ` [PATCH v2 1/2] ipvs: reset ipvs pointer in netns Julian Anastasov
@ 2012-04-25  7:49   ` Hans Schillstrom
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Schillstrom @ 2012-04-25  7:49 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: Simon Horman, lvs-devel

Hello
On Tuesday 24 April 2012 23:29:58 Julian Anastasov wrote:
> 	Make sure net->ipvs is reset on netns cleanup or failed
> initialization. It is needed for IPVS applications to know that
> IPVS core is not loaded in netns.
> 
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
> ---
>  net/netfilter/ipvs/ip_vs_core.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
> index 2555816..260b9ef 100644
> --- a/net/netfilter/ipvs/ip_vs_core.c
> +++ b/net/netfilter/ipvs/ip_vs_core.c
> @@ -1924,6 +1924,7 @@ protocol_fail:
>  control_fail:
>  	ip_vs_estimator_net_cleanup(net);
>  estimator_fail:
> +	net->ipvs = NULL;
>  	return -ENOMEM;
>  }
>  
> @@ -1936,6 +1937,7 @@ static void __net_exit __ip_vs_cleanup(struct net *net)
>  	ip_vs_control_net_cleanup(net);
>  	ip_vs_estimator_net_cleanup(net);
>  	IP_VS_DBG(2, "ipvs netns %d released\n", net_ipvs(net)->gen);
> +	net->ipvs = NULL;
>  }
>  
>  static void __net_exit __ip_vs_dev_cleanup(struct net *net)

-- 
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 2/2] ipvs: add check in ftp for initialized core
  2012-04-24 21:29 ` [PATCH v2 2/2] ipvs: add check in ftp for initialized core Julian Anastasov
@ 2012-04-25  7:49   ` Hans Schillstrom
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Schillstrom @ 2012-04-25  7:49 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: Simon Horman, lvs-devel

On Tuesday 24 April 2012 23:29:59 Julian Anastasov wrote:
> 	Avoid crash when registering ip_vs_ftp after
> the IPVS core initialization for netns fails. Do this by
> checking for present core (net->ipvs).
> 
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
> ---
>  net/netfilter/ipvs/ip_vs_ftp.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
> index 538d74e..e39f693 100644
> --- a/net/netfilter/ipvs/ip_vs_ftp.c
> +++ b/net/netfilter/ipvs/ip_vs_ftp.c
> @@ -439,6 +439,8 @@ static int __net_init __ip_vs_ftp_init(struct net *net)
>  	struct ip_vs_app *app;
>  	struct netns_ipvs *ipvs = net_ipvs(net);
>  
> +	if (!ipvs)
> +		return -ENOENT;
>  	app = kmemdup(&ip_vs_ftp, sizeof(struct ip_vs_app), GFP_KERNEL);
>  	if (!app)
>  		return -ENOMEM;

-- 
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] Fixes for netns initializations
  2012-04-24 21:29 [PATCH v2 0/2] Fixes for netns initializations Julian Anastasov
  2012-04-24 21:29 ` [PATCH v2 1/2] ipvs: reset ipvs pointer in netns Julian Anastasov
  2012-04-24 21:29 ` [PATCH v2 2/2] ipvs: add check in ftp for initialized core Julian Anastasov
@ 2012-04-26  6:24 ` Simon Horman
  2012-04-26  6:27   ` Simon Horman
  2 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2012-04-26  6:24 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: lvs-devel

On Wed, Apr 25, 2012 at 12:29:57AM +0300, Julian Anastasov wrote:
> 	This changeset fixes problems with failed netns
> initializations. Hans should provide similar fix for
> LBLC and LBLCR. This is for the stable tree.
> 
> Julian Anastasov (2):
>   ipvs: reset ipvs pointer in netns
>   ipvs: add check in ftp for initialized core
> 
>  net/netfilter/ipvs/ip_vs_core.c |    2 ++
>  net/netfilter/ipvs/ip_vs_ftp.c  |    2 ++
>  2 files changed, 4 insertions(+), 0 deletions(-)

Thanks, both patches pushed to ipvs.
I plan to will wait for Hans's fixes to be finalised
before sending a pull request.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] Fixes for netns initializations
  2012-04-26  6:24 ` [PATCH v2 0/2] Fixes for netns initializations Simon Horman
@ 2012-04-26  6:27   ` Simon Horman
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2012-04-26  6:27 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: lvs-devel

On Thu, Apr 26, 2012 at 03:24:07PM +0900, Simon Horman wrote:
> On Wed, Apr 25, 2012 at 12:29:57AM +0300, Julian Anastasov wrote:
> > 	This changeset fixes problems with failed netns
> > initializations. Hans should provide similar fix for
> > LBLC and LBLCR. This is for the stable tree.
> > 
> > Julian Anastasov (2):
> >   ipvs: reset ipvs pointer in netns
> >   ipvs: add check in ftp for initialized core
> > 
> >  net/netfilter/ipvs/ip_vs_core.c |    2 ++
> >  net/netfilter/ipvs/ip_vs_ftp.c  |    2 ++
> >  2 files changed, 4 insertions(+), 0 deletions(-)
> 
> Thanks, both patches pushed to ipvs.
> I plan to will wait for Hans's fixes to be finalised
> before sending a pull request.

Incidently, I have rebased the ipvs tree to include
the latest merged patches in Pablo's net tree.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-26  6:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-24 21:29 [PATCH v2 0/2] Fixes for netns initializations Julian Anastasov
2012-04-24 21:29 ` [PATCH v2 1/2] ipvs: reset ipvs pointer in netns Julian Anastasov
2012-04-25  7:49   ` Hans Schillstrom
2012-04-24 21:29 ` [PATCH v2 2/2] ipvs: add check in ftp for initialized core Julian Anastasov
2012-04-25  7:49   ` Hans Schillstrom
2012-04-26  6:24 ` [PATCH v2 0/2] Fixes for netns initializations Simon Horman
2012-04-26  6:27   ` Simon Horman

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.