Re: sk->data_ready at socket release

Bill Hawes (whawes@star.net)
Tue, 16 Sep 1997 13:03:15 -0400


David S. Miller wrote:

> Are you passing references to sockets around to various threads
> without bumping reference counts to the descriptors?
>
> When the socket layer sees the real close() code path, it assumes (as
> it should) that the last person holding a ref count is closing a
> descriptor. The only thing that can delay the full release is pending
> data in the sock which hasn't made it to the wire yet, and those will
> make the close()'r sleep until the packets go or things time out (or
> the socket gets reset in the case of TCP, since you can't unload the
> send buffers and just have to free them all).

Thanks for the explanation. The bug I fixed was a messed up semaphore
count, which allowed two processes to reference the same socket without
bumping the ref count. Sounds like this would explain the behavior
quite well.

Regards,
Bill