* [PATCH net v1 1/1] tipc: fix hanging poll() for stream sockets
@ 2017-12-28 11:03 Parthasarathy Bhuvaragan
2017-12-28 17:16 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Parthasarathy Bhuvaragan @ 2017-12-28 11:03 UTC (permalink / raw)
To: netdev; +Cc: tipc-discussion, jon.maloy, Parthasarathy Bhuvaragan
In commit 42b531de17d2f6 ("tipc: Fix missing connection request
handling"), we replaced unconditional wakeup() with condtional
wakeup for clients with flags POLLIN | POLLRDNORM | POLLRDBAND.
This breaks the applications which do a connect followed by poll
with POLLOUT flag. These applications are not woken when the
connection is ESTABLISHED and hence sleep forever.
In this commit, we fix it by including the POLLOUT event for
sockets in TIPC_CONNECTING state.
Fixes: 42b531de17d2f6 ("tipc: Fix missing connection request handling")
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@gmail.com>
---
net/tipc/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 41127d0b925e..3b4084480377 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -727,11 +727,11 @@ static unsigned int tipc_poll(struct file *file, struct socket *sock,
switch (sk->sk_state) {
case TIPC_ESTABLISHED:
+ case TIPC_CONNECTING:
if (!tsk->cong_link_cnt && !tsk_conn_cong(tsk))
revents |= POLLOUT;
/* fall thru' */
case TIPC_LISTEN:
- case TIPC_CONNECTING:
if (!skb_queue_empty(&sk->sk_receive_queue))
revents |= POLLIN | POLLRDNORM;
break;
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net v1 1/1] tipc: fix hanging poll() for stream sockets
2017-12-28 11:03 [PATCH net v1 1/1] tipc: fix hanging poll() for stream sockets Parthasarathy Bhuvaragan
@ 2017-12-28 17:16 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-12-28 17:16 UTC (permalink / raw)
To: parthasarathy.bhuvaragan; +Cc: netdev, tipc-discussion, jon.maloy
From: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@gmail.com>
Date: Thu, 28 Dec 2017 12:03:06 +0100
> In commit 42b531de17d2f6 ("tipc: Fix missing connection request
> handling"), we replaced unconditional wakeup() with condtional
> wakeup for clients with flags POLLIN | POLLRDNORM | POLLRDBAND.
>
> This breaks the applications which do a connect followed by poll
> with POLLOUT flag. These applications are not woken when the
> connection is ESTABLISHED and hence sleep forever.
>
> In this commit, we fix it by including the POLLOUT event for
> sockets in TIPC_CONNECTING state.
>
> Fixes: 42b531de17d2f6 ("tipc: Fix missing connection request handling")
> Acked-by: Jon Maloy <jon.maloy@ericsson.com>
> Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@gmail.com>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-28 17:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-28 11:03 [PATCH net v1 1/1] tipc: fix hanging poll() for stream sockets Parthasarathy Bhuvaragan
2017-12-28 17:16 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox