Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp43082ybv; Fri, 21 Feb 2020 22:42:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwXzJ4/2GFZ1rlLnfQ/aV7NvON6RdEqA7PhrskrILG0eVleBZXT7+0dZMcF4wzpWuiXi7n5 X-Received: by 2002:aca:510a:: with SMTP id f10mr5241649oib.100.1582353754341; Fri, 21 Feb 2020 22:42:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582353754; cv=none; d=google.com; s=arc-20160816; b=hMLsnovgSyrUAGAYavGDPz4VhhiC1dWyAJOwb7WjVZ0AYFhMAbaWGZZ1OsDqYXKbzs 5ivTMpgmnFtI/ffOI/IVejZJTKFmQVzJ/QGAs59dG8bXSdWJTyigag13MeJws3BcSI35 5bWDAOQ1AvY0X7VoHLr4PyHw8umrLM8vUBDabKGSRnLQeBp9FcvUpZV5P73FV6XD7gq9 W40CwgL65RvZ7rTH+PnhPVREV+wb9XoNB/Jm00HcQsfs0BkINckAgQLVUjOuGmkjEA9h q5QtB3lwsEsh+/53fZ8gu5owq4XJIdOnf104Dtq38Zw4mmXP4XNUZBB5E9R/JarhQgsT 9udw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9hYMlHxQU9EhnNg/RTgwCsCYqoi4kN3olIEeJ3OkvPk=; b=N7tgsdksYL5c59AHUZbph7XBeB24DEu37n616Q/QPxFlv+qj6W+3llYmAiFm6RuJMC 66Ed6rvTTRXiKwQjCmMmHfDH96mLo8CURHyg3/FW7/0S3FP+/Cmb8j/S2ydElqK99uD2 lwJCjwsR2fA4039052r+ZtKJ0/yhQ15mz3NjJG4DKzfOHkyw0i7DefoiO0auaKWTwMrt xXepMBCY+njwgFQGF5UDqlLXkn7eFcDNOlHaUd2pw4BrWge2F02/FaovRrRDC2aWn35J 2whk+oakE15mJisVZHwJEa21lyiIvR4mgXtlTlfvGFRh1th4k5LMxSX+NVWPEcwiC5Zs vF7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EjxVA3Br; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o16si2907569otp.289.2020.02.21.22.42.22; Fri, 21 Feb 2020 22:42:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EjxVA3Br; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727148AbgBVGmO (ORCPT + 99 others); Sat, 22 Feb 2020 01:42:14 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:47031 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726684AbgBVGmN (ORCPT ); Sat, 22 Feb 2020 01:42:13 -0500 Received: by mail-pg1-f193.google.com with SMTP id y30so2097869pga.13; Fri, 21 Feb 2020 22:42:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9hYMlHxQU9EhnNg/RTgwCsCYqoi4kN3olIEeJ3OkvPk=; b=EjxVA3Br6FjEjanPqEhDEoiXcouvU+bGrOv3uTHp9VrVsy3AXGgMpJunV/dlGd1qUm h3uIb/c+THfk4d8i8eRh2Gmc6RKBk0FeWU0DeLHdnsCMJijfu9dXn3U/Gbw9qIpykRGt gagL4hr4DlgdCOOYPod1UshTeKzN51JTcTv3f74iLTF3ML8aBN5tFTu6vgRzkeuugQ8+ v7r1tvbe5PFXIYjKy1auosHppC+l4qMmg+TqQGywTUnIQ9D24onvbs6RVVN+8cyCqdJZ 7gcoN0kyc3bs6KMHZ694GcP6l1jBOCqrZomZdNBuvqhCS9wlN++JrQOVIs3Jl97i9n2/ 1y2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9hYMlHxQU9EhnNg/RTgwCsCYqoi4kN3olIEeJ3OkvPk=; b=I3Dtv0C2qiI+W9qIqynuQp6GzUt0mwf7Gt+HCKHVglc4ez/fz+Zetm3SCN4pL3bA20 h0MxQ9AMI10s7xI1GqU3RNay4N1q1WewJVMX98+GMyWOkg8IDzvB0d72sNvlIzTM57QA ZJW0AUyQZSqQRD8nSg2lcKr8i0IlLWittsf55AfHLoRHvtc6NKWlXip2t3Awahv+f79C 18aka8oM0ID4HkN8H2KZKveAFnpukZdtpY64KBxS1vxxuhGH14bYX5OTMQFKvTEfuE/p 5sBRGNMw/n7q6gKq7qJkIqvJk9ll3Y8lz8muWNmgw/3XPlvZS+3fUGq5NXxmStmXlKT2 Zpiw== X-Gm-Message-State: APjAAAVJGbSldYCZvu05LzIezEYx8Fl6JjlmwIwggQvP3wptveGpPPcN u9jgU3Tm+6CFhtkFjMXAW19HAk40pJo= X-Received: by 2002:a65:645a:: with SMTP id s26mr40682184pgv.135.1582353733058; Fri, 21 Feb 2020 22:42:13 -0800 (PST) Received: from localhost.localdomain ([103.87.57.201]) by smtp.googlemail.com with ESMTPSA id k5sm4455071pju.29.2020.02.21.22.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 22:42:12 -0800 (PST) From: Amol Grover To: "David S . Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , "Paul E . McKenney" , Amol Grover Subject: [PATCH 2/2] ipmr: Add lockdep expression to ipmr_for_each_table macro Date: Sat, 22 Feb 2020 12:08:36 +0530 Message-Id: <20200222063835.14328-2-frextrite@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200222063835.14328-1-frextrite@gmail.com> References: <20200222063835.14328-1-frextrite@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ipmr_for_each_table() uses list_for_each_entry_rcu() for traversing outside of an RCU read-side critical section but under the protection of pernet_ops_rwsem. Hence add the corresponding lockdep expression to silence the following false-positive warning at boot: [ 0.645292] ============================= [ 0.645294] WARNING: suspicious RCU usage [ 0.645296] 5.5.4-stable #17 Not tainted [ 0.645297] ----------------------------- [ 0.645299] net/ipv4/ipmr.c:136 RCU-list traversed in non-reader section!! Signed-off-by: Amol Grover --- net/ipv4/ipmr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 99c864eb6e34..950ffe9943da 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -109,9 +109,10 @@ static void mroute_clean_tables(struct mr_table *mrt, int flags); static void ipmr_expire_process(struct timer_list *t); #ifdef CONFIG_IP_MROUTE_MULTIPLE_TABLES -#define ipmr_for_each_table(mrt, net) \ - list_for_each_entry_rcu(mrt, &net->ipv4.mr_tables, list, \ - lockdep_rtnl_is_held()) +#define ipmr_for_each_table(mrt, net) \ + list_for_each_entry_rcu(mrt, &net->ipv4.mr_tables, list, \ + lockdep_rtnl_is_held() || \ + lockdep_is_held(&pernet_ops_rwsem)) static struct mr_table *ipmr_mr_table_iter(struct net *net, struct mr_table *mrt) -- 2.24.1