Subject: Re: [PATCH] net-next: Fix __inet_inherit_port() to correctly increment bsockets and num_owners

From: Jarek Poplawski <[email-masked]>
Date: Mon, 29 Nov 2010 13:33:20 +0000

On Mon, Nov 29, 2010 at 02:17:46PM +0100, Eric Dumazet wrote:
> Le lundi 29 novembre 2010 ?? 13:12 +0000, Jarek Poplawski a écrit :
> 
> > Evgeniy & Eric,

Eric & Evgeniy ;-)

> > But it's compared to the numer of available port numbers in
> > inet_csk_get_port():
> > 
> >      "if (atomic_read(&hashinfo->bsockets) > (high - low) + 1)"
> > 
> > Can't you have bsockets higher than this with only one port used?
> > 
> 
> Because we store tuples, not only port information.
> 
> You can have many sockets bound on a single port.
> 
> This 'optimization' was only meaningful on a machine you make only
> active connections, if you ask me...

That's what I've missed...

> Problem is, as soon as some passive connections are done, bsockets count
> becomes wrong. The patch fixes this, thats all.

Sure, the numbers are correct now. I wondered about this optimization
only.

Thanks for explanations,
Jarek P.