]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: guarantee forward progress in tcp_sendmsg()
authorEric Dumazet <edumazet@google.com>
Tue, 3 May 2016 04:49:25 +0000 (21:49 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 May 2016 16:44:36 +0000 (12:44 -0400)
commitf0cc7905235ee523ae94dbeca8a07905bb8c761b
tree5091043fd26ab8871104ba087894d9842a399d10
parent7b5242d5023e56c75192effeccf2350eb0ac39ef
tcp: guarantee forward progress in tcp_sendmsg()

Under high rx pressure, it is possible tcp_sendmsg() never has a
chance to allocate an skb and loop forever as sk_flush_backlog()
would always return true.

Fix this by calling sk_flush_backlog() only if one skb had been
allocated and filled before last backlog check.

Fixes: 0cfb5406b3cd ("tcp: make tcp_sendmsg() aware of socket backlog")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp.c