Skip to content

Commit 7eec9f3

Browse files
Eric Dumazetgregkh
Eric Dumazet
authored andcommitted
tcp: fix SO_RCVLOWAT possible hangs under high mem pressure
[ Upstream commit ba3bb0e ] Whenever tcp_try_rmem_schedule() returns an error, we are under trouble and should make sure to wakeup readers so that they can drain socket queues and eventually make room. Fixes: 03f45c8 ("tcp: avoid extra wakeups for SO_RCVLOWAT users") Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9b7fd81 commit 7eec9f3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ipv4/tcp_input.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4564,6 +4564,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
45644564

45654565
if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) {
45664566
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP);
4567+
sk->sk_data_ready(sk);
45674568
tcp_drop(sk, skb);
45684569
return;
45694570
}
@@ -4807,6 +4808,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
48074808
sk_forced_mem_schedule(sk, skb->truesize);
48084809
else if (tcp_try_rmem_schedule(sk, skb, skb->truesize)) {
48094810
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRCVQDROP);
4811+
sk->sk_data_ready(sk);
48104812
goto drop;
48114813
}
48124814

0 commit comments

Comments
 (0)