Re: [PATCH/RFC] New module refcounting for net_proto_family

Roman Zippel
2003-02-19T20:22:39Z

Hi,

On Tue, 18 Feb 2003, David S. Miller wrote:

> Firstly, the owner field should probably be in struct proto_ops not
> struct socket, where the function pointers are.
>
> I think this is one of Alexey's main problems with the
> patch.

BTW the access to sockets_in_use is not preempt safe. Although the data
has only statistic value, it might be worth to fix this. The easiest
solution might be to move socket allocation and the create call outside
the net_family lock. The read lock should at least get a preempt enable/
disable (brlock might be another possibilty) and within this lock we can
safely modify sockets_in_use and do something like net_family_get()/
net_family_put() similiar to get_fs_type().

bye, Roman