public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: 2.4.17:Increase number of anonymous filesystems beyond 256?
       [not found] <200201171351.g0HDpdK05456@bliss.uni-koblenz.de.suse.lists.linux.kernel>
@ 2002-01-17 17:49 ` Andi Kleen
       [not found] ` <mailman.1011289920.22682.linux-kernel2news@redhat.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2002-01-17 17:49 UTC (permalink / raw)
  To: Rainer Krienke; +Cc: linux-kernel

Rainer Krienke <krienke@uni-koblenz.de> writes:

> Hello,
> 
> I have to increase the number of anonymous filesystems the kernel can handle  
> and found the array unnamed_dev_in_use fs/super.c and changed the array size 
> from the default of 256 to 1024. Testing this patch by mounting more and more 
> NFS-filesystems I found that still no more than 800 NFS mounts are possible. 
> One more mount results in the kernel saying:
> 
> Jan 17 14:03:11 gl kernel: RPC: Can't bind to reserved port (98).

Some NFS servers only accept connections from 'secure ports' < 1024. 
You need one local port per connections. Some Ports <1024 are already
used by other services. This a natural limit with secure ports.

If you can configure your NFS server to not insist on secure ports
(it's usually an export option, unfortunately defaulting to on with
many OS) you can just use any ports. With the appended patch it should
work
[should be probably a sysctl instead of an #ifdef, but I'm too lazy
for that right now] 

Another way if you wanted to avoid source patching would be to make
sure that different connections go via different source IP addresses;
e.g. by defining multiple IP aliases on the server and the client and 
defining different routes for the server aliases with different local
ip addresses as prefered from address (=from option in iproute2). 
This way the ports would be unique again because they're for multiple local 
IP addresses; you would have 800 ports per local IP. Using the patch is 
probably cleaner though. 

Hope this helps,
-Andi

--- linux-work/net/sunrpc/xprt.c-o	Mon Oct  8 21:36:07 2001
+++ linux-work/net/sunrpc/xprt.c	Thu Jan 17 18:44:05 2002
@@ -1507,6 +1507,13 @@
 
 	memset(&myaddr, 0, sizeof(myaddr));
 	myaddr.sin_family = AF_INET;
+#define SUNRPC_NONSECURE_PORT 1
+#ifdef SUNRPC_NONSECURE_PORT
+	err =  sock->ops->bind(sock, (struct sockaddr *) &myaddr,
+						sizeof(myaddr));
+	if (err < 0) 
+		printk("RPC: cannot bind to a port\n"); 
+#else 
 	port = 800;
 	do {
 		myaddr.sin_port = htons(port);
@@ -1516,6 +1523,9 @@
 
 	if (err < 0)
 		printk("RPC: Can't bind to reserved port (%d).\n", -err);
+
+#endif
+
 
 	return err;
 }


-Andi


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

* Re: Fwd: Re: 2.4.17:Increase number of anonymous filesystems beyond 256?
       [not found] ` <mailman.1011289920.22682.linux-kernel2news@redhat.com>
@ 2002-01-22 17:32   ` Pete Zaitcev
  2002-01-22 22:17     ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Pete Zaitcev @ 2002-01-22 17:32 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, zaitcev

> From: Andi Kleen <ak@suse.de>
> Newsgroups: linux-kernel
> Date: 17 Jan 2002 18:49:53 +0100

> --- linux-work/net/sunrpc/xprt.c-o	Mon Oct  8 21:36:07 2001
> +++ linux-work/net/sunrpc/xprt.c	Thu Jan 17 18:44:05 2002
> @@ -1507,6 +1507,13 @@
>  
>  	memset(&myaddr, 0, sizeof(myaddr));
>  	myaddr.sin_family = AF_INET;
> +#define SUNRPC_NONSECURE_PORT 1
> +#ifdef SUNRPC_NONSECURE_PORT
> +	err =  sock->ops->bind(sock, (struct sockaddr *) &myaddr,
> +						sizeof(myaddr));
> +	if (err < 0) 
> +		printk("RPC: cannot bind to a port\n"); 
> +#else 
>  	port = 800;
>  	do {
>  		myaddr.sin_port = htons(port);
> @@ -1516,6 +1523,9 @@
>  
>  	if (err < 0)
>  		printk("RPC: Can't bind to reserved port (%d).\n", -err);
> +
> +#endif
> +
>  
>  	return err;
>  }

Andi, the patch above begs two questions in my mind:

1. Why to bind to 0 (INADDR_ANY) explicitly? My patch does not bind
at all and expects connect() to bind automatically. It is how
userland works and it seems to work here as well.

2. What did you do to increase the number of unnamed devices?
You said the patch "should" work, did that mean you did not test it?

-- Pete

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

* Re: Fwd: Re: 2.4.17:Increase number of anonymous filesystems beyond 256?
  2002-01-22 17:32   ` Fwd: " Pete Zaitcev
@ 2002-01-22 22:17     ` Andi Kleen
  2002-01-22 22:34       ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2002-01-22 22:17 UTC (permalink / raw)
  To: Pete Zaitcev; +Cc: Andi Kleen, linux-kernel

On Tue, Jan 22, 2002 at 12:32:20PM -0500, Pete Zaitcev wrote:
> Andi, the patch above begs two questions in my mind:
> 
> 1. Why to bind to 0 (INADDR_ANY) explicitly? My patch does not bind
> at all and expects connect() to bind automatically. It is how
> userland works and it seems to work here as well.

No real reason. Should work too. 

> 
> 2. What did you do to increase the number of unnamed devices?
> You said the patch "should" work, did that mean you did not test it?

I didn't, but the original reporter reported that it works for him.

-Andi

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

* Re: Fwd: Re: 2.4.17:Increase number of anonymous filesystems beyond 256?
  2002-01-22 22:17     ` Andi Kleen
@ 2002-01-22 22:34       ` Andi Kleen
  0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2002-01-22 22:34 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Pete Zaitcev, linux-kernel

On Tue, Jan 22, 2002 at 11:17:02PM +0100, Andi Kleen wrote:
> On Tue, Jan 22, 2002 at 12:32:20PM -0500, Pete Zaitcev wrote:
> > Andi, the patch above begs two questions in my mind:
> > 
> > 1. Why to bind to 0 (INADDR_ANY) explicitly? My patch does not bind
> > at all and expects connect() to bind automatically. It is how
> > userland works and it seems to work here as well.
> 
> No real reason. Should work too. 

Actually there is a reason. Without a bind the portmapper is unlikely
to work. 

-Andi

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

end of thread, other threads:[~2002-01-22 22:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200201171351.g0HDpdK05456@bliss.uni-koblenz.de.suse.lists.linux.kernel>
2002-01-17 17:49 ` 2.4.17:Increase number of anonymous filesystems beyond 256? Andi Kleen
     [not found] ` <mailman.1011289920.22682.linux-kernel2news@redhat.com>
2002-01-22 17:32   ` Fwd: " Pete Zaitcev
2002-01-22 22:17     ` Andi Kleen
2002-01-22 22:34       ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox