tipc: return early for non-blocking sockets at link congestion
authorParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Tue, 1 Nov 2016 13:02:34 +0000 (14:02 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Nov 2016 15:53:23 +0000 (11:53 -0400)
commit7cf87fa27873a954f2d665dfc61fc22227d96ad8
tree74d947199ea10ad77ec946f1d5e69ca5702f1fb3
parent169650d3eaf1ef0604ac31ba39f2ea21a8d9b2cb
tipc: return early for non-blocking sockets at link congestion

Until now, in stream/mcast send() we pass the message to the link
layer even when the link is congested and add the socket to the
link's wakeup queue. This is unnecessary for non-blocking sockets.
If a socket is set to non-blocking and sends multicast with zero
back off time while receiving EAGAIN, we exhaust the memory.

In this commit, we return immediately at stream/mcast send() for
non-blocking sockets.

Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c