]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: eliminate risk of double link_up events
authorJon Paul Maloy <jon.maloy@ericsson.com>
Wed, 11 May 2016 23:15:45 +0000 (19:15 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 May 2016 21:11:27 +0000 (17:11 -0400)
commit11436ef9c439c9269f35aad6fe84d8e2616d24c5
tree0e3b0cdcb216bf5abb209c821cd30035bddf41b5
parent83c49f83295979f3dddb0699f7d7dd1f857d8197
tipc: eliminate risk of double link_up events

When an ACTIVATE or data packet is received in a link in state
ESTABLISHING, the link does not immediately change state to
ESTABLISHED, but does instead return a LINK_UP event to the caller,
which will execute the state change in a different lock context.

This non-atomic approach incurs a low risk that we may have two
LINK_UP events pending simultaneously for the same link, resulting
in the final part of the setup procedure being executed twice. The
only potential harm caused by this it that we may see two LINK_UP
events issued to subsribers of the topology server, something that
may cause confusion.

This commit eliminates this risk by checking if the link is already
up before proceeding with the second half of the setup.

Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/node.c