Thread (6 messages) 6 messages, 2 authors, 2010-08-31
STALE5766d

[PATCH 3/3] Phonet: do not set POLLOUT in case of send buffer overflow

From: Rémi Denis-Courmont <hidden>
Date: 2010-08-30 22:57:05
Subsystem: networking [general], phonet protocol, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Remi Denis-Courmont, Linus Torvalds

From: Rémi Denis-Courmont <redacted>

Signed-off-by: Rémi Denis-Courmont <redacted>
---
 net/phonet/socket.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index 6e9848b..7c91f73 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -281,7 +281,9 @@ static unsigned int pn_socket_poll(struct file *file, struct socket *sock,
 	if (!mask && sk->sk_state == TCP_CLOSE_WAIT)
 		return POLLHUP;
 
-	if (sk->sk_state == TCP_ESTABLISHED && atomic_read(&pn->tx_credits))
+	if (sk->sk_state == TCP_ESTABLISHED &&
+		atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf &&
+		atomic_read(&pn->tx_credits))
 		mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
 
 	return mask;
-- 
1.7.0.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help