]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
tcp: remove poll() flakes when receiving RST
authorEric Dumazet <edumazet@google.com>
Tue, 18 Apr 2017 16:45:51 +0000 (09:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Apr 2017 19:42:10 +0000 (15:42 -0400)
commit3d4762639dd36a5f0f433f0c9d82e9743dc21a33
tree01aec125286a744e7b6cad15bc2e611940186c2b
parentd02e93d6471c44cc80e407f2c9791bc00fed2e91
tcp: remove poll() flakes when receiving RST

When a RST packet is processed, we send two wakeup events to interested
polling users.

First one by a sk->sk_error_report(sk) from tcp_reset(),
followed by a sk->sk_state_change(sk) from tcp_done().

Depending on machine load and luck, poll() can either return POLLERR,
or POLLIN|POLLOUT|POLLERR|POLLHUP (this happens on 99 % of the cases)

This is probably fine, but we can avoid the confusion by reordering
things so that we have more TCP fields updated before the first wakeup.

This might even allow us to remove some barriers we added in the past.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c