netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] IPVS: seq_release_net should be used.
@ 2011-05-13  6:03 Hans Schillstrom
  2011-05-14  0:50 ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Schillstrom @ 2011-05-13  6:03 UTC (permalink / raw)
  To: horms, ja, lvs-devel, netdev, netfilter-devel; +Cc: hans, Hans Schillstrom

Without this patch every access to ip_vs in procfs will increase
the netns count i.e. an unbalanced get_net()/put_net().
(ipvsadm commands also use procfs.)
The result is you can't exit a netns if reading ip_vs_* procfs entries.

Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
---
 net/netfilter/ipvs/ip_vs_app.c  |    2 +-
 net/netfilter/ipvs/ip_vs_conn.c |    4 ++--
 net/netfilter/ipvs/ip_vs_ctl.c  |    6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
index 51f3af7..059af31 100644
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -572,7 +572,7 @@ static const struct file_operations ip_vs_app_fops = {
 	.open	 = ip_vs_app_open,
 	.read	 = seq_read,
 	.llseek  = seq_lseek,
-	.release = seq_release,
+	.release = seq_release_net,
 };
 #endif
 
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index d3fd91b..bf28ac2 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -1046,7 +1046,7 @@ static const struct file_operations ip_vs_conn_fops = {
 	.open    = ip_vs_conn_open,
 	.read    = seq_read,
 	.llseek  = seq_lseek,
-	.release = seq_release,
+	.release = seq_release_net,
 };
 
 static const char *ip_vs_origin_name(unsigned flags)
@@ -1114,7 +1114,7 @@ static const struct file_operations ip_vs_conn_sync_fops = {
 	.open    = ip_vs_conn_sync_open,
 	.read    = seq_read,
 	.llseek  = seq_lseek,
-	.release = seq_release,
+	.release = seq_release_net,
 };
 
 #endif
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 89842f0..699c79a 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2066,7 +2066,7 @@ static const struct file_operations ip_vs_info_fops = {
 	.open    = ip_vs_info_open,
 	.read    = seq_read,
 	.llseek  = seq_lseek,
-	.release = seq_release_private,
+	.release = seq_release_net,
 };
 
 static int ip_vs_stats_show(struct seq_file *seq, void *v)
@@ -2106,7 +2106,7 @@ static const struct file_operations ip_vs_stats_fops = {
 	.open = ip_vs_stats_seq_open,
 	.read = seq_read,
 	.llseek = seq_lseek,
-	.release = single_release,
+	.release = single_release_net,
 };
 
 static int ip_vs_stats_percpu_show(struct seq_file *seq, void *v)
@@ -2175,7 +2175,7 @@ static const struct file_operations ip_vs_stats_percpu_fops = {
 	.open = ip_vs_stats_percpu_seq_open,
 	.read = seq_read,
 	.llseek = seq_lseek,
-	.release = single_release,
+	.release = single_release_net,
 };
 #endif
 
-- 
1.7.2.3


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

* Re: [PATCH 1/1] IPVS: seq_release_net should be used.
  2011-05-13  6:03 [PATCH 1/1] IPVS: seq_release_net should be used Hans Schillstrom
@ 2011-05-14  0:50 ` Simon Horman
  2011-05-14 10:05   ` Hans Schillstrom
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2011-05-14  0:50 UTC (permalink / raw)
  To: Hans Schillstrom; +Cc: ja, lvs-devel, netdev, netfilter-devel, hans

On Fri, May 13, 2011 at 08:03:20AM +0200, Hans Schillstrom wrote:
> Without this patch every access to ip_vs in procfs will increase
> the netns count i.e. an unbalanced get_net()/put_net().
> (ipvsadm commands also use procfs.)
> The result is you can't exit a netns if reading ip_vs_* procfs entries.

Hi Hans,

we should try and get this into 2.6.39, right?

> 
> Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
> ---
>  net/netfilter/ipvs/ip_vs_app.c  |    2 +-
>  net/netfilter/ipvs/ip_vs_conn.c |    4 ++--
>  net/netfilter/ipvs/ip_vs_ctl.c  |    6 +++---
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
> index 51f3af7..059af31 100644
> --- a/net/netfilter/ipvs/ip_vs_app.c
> +++ b/net/netfilter/ipvs/ip_vs_app.c
> @@ -572,7 +572,7 @@ static const struct file_operations ip_vs_app_fops = {
>  	.open	 = ip_vs_app_open,
>  	.read	 = seq_read,
>  	.llseek  = seq_lseek,
> -	.release = seq_release,
> +	.release = seq_release_net,
>  };
>  #endif
>  
> diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
> index d3fd91b..bf28ac2 100644
> --- a/net/netfilter/ipvs/ip_vs_conn.c
> +++ b/net/netfilter/ipvs/ip_vs_conn.c
> @@ -1046,7 +1046,7 @@ static const struct file_operations ip_vs_conn_fops = {
>  	.open    = ip_vs_conn_open,
>  	.read    = seq_read,
>  	.llseek  = seq_lseek,
> -	.release = seq_release,
> +	.release = seq_release_net,
>  };
>  
>  static const char *ip_vs_origin_name(unsigned flags)
> @@ -1114,7 +1114,7 @@ static const struct file_operations ip_vs_conn_sync_fops = {
>  	.open    = ip_vs_conn_sync_open,
>  	.read    = seq_read,
>  	.llseek  = seq_lseek,
> -	.release = seq_release,
> +	.release = seq_release_net,
>  };
>  
>  #endif
> diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
> index 89842f0..699c79a 100644
> --- a/net/netfilter/ipvs/ip_vs_ctl.c
> +++ b/net/netfilter/ipvs/ip_vs_ctl.c
> @@ -2066,7 +2066,7 @@ static const struct file_operations ip_vs_info_fops = {
>  	.open    = ip_vs_info_open,
>  	.read    = seq_read,
>  	.llseek  = seq_lseek,
> -	.release = seq_release_private,
> +	.release = seq_release_net,
>  };
>  
>  static int ip_vs_stats_show(struct seq_file *seq, void *v)
> @@ -2106,7 +2106,7 @@ static const struct file_operations ip_vs_stats_fops = {
>  	.open = ip_vs_stats_seq_open,
>  	.read = seq_read,
>  	.llseek = seq_lseek,
> -	.release = single_release,
> +	.release = single_release_net,
>  };
>  
>  static int ip_vs_stats_percpu_show(struct seq_file *seq, void *v)
> @@ -2175,7 +2175,7 @@ static const struct file_operations ip_vs_stats_percpu_fops = {
>  	.open = ip_vs_stats_percpu_seq_open,
>  	.read = seq_read,
>  	.llseek = seq_lseek,
> -	.release = single_release,
> +	.release = single_release_net,
>  };
>  #endif
>  
> -- 
> 1.7.2.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH 1/1] IPVS: seq_release_net should be used.
  2011-05-14  0:50 ` Simon Horman
@ 2011-05-14 10:05   ` Hans Schillstrom
  2011-05-15 15:12     ` Pablo Neira Ayuso
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Schillstrom @ 2011-05-14 10:05 UTC (permalink / raw)
  To: Simon Horman; +Cc: Hans Schillstrom, ja, lvs-devel, netdev, netfilter-devel

On Saturday, May 14, 2011 02:50:26 Simon Horman wrote:
> On Fri, May 13, 2011 at 08:03:20AM +0200, Hans Schillstrom wrote:
> > Without this patch every access to ip_vs in procfs will increase
> > the netns count i.e. an unbalanced get_net()/put_net().
> > (ipvsadm commands also use procfs.)
> > The result is you can't exit a netns if reading ip_vs_* procfs entries.
> 
> Hi Hans,
> 
> we should try and get this into 2.6.39, right?

Yes, this is a trivial bug fix

> 
> > 
> > Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
> > ---
> >  net/netfilter/ipvs/ip_vs_app.c  |    2 +-
> >  net/netfilter/ipvs/ip_vs_conn.c |    4 ++--
> >  net/netfilter/ipvs/ip_vs_ctl.c  |    6 +++---
> >  3 files changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
> > index 51f3af7..059af31 100644
> > --- a/net/netfilter/ipvs/ip_vs_app.c
> > +++ b/net/netfilter/ipvs/ip_vs_app.c
> > @@ -572,7 +572,7 @@ static const struct file_operations ip_vs_app_fops = {
> >  	.open	 = ip_vs_app_open,
> >  	.read	 = seq_read,
> >  	.llseek  = seq_lseek,
> > -	.release = seq_release,
> > +	.release = seq_release_net,
> >  };
> >  #endif
> >  
> > diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
> > index d3fd91b..bf28ac2 100644
> > --- a/net/netfilter/ipvs/ip_vs_conn.c
> > +++ b/net/netfilter/ipvs/ip_vs_conn.c
> > @@ -1046,7 +1046,7 @@ static const struct file_operations ip_vs_conn_fops = {
> >  	.open    = ip_vs_conn_open,
> >  	.read    = seq_read,
> >  	.llseek  = seq_lseek,
> > -	.release = seq_release,
> > +	.release = seq_release_net,
> >  };
> >  
> >  static const char *ip_vs_origin_name(unsigned flags)
> > @@ -1114,7 +1114,7 @@ static const struct file_operations ip_vs_conn_sync_fops = {
> >  	.open    = ip_vs_conn_sync_open,
> >  	.read    = seq_read,
> >  	.llseek  = seq_lseek,
> > -	.release = seq_release,
> > +	.release = seq_release_net,
> >  };
> >  
> >  #endif
> > diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
> > index 89842f0..699c79a 100644
> > --- a/net/netfilter/ipvs/ip_vs_ctl.c
> > +++ b/net/netfilter/ipvs/ip_vs_ctl.c
> > @@ -2066,7 +2066,7 @@ static const struct file_operations ip_vs_info_fops = {
> >  	.open    = ip_vs_info_open,
> >  	.read    = seq_read,
> >  	.llseek  = seq_lseek,
> > -	.release = seq_release_private,
> > +	.release = seq_release_net,
> >  };
> >  
> >  static int ip_vs_stats_show(struct seq_file *seq, void *v)
> > @@ -2106,7 +2106,7 @@ static const struct file_operations ip_vs_stats_fops = {
> >  	.open = ip_vs_stats_seq_open,
> >  	.read = seq_read,
> >  	.llseek = seq_lseek,
> > -	.release = single_release,
> > +	.release = single_release_net,
> >  };
> >  
> >  static int ip_vs_stats_percpu_show(struct seq_file *seq, void *v)
> > @@ -2175,7 +2175,7 @@ static const struct file_operations ip_vs_stats_percpu_fops = {
> >  	.open = ip_vs_stats_percpu_seq_open,
> >  	.read = seq_read,
> >  	.llseek = seq_lseek,
> > -	.release = single_release,
> > +	.release = single_release_net,
> >  };
> >  #endif
> >  
> 

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

* Re: [PATCH 1/1] IPVS: seq_release_net should be used.
  2011-05-14 10:05   ` Hans Schillstrom
@ 2011-05-15 15:12     ` Pablo Neira Ayuso
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2011-05-15 15:12 UTC (permalink / raw)
  To: Hans Schillstrom
  Cc: Simon Horman, Hans Schillstrom, ja, lvs-devel, netdev,
	netfilter-devel

On 14/05/11 12:05, Hans Schillstrom wrote:
> On Saturday, May 14, 2011 02:50:26 Simon Horman wrote:
>> On Fri, May 13, 2011 at 08:03:20AM +0200, Hans Schillstrom wrote:
>>> Without this patch every access to ip_vs in procfs will increase
>>> the netns count i.e. an unbalanced get_net()/put_net().
>>> (ipvsadm commands also use procfs.)
>>> The result is you can't exit a netns if reading ip_vs_* procfs entries.
>>
>> Hi Hans,
>>
>> we should try and get this into 2.6.39, right?
> 
> Yes, this is a trivial bug fix

I'll pass it to davem.

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

end of thread, other threads:[~2011-05-15 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13  6:03 [PATCH 1/1] IPVS: seq_release_net should be used Hans Schillstrom
2011-05-14  0:50 ` Simon Horman
2011-05-14 10:05   ` Hans Schillstrom
2011-05-15 15:12     ` Pablo Neira Ayuso

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).