Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp11801ybh; Tue, 10 Mar 2020 18:10:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsinp8v9cCXYoiOcn0PcB6qfG8AFpohaWZC252vACaru4DrZ/IMoh6ARhtxgTwq6ZMuwkRu X-Received: by 2002:aca:db56:: with SMTP id s83mr283951oig.171.1583889024816; Tue, 10 Mar 2020 18:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583889024; cv=none; d=google.com; s=arc-20160816; b=jlUtNAXuC090IYf/LF4t+WMT2NGt05y9SiB+AYaG8598Y/fwqzAifDnNb6L49jYaXf lhlewKvKHhXGwKuOcvMwHSz5qkvScRK8OiBbD5TVvFSNmgj4xlHqCrRp7rCCVEvJFjwq 8oOucV8iMR7awrnX/XCCnVyftsjmswJFDprrJIZWN9a+nr/a6RzKGuME8fKUcMDVyQon ewIC5aLNOGB+XLIc07kJBxB4a8BgTGwfSFt3+Q2RmFx1H9QCIoJydotJuEUALNnBNUMs 5+c9lFvLrQiVMm22fCEByoF9zLpqHXd+x4Pi2gRah4cEf8nkkQHt9AJHt0DW6e5Qlum1 YceQ== 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=vVRR4OgupYaiYbHKhmSicBHQ95FN9+SKT9CQzo7pJnM=; b=maaFEVMN3D0EZd8M5FIWd0+vsT8fZZOUhajJNGsQsLCuWny7nSqFgIzY7MeQEaSNAq C+J1zA1mvHynOn5S1e2ehbPEDsLoXFNLWR1YjXN6dfwHihtgtLL/gT57UwSb59RY41G1 bA3sP26DASzjBPSgqmCHsln+f7eY4zPTU8czUvN5bsY0H8vZL3yk/00fqVZPXgzNlmTj dfBTWIsntJ3a/BBleitaYaP3lgRLPmt9QiGJ1/9uNQvQRqhydvq8CUZ1B/edx4GaDhiv CMIv4nIx+o3sqRbNCOKU84wR8qVcdoMNon5cE8BzBKJ3bRwS5Wtf7YEQOLRcvVxv1XEb /aBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qvULlz99; 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 p3si307062oih.186.2020.03.10.18.10.08; Tue, 10 Mar 2020 18:10:24 -0700 (PDT) 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=qvULlz99; 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 S1727978AbgCKBJg (ORCPT + 99 others); Tue, 10 Mar 2020 21:09:36 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51036 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727958AbgCKBJf (ORCPT ); Tue, 10 Mar 2020 21:09:35 -0400 Received: by mail-wm1-f67.google.com with SMTP id a5so298749wmb.0; Tue, 10 Mar 2020 18:09:32 -0700 (PDT) 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=vVRR4OgupYaiYbHKhmSicBHQ95FN9+SKT9CQzo7pJnM=; b=qvULlz99rWRiLqex5Lnn1QU1NhB/rQU7Wu8/SvYwZHZSifBTXvmU8WAGQIj8+/k9mT aOVd9vPoRvUPnFcecDzQZJE/MygViKIMPSuwXoeS/2yWxorCxdJ46MTFNPSZTs1uI7QI w9FvmdwQHbfNUuGOToq0xasCIJPmi6NZSf3ctusJjmrxW+GR938JEwGd5F0JFzDPivOO szaaDIuuKlTSOVORMmp5nEd/i6JMrX/UdDYo/lAEO7Nyl/St7iCJdbRVgsBFcaQhCd/r 4SpKYdnrvHW9Qb3RxC9tj92GCqz2Q8MuSJ6BWtEmTsTRSfNyT9COuXCLgLD+Fawc7mun n6wg== 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=vVRR4OgupYaiYbHKhmSicBHQ95FN9+SKT9CQzo7pJnM=; b=UMmhJvxprM8hWggW5kjm/b3a+mfr9iQ0Nq0O41qahfl/oRAzROigefpOQosq1FWMsG FiMjwgKIWRV0BvcDBmcRNADVhAEF97eo4ATzx+XAdz+GzHRptRfh2hzwiP+dn/mp1555 C/PqIduFrpmSrhNONQ/vCjeyMi/PY7tQqb5RQ2TJ9I458bdLpaTMYGLYIvWGg9TzBcwY haD269S+Lw8Zjr2ktgbuT2XfrGft35NlMa0s+Gtpy6jmObdur3vVAjeRqksc4WLpTe6r 8DK9kuKORxc1V1ByxASNdZuoth/drsa62PDK99mHC04evH1zL7s5KcwInGLn5ZrIMqGp B64w== X-Gm-Message-State: ANhLgQ3sbGhpFtwMXoG+sihjrdXkODJ0TDEOojpc5ZZmUAfqGZmcsCyN zY4/PjbuuJWBycxVlpYCi+6IAIt0sLsZ X-Received: by 2002:a7b:c4cc:: with SMTP id g12mr379000wmk.104.1583888971399; Tue, 10 Mar 2020 18:09:31 -0700 (PDT) Received: from ninjahost.lan (host-2-102-15-144.as13285.net. [2.102.15.144]) by smtp.googlemail.com with ESMTPSA id i6sm36658097wra.42.2020.03.10.18.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2020 18:09:31 -0700 (PDT) From: Jules Irenge To: boqun.feng@gmail.com Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski , netfilter-devel@vger.kernel.org (open list:NETFILTER), coreteam@netfilter.org (open list:NETFILTER) Subject: [PATCH 5/8] netfilter: conntrack: Add missing annotations for nf_conntrack_all_lock() and nf_conntrack_all_unlock() Date: Wed, 11 Mar 2020 01:09:05 +0000 Message-Id: <20200311010908.42366-6-jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200311010908.42366-1-jbi.octave@gmail.com> References: <0/8> <20200311010908.42366-1-jbi.octave@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 Sparse reports warnings at nf_conntrack_all_lock() and nf_conntrack_all_unlock() warning: context imbalance in nf_conntrack_all_lock() - wrong count at exit warning: context imbalance in nf_conntrack_all_unlock() - unexpected unlock Add the missing __acquires(&nf_conntrack_locks_all_lock) Add missing __releases(&nf_conntrack_locks_all_lock) Signed-off-by: Jules Irenge --- net/netfilter/nf_conntrack_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index d1305423640f..a0bc122d5df1 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -143,6 +143,7 @@ static bool nf_conntrack_double_lock(struct net *net, unsigned int h1, } static void nf_conntrack_all_lock(void) + __acquires(&nf_conntrack_locks_all_lock) { int i; @@ -162,6 +163,7 @@ static void nf_conntrack_all_lock(void) } static void nf_conntrack_all_unlock(void) + __releases(&nf_conntrack_locks_all_lock) { /* All prior stores must be complete before we clear * 'nf_conntrack_locks_all'. Otherwise nf_conntrack_lock() -- 2.24.1