Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B843C10F13 for ; Thu, 11 Apr 2019 19:56:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E34A2073F for ; Thu, 11 Apr 2019 19:56:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ericsson.com header.i=@ericsson.com header.b="dXB5TCV7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726833AbfDKT4a (ORCPT ); Thu, 11 Apr 2019 15:56:30 -0400 Received: from sesbmg23.ericsson.net ([193.180.251.37]:63390 "EHLO sesbmg23.ericsson.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726588AbfDKT4a (ORCPT ); Thu, 11 Apr 2019 15:56:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1555012588; x=1557604588; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2cGniK8mziZM/UYVT8NHDrYC/eUx4mt9dRminKdQaWU=; b=dXB5TCV7Pz/O12Lc58+AlBAtVDF8NDiC1SW4B3FacYZl8XO1+po6YTx9hq4FM06H sJ4J7th1A4qY4rQfGr/FqE6x6KakgMYUNy70jvAQnAm00uGJdw9qeO16BgKmQaiQ EnU4YvZUNBvpgVWD1J0TvwoC9RXHGl/+KUOatLAEtzI=; X-AuditID: c1b4fb25-4b5ff70000001b0f-84-5caf9bec31f6 Received: from ESESSMB504.ericsson.se (Unknown_Domain [153.88.183.122]) by sesbmg23.ericsson.net (Symantec Mail Security) with SMTP id A0.A7.06927.CEB9FAC5; Thu, 11 Apr 2019 21:56:28 +0200 (CEST) Received: from ESESBMB505.ericsson.se (153.88.183.172) by ESESSMB504.ericsson.se (153.88.183.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 11 Apr 2019 21:56:28 +0200 Received: from tipsy.lab.linux.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.188) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Thu, 11 Apr 2019 21:56:27 +0200 From: Jon Maloy To: , CC: , , , , , , Subject: [net-next v2 1/1] tipc: use standard write_lock & unlock functions when creating node Date: Thu, 11 Apr 2019 21:56:28 +0200 Message-ID: <1555012588-1909-1-git-send-email-jon.maloy@ericsson.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Content-Type: text/plain X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNLMWRmVeSWpSXmKPExsUyM2J7le6b2etjDM4fVLa40dDDbDHnfAuL xYrdk1gt3r6axW5xbIGYxZbzWRZX2s+yWzy+fp3ZgcNjy8qbTB7vrrB57F7wmcnj8yY5j/Vb tjIFsEZx2aSk5mSWpRbp2yVwZWz9+oCpYCdXxdmHE1gaGA9xdDFyckgImEhsf7CatYuRi0NI 4CijxJFJZ1hAEkIC3xgl/i0OhkhcYJTo+3meCSTBJqAh8XJaByOILSJgLPFqZScTSBGzwGNG iS/3V7GBJIQF4iQmb7oAZrMIqEoc2rkHrJlXwFXi/eY9jBCr5STOH//JDLFNWWLuh2lQNYIS J2c+AbuCWUBC4uCLF8wTGPlmIUnNQpJawMi0ilG0OLU4KTfdyFgvtSgzubg4P08vL7VkEyMw SA9u+a26g/HyG8dDjAIcjEo8vJw962OEWBPLiitzDzFKcDArifCGsACFeFMSK6tSi/Lji0pz UosPMUpzsCiJ8/4REowREkhPLEnNTk0tSC2CyTJxcEo1MKZYTWvmSC1gX5155cLJU5YFgjqR 1j0b5zzbfeubqJ6A7nGW+RYs+69Obar5xb3C4dKmyL//dr/7zL+iI2eWgGR+Kf/cmHvqf4w/ zv318eWpg/z2lldT1jw+VXDqp/dnjZ0/P74WmL5NfYGt0Web15YHLOSPTAjQvJJlXfSlXd3e bPG7E4Xee3KUWIozEg21mIuKEwHXyeIITgIAAA== Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- v2: corrected format of "Fixed:" tag --- 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