Subject: Re: [PATCH 1/5] sock_create bad error return

From: Stephen Hemminger <[email-masked]>
Date: Thu, 10 Aug 2006 10:06:08 -0700

On Wed, 09 Aug 2006 20:47:45 -0700 (PDT)
David Miller <[email-masked]> wrote:

> From: Stephen Hemminger <[email-masked]>
> Date: Wed, 09 Aug 2006 11:31:39 -0700
> 
> > If socket create call races with module unload, it correctly
> > fails the socket call but doesn't return an error. This race
> > is theoritical because the sock->ops are always the same and
> > non-modular.
> > 
> > Signed-off-by: Stephen Hemminger <[email-masked]>
> 
> I think the intention of the code is to return
> -EAFNOSUPPORT which is set explicitly some lines
> above, and this makes sense because if we can't grab
> onto the module reference count it means the module
> is in the process of being unloaded.

It is the module reference count of the socket file ops, not the
protocol family reference count.  The protocol family code is
already handled a few lines above.

Since the socket code can't be built as a module, it is a dead end. I think
in-olden-times the idea was that networking could be built as a module
so that inode ops would have to be ref counted.