]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
tipc: eliminate risk of premature link setup during failover
authorJon Paul Maloy <jon.maloy@ericsson.com>
Thu, 20 Aug 2015 06:12:54 +0000 (02:12 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 23 Aug 2015 23:14:45 +0000 (16:14 -0700)
commit17b2063077a7478e5fd3c34b04a059dbb8474638
tree0008ed4bbfc5c7f0f7caa76ce1734ead31350a8d
parent7f629be158a93e1b8f882c13c098d043f68cad9c
tipc: eliminate risk of premature link setup during failover

When a link goes down, and there is still a working link towards its
destination node, a failover is initiated, and the failed link is not
allowed to re-establish until that procedure is finished. To ensure
this, the concerned link endpoints are set to state LINK_FAILINGOVER,
and the node endpoints to NODE_FAILINGOVER during the failover period.

However, if the link reset is due to a disabled bearer, the corres-
ponding link endpoint is deleted, and only the node endpoint knows
about the ongoing failover. Now, if the disabled bearer is re-enabled
during the failover period, the discovery mechanism may create a new
link endpoint that is ready to be established, despite that this is not
permitted. This situation may cause both the ongoing failover and any
subsequent link synchronization to fail.

In this commit, we ensure that a newly created link goes directly to
state LINK_FAILINGOVER if the corresponding node state is
NODE_FAILINGOVER. This eliminates the problem described above.

Furthermore, we tighten the criteria for which packets are allowed
to end a failover state in the function tipc_node_check_state().
By checking that the receiving link is up and running, instead of just
checking that it is not in failover mode, we eliminate the risk that
protocol packets from the re-created link may cause the failover to
be prematurely terminated.

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