tun: Only wake up writers

Submitted by Herbert Xu on June 3, 2009, 3:33 a.m.

Details

Message ID 20090603033303.GA7889@gondor.apana.org.au
State Superseded
Delegated to: David Miller
Headers show

Commit Message

Herbert Xu June 3, 2009, 3:33 a.m.
Hi:

tun: Only wake up writers

Recently net/core/sock.c was updated so that when we free an skb
that has been transmitted we only wake up writers instead of waking
up both readers and writers.

This patch does the same thing for tun as this code is identical
to that in net/core/sock.c

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


Thanks,

Patch hide | download patch | download mbox

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 735bf41..7ca43b8 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -841,7 +841,9 @@  static void tun_sock_write_space(struct sock *sk)
 		return;
 
 	if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
-		wake_up_interruptible_sync(sk->sk_sleep);
+		wake_up_interruptible_sync_poll(sk->sk_sleep,
+						POLLOUT | POLLWRNORM |
+						POLLWRBAND);
 
 	if (!test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags))
 		return;