net/smc: always call the POLL_IN part of sk_wake_async
authorUrsula Braun <ubraun@linux.vnet.ibm.com>
Mon, 10 Apr 2017 12:58:00 +0000 (14:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Apr 2017 03:01:14 +0000 (23:01 -0400)
Wake up reading file descriptors for a closing socket as well, otherwise
some socket applications may stall.

Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Reviewed-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_rx.c

index c4ef9a4ec56971e685d419a4a89f51e8181709c1..f0c8b089f770a229b7c805fe5b2d59da40a5c1e3 100644 (file)
@@ -36,11 +36,10 @@ static void smc_rx_data_ready(struct sock *sk)
        if (skwq_has_sleeper(wq))
                wake_up_interruptible_sync_poll(&wq->wait, POLLIN | POLLPRI |
                                                POLLRDNORM | POLLRDBAND);
+       sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
        if ((sk->sk_shutdown == SHUTDOWN_MASK) ||
            (sk->sk_state == SMC_CLOSED))
                sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_HUP);
-       else
-               sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
        rcu_read_unlock();
 }