* [PATCH net-next 1/1] tipc: eliminate risk of double link_up events
@ 2016-05-11 23:15 Jon Maloy
2016-05-12 21:12 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jon Maloy @ 2016-05-11 23:15 UTC (permalink / raw)
To: davem
Cc: netdev, Paul Gortmaker, parthasarathy.bhuvaragan, richard.alpe,
ying.xue, maloy, tipc-discussion, Jon Maloy
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>
---
net/tipc/node.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tipc/node.c b/net/tipc/node.c
index d903f56..e01e2c71 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -542,7 +542,7 @@ static void __tipc_node_link_up(struct tipc_node *n, int bearer_id,
struct tipc_link *ol = node_active_link(n, 0);
struct tipc_link *nl = n->links[bearer_id].link;
- if (!nl)
+ if (!nl || tipc_link_is_up(nl))
return;
tipc_link_fsm_evt(nl, LINK_ESTABLISH_EVT);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next 1/1] tipc: eliminate risk of double link_up events
2016-05-11 23:15 [PATCH net-next 1/1] tipc: eliminate risk of double link_up events Jon Maloy
@ 2016-05-12 21:12 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-05-12 21:12 UTC (permalink / raw)
To: jon.maloy
Cc: netdev, paul.gortmaker, parthasarathy.bhuvaragan, richard.alpe,
ying.xue, maloy, tipc-discussion
From: Jon Maloy <jon.maloy@ericsson.com>
Date: Wed, 11 May 2016 19:15:45 -0400
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-12 21:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-11 23:15 [PATCH net-next 1/1] tipc: eliminate risk of double link_up events Jon Maloy
2016-05-12 21:12 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).