aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2019-04-11 15:56:28 -0400
committerDavid S. Miller <davem@davemloft.net>2019-04-11 16:42:35 -0400
commit909620ff72c8fcf95b6ef1dca850b24bf016dd27 (patch)
tree1005b00adcc986b88c6ed22ef45f73670d43ce16 /net/tipc/node.c
parent9e35552ae1eafd666e7388a1a94a321665d2f911 (diff)
tipc: use standard write_lock & unlock functions when creating node
In the function tipc_node_create() we protect the peer capability field by using the node rw_lock. However, we access the lock directly instead of using the dedicated functions for this, as we do everywhere else in node.c. This cosmetic spot is fixed here. Fixes: 40999f11ce67 ("tipc: make link capability update thread safe") Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 3469b5d4ed32..7478e2d4ec02 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -375,14 +375,15 @@ static struct tipc_node *tipc_node_create(struct net *net, u32 addr,
375 if (n->capabilities == capabilities) 375 if (n->capabilities == capabilities)
376 goto exit; 376 goto exit;
377 /* Same node may come back with new capabilities */ 377 /* Same node may come back with new capabilities */
378 write_lock_bh(&n->lock); 378 tipc_node_write_lock(n);
379 n->capabilities = capabilities; 379 n->capabilities = capabilities;
380 for (bearer_id = 0; bearer_id < MAX_BEARERS; bearer_id++) { 380 for (bearer_id = 0; bearer_id < MAX_BEARERS; bearer_id++) {
381 l = n->links[bearer_id].link; 381 l = n->links[bearer_id].link;
382 if (l) 382 if (l)
383 tipc_link_update_caps(l, capabilities); 383 tipc_link_update_caps(l, capabilities);
384 } 384 }
385 write_unlock_bh(&n->lock); 385 tipc_node_write_unlock_fast(n);
386
386 /* Calculate cluster capabilities */ 387 /* Calculate cluster capabilities */
387 tn->capabilities = TIPC_NODE_CAPABILITIES; 388 tn->capabilities = TIPC_NODE_CAPABILITIES;
388 list_for_each_entry_rcu(temp_node, &tn->node_list, list) { 389 list_for_each_entry_rcu(temp_node, &tn->node_list, list) {