]> 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)
commitce39548f4eb3eda601c0faf4a6fcb9290ec1712d
tree41ce1f1fa70ea6c60475316e080c67e0063693af
parent38a785292b1852ad3d05b17d03a3ebedfb79e4e4
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