[PATCH net-next 2/2] net: tap: fix POLLOUT condition in tap_poll()

DORMANTno replies

From: yuan linyu <hidden>
Date: 2017-12-11 13:28:23
Subsystem: networking drivers, the rest, tun/tap driver · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds, Willem de Bruijn, Jason Wang

From: yuan linyu <redacted>

from logical view, if sock_writeable(&q->sk) return false,
original second condition will false too,
change it and make second condition can return true.

Signed-off-by: yuan linyu <redacted>
---
 drivers/net/tap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 78900a0..b809405 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -583,8 +583,7 @@ static unsigned int tap_poll(struct file *file, poll_table *wait)
 		mask |= POLLIN | POLLRDNORM;
 
 	if (sock_writeable(&q->sk) ||
-	    (!test_and_set_bit(SOCKWQ_ASYNC_NOSPACE, &q->sock.flags) &&
-	     sock_writeable(&q->sk)))
+	    !test_and_set_bit(SOCKWQ_ASYNC_NOSPACE, &q->sock.flags))
 		mask |= POLLOUT | POLLWRNORM;
 
 out:
-- 
2.7.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