diff options
| author | James Morris <james.morris@microsoft.com> | 2018-12-17 11:24:28 -0800 |
|---|---|---|
| committer | James Morris <james.morris@microsoft.com> | 2018-12-17 11:24:28 -0800 |
| commit | 8bd8ea195f6d135a8d85201116314eb5237ad7e7 (patch) | |
| tree | 3ef99e468f0b4b13cc11002aa60c4451e326191b /net/tipc/node.c | |
| parent | 1072bd678547f8663cfb81a22fdb50c589e4976e (diff) | |
| parent | 7566ec393f4161572ba6f11ad5171fd5d59b0fbd (diff) | |
| download | lwn-8bd8ea195f6d135a8d85201116314eb5237ad7e7.tar.gz lwn-8bd8ea195f6d135a8d85201116314eb5237ad7e7.zip | |
Merge tag 'v4.20-rc7' into next-general
Sync with Linux 4.20-rc7, to pick up: Revert "ovl: relax permission checking on underlying layers"
Diffstat (limited to 'net/tipc/node.c')
| -rw-r--r-- | net/tipc/node.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 2afc4f8c37a7..488019766433 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -584,12 +584,15 @@ static void tipc_node_clear_links(struct tipc_node *node) /* tipc_node_cleanup - delete nodes that does not * have active links for NODE_CLEANUP_AFTER time */ -static int tipc_node_cleanup(struct tipc_node *peer) +static bool tipc_node_cleanup(struct tipc_node *peer) { struct tipc_net *tn = tipc_net(peer->net); bool deleted = false; - spin_lock_bh(&tn->node_list_lock); + /* If lock held by tipc_node_stop() the node will be deleted anyway */ + if (!spin_trylock_bh(&tn->node_list_lock)) + return false; + tipc_node_write_lock(peer); if (!node_is_up(peer) && time_after(jiffies, peer->delete_at)) { |
