Re: tcp_recvmsg() in 2.4.4

David S. Miller (davem@redhat.com)
Fri, 8 Jun 2001 08:29:19 -0700 (PDT)


Eric Barton writes:
> When it get to if(sk->state == TCP_CLOSE), surely sk->done has already been
> tested (and the socket is locked), so -ENOTCONN could be returned
> immediately.

We sleep and drop the lock during these loops, so we need to retest
this each time we wake back up.

> Actually I'd really appreciate it if someone could explain the order of
> tests for sk->done, sk->err, sk->shutdown and sk->state...

Most of the error test ordering is specified by POSIX somewhere.

Alan would know better.

Later,
David S. Miller
davem@redhat.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/