Subject: Re: [ATM]: refcount atm sockets

for 2.4 kernels i am afraid this is they way it has to be unless
the upper socket layer is rewritten a bit. the purpose of this patch
is to prevent stupid behavior. things will be bit racy but its better
than being able to rmmod atm when 'non device' atm sockets are still open.

In message <[email protected]>,Muli Ben-Yehuda writes:
>On Fri, Jan 16, 2004 at 10:02:24AM +0000, Linux Kernel Mailing List wrote:
>> ChangeSet 1.1405.1.4, 2004/01/16 02:02:24-08:00, [email protected]
>>=20
>> [ATM]: refcount atm sockets
>
>> diff -Nru a/net/atm/common.c b/net/atm/common.c
>> --- a/net/atm/common.c Fri Jan 16 04:17:24 2004
>> +++ b/net/atm/common.c Fri Jan 16 04:17:24 2004
>> @@ -242,6 +242,8 @@
>> printk(KERN_DEBUG "vcc_sock_destruct: wmem leakage (%d bytes) d
>etected=
>=2E\n", atomic_read(&sk->wmem_alloc));
>> =20
>> kfree(sk->protinfo.af_atm);
>> +
>> + MOD_DEC_USE_COUNT;
>
>This has the usual wellknown races involved with handling the module's
>refcount from within the moodule. Is there a way to push the
>refcounting to the caller?=20