On Tue, 2003-04-29 at 19:29, David S. Miller wrote:
> From: Max Krasnyansky <maxk@xxxxxxxxxxxx>
> Date: Tue, 29 Apr 2003 13:05:08 -0700
> - Why do we have to bump module refcount for 'struct sock' with
> _default_ callbacks ?
> Nothing says that just because a sock uses default callbacks, it can't
> be referenced in other ways by the implementation module, for example
> it can sit in the protocol hash tables and that by itself requires
> a module reference.
That's a good point. However this is protocol's local business.
Netcore does not use those hashes directly. Netcore only uses things
like sk->state, sk->lock, etc and callbacks. So the callback is the only
reference, from netcore's point of view, into the protocol module.
Most protocols that I've looked at unlink sk from its hashes in
proto_sock_release(struct socket *sock) so it's enough to make sure that
struct socket is accounted for.
And like I said before if protocol wants for some reason to be around
until sk is destroyed it will simply do sk_set_owner() right after