]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix hanging clients using poll with EPOLLOUT flag
authorParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@gmail.com>
Thu, 9 May 2019 05:13:42 +0000 (07:13 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 May 2019 16:26:09 +0000 (09:26 -0700)
commit5cc39b391e20d6403fce6c927f8f0357622ded46
tree3e765dd8dbd1455ace9773bf0a561b466fd413e8
parent6860866da93863832f99653d8d676a3b9c92ddc9
tipc: fix hanging clients using poll with EPOLLOUT flag

commit 0fe29b7f0abed8 ("tipc: fix hanging poll() for stream sockets")
introduced a regression for clients using non-blocking sockets.
After the commit, we send EPOLLOUT event to the client even in
TIPC_CONNECTING state. This causes the subsequent send() to fail
with ENOTCONN, as the socket is still not in TIPC_ESTABLISHED state.

In this commit, we:
- improve the fix for hanging poll() by replacing sk_data_ready()
  with sk_state_change() to wake up all clients.
- revert the faulty updates introduced by commit 0fe29b7f0abed8
  ("tipc: fix hanging poll() for stream sockets").

Fixes: 0fe29b7f0abed8 ("tipc: fix hanging poll() for stream sockets")
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@gmail.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c