Skip to contentSkip to conversation

tipc: use standard write_lock & unlock functions when creating node

PATCH Applied Jon Maloy 2 participants 2 messages Apr 11, 2019

Subsystems (3)
lore
Share & tools
lore

Jon Maloy

author
#0 lore raw

PATCH v2 1/1 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")

---
v2: corrected format of "Fixed:" tag

---
 net/tipc/node.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/tipc/node.c +3 -2
index 3469b5d..7478e2d 100644
@@ -375,14 +375,15 @@ static struct tipc_node *tipc_node_create(struct net *net, u32 addr,
 		if (n->capabilities == capabilities)
 			goto exit;
 		/* Same node may come back with new capabilities */
-		write_lock_bh(&n->lock);
+		tipc_node_write_lock(n);
 		n->capabilities = capabilities;
 		for (bearer_id = 0; bearer_id < MAX_BEARERS; bearer_id++) {
 			l = n->links[bearer_id].link;
 			if (l)
 				tipc_link_update_caps(l, capabilities);
 		}
-		write_unlock_bh(&n->lock);
+		tipc_node_write_unlock_fast(n);
+
 		/* Calculate cluster capabilities */
 		tn->capabilities = TIPC_NODE_CAPABILITIES;
 		list_for_each_entry_rcu(temp_node, &tn->node_list, list) {
Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw

From: Jon Maloy <[email protected]>
Date: Thu, 11 Apr 2019 21:56:28 +0200

Quoted 10 lines

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")

---
v2: corrected format of "Fixed:" tag

Applied, thanks Jon.