Skip to content

Commit ba3bb0e

Browse files
Eric Dumazetdavem330
Eric Dumazet
authored andcommitted
tcp: fix SO_RCVLOWAT possible hangs under high mem pressure
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]>
1 parent 0da7536 commit ba3bb0e

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
@@ -4582,6 +4582,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
45824582

45834583
if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) {
45844584
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP);
4585+
sk->sk_data_ready(sk);
45854586
tcp_drop(sk, skb);
45864587
return;
45874588
}
@@ -4828,6 +4829,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
48284829
sk_forced_mem_schedule(sk, skb->truesize);
48294830
else if (tcp_try_rmem_schedule(sk, skb, skb->truesize)) {
48304831
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRCVQDROP);
4832+
sk->sk_data_ready(sk);
48314833
goto drop;
48324834
}
48334835

0 commit comments

Comments
 (0)