diff options
author | Allan Stephens <Allan.Stephens@windriver.com> | 2011-02-24 19:20:20 +0100 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2011-03-13 21:35:16 +0100 |
commit | 9df3b7eb6ec1c7734482f782bf8335a2737c02f0 (patch) | |
tree | e54c8857773a3e54c213dd4f825b48fdd7ab295e /net/tipc/net.c | |
parent | tipc: Add support for SO_RCVTIMEO socket option (diff) | |
download | linux-9df3b7eb6ec1c7734482f782bf8335a2737c02f0.tar.xz linux-9df3b7eb6ec1c7734482f782bf8335a2737c02f0.zip |
tipc: Fix problem with missing link in "tipc-config -l" output
Removes a race condition that could cause TIPC's internal counter
of the number of links it has to neighboring nodes to have the
incorrect value if two independent threads of control simultaneously
create new link endpoints connecting to two different nodes using two
different bearers. Such under counting would result in TIPC failing to
list the final link(s) in its response to a configuration request to
list all of the node's links. The counter is now updated atomically
to ensure that simultaneous increments do not interfere with each
other.
Thanks go to Peter Butler <pbutler@pt.com> for his assistance in
diagnosing and fixing this problem.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r-- | net/tipc/net.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c index 9bacfd00b91e..dd78d869829f 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c @@ -2,7 +2,7 @@ * net/tipc/net.c: TIPC network routing code * * Copyright (c) 1995-2006, Ericsson AB - * Copyright (c) 2005, Wind River Systems + * Copyright (c) 2005, 2010-2011, Wind River Systems * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -115,6 +115,7 @@ static int net_start(void) tipc_net.nodes = kcalloc(tipc_max_nodes + 1, sizeof(*tipc_net.nodes), GFP_ATOMIC); tipc_net.highest_node = 0; + atomic_set(&tipc_net.links, 0); return tipc_net.nodes ? 0 : -ENOMEM; } |