From 9df3b7eb6ec1c7734482f782bf8335a2737c02f0 Mon Sep 17 00:00:00 2001
From: Allan Stephens <Allan.Stephens@windriver.com>
Date: Thu, 24 Feb 2011 13:20:20 -0500
Subject: 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>
---
 net/tipc/net.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'net/tipc/net.h')

diff --git a/net/tipc/net.h b/net/tipc/net.h
index 4ae59ad04893..aa431ef8b7bf 100644
--- a/net/tipc/net.h
+++ b/net/tipc/net.h
@@ -2,7 +2,7 @@
  * net/tipc/net.h: Include file for 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
@@ -49,7 +49,7 @@ struct tipc_node;
 struct network {
 	struct tipc_node **nodes;
 	u32 highest_node;
-	u32 links;
+	atomic_t links;
 };
 
 
-- 
cgit v1.2.3