All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next  1/1] tipc: use standard write_lock & unlock functions when creating node
@ 2019-04-11 18:27 Jon Maloy
  2019-04-11 18:36 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Maloy @ 2019-04-11 18:27 UTC (permalink / raw)
  To: davem, netdev
  Cc: gordan.mihaljevic, tung.q.nguyen, hoang.h.le, jon.maloy,
	canh.d.luu, ying.xue, tipc-discussion

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>
---
 net/tipc/node.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/tipc/node.c b/net/tipc/node.c
index 3469b5d..7478e2d 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,
 		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) {
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [net-next 1/1] tipc: use standard write_lock & unlock functions when creating node
  2019-04-11 18:27 [net-next 1/1] tipc: use standard write_lock & unlock functions when creating node Jon Maloy
@ 2019-04-11 18:36 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-04-11 18:36 UTC (permalink / raw)
  To: jon.maloy
  Cc: netdev, gordan.mihaljevic, tung.q.nguyen, hoang.h.le, canh.d.luu,
	ying.xue, tipc-discussion

From: Jon Maloy <jon.maloy@ericsson.com>
Date: Thu, 11 Apr 2019 20:27:08 +0200

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

Hello Jon, please format Fixes: tags as follows:

Fixes: SHA_ID_12DIGITS ("Commit header line text")

Thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-11 18:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-11 18:27 [net-next 1/1] tipc: use standard write_lock & unlock functions when creating node Jon Maloy
2019-04-11 18:36 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.