]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: standardize accept routine
authorYing Xue <ying.xue@windriver.com>
Fri, 17 Jan 2014 01:50:04 +0000 (09:50 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Jan 2014 03:10:34 +0000 (19:10 -0800)
commitd2f79843038dc1fec24a5b8e3e398f165a2962c0
tree41ce1f1fa70ea6c60475316e080c67e0063693af
parenta8c121b5b13f1d6a585a676e25b71d11674dfa20
tipc: standardize accept routine

Comparing the behaviour of how to wait for events in TIPC accept()
with other stacks, the TIPC implementation might be perceived as
different, and sometimes even incorrect. As sk_sleep() and
sk->sk_receive_queue variables associated with socket are not
protected by socket lock, the process of calling accept() may be
woken up improperly or sometimes cannot be woken up at all. After
standardizing it with inet_csk_wait_for_connect routine, we can
get benefits including: avoiding 'thundering herd' phenomenon,
adding a timeout mechanism for accept(), coping with a pending
signal, and having sk_sleep() and sk->sk_receive_queue being
always protected within socket lock scope and so on.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c