netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* TCP:Is it possible for both sk->dead==1 and sk->lock.users==1 to be true?
@ 2003-10-07 12:16 zrzeng
  0 siblings, 0 replies; only message in thread
From: zrzeng @ 2003-10-07 12:16 UTC (permalink / raw)
  To: netdev

Hi, gurus,

In tcp_input.c, function tcp_rcv_state_process(), 
when doing ack processing of state TCP_FIN_WAIT1, 
there are statements (kernel 2.4.21):

    if (!sk->dead)
        ......
    else {
        ......
        if (tmo > TCP_TIMEWAIT_LEN) {
                ......
--->>   } else if (th->fin || sk->lock.users) {
                /* Bad case. We could lose such FIN otherwise.
                 * It is not a big problem, but it looks confusing
                 * and not so rare event. We still can lose it now,
                 * if it spins in bh_lock_sock(), but it is really
                 * marginal case.
                 */
                tcp_reset_keepalive_timer(sk, tmo);
        } else {
                ......
        }

but as far as I understand, 
1)if sk is dead, there would be no process context reference to it.
2)if sk->lock.users==1, it means that some process context is
  referencing it, and most likely it is in backlog processing when 
  doing release_sock().

1) and 2) seems to be a bit conflict to me, 

Am I missing any important points? 

Thank you for your kind help in advance.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-07 12:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-07 12:16 TCP:Is it possible for both sk->dead==1 and sk->lock.users==1 to be true? zrzeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).