Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp11725ybh; Tue, 10 Mar 2020 18:10:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs9JdQVN9KSn7gxeG1tjfTk4Qh0pM2hkn4l9HNNbHFHd9EtVeHawHpbba3kk2YckEnt6WYJ X-Received: by 2002:a9d:69d7:: with SMTP id v23mr446933oto.40.1583889019338; Tue, 10 Mar 2020 18:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583889019; cv=none; d=google.com; s=arc-20160816; b=xy4l9WzIQwZkkVlVOkGfn044ALcO+JOHdvxDBOVHo7DqlJqXkKacpqxKXc/5cvATSp MTOamnzUfV71k/8UVOAJyAIwq8lZ9QP/O4iAc4iWqMegFmCv+255dbp/8Kg3HXccakXC 2YqLvehemW19uvVnqpKOAvyLps09D3pv9VI2BfEHs/qp6hQZQyY6hjDbj6Q5BYneUQW9 c9EqfVfjeo5djbq1E8Gj2yqT1uWjiHsq/L0ZKO+AYicydfDcMXV9y6I4CHtQZWoRvWUG 3jReACsHlNIx+HDe8rAD0w1mpXilu/49fRGmjpqAsguqITHE4uDHOVWJzEziWDCn09d7 QzuQ== 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=qNOlzK/j2ABuDiTQyPDlyVcS7soeVQMuTQgrAWWcf9I=; b=T7t6dT2kJzcnl65PdXkanGkxAoGvfV9h01yBGfDC4LIJdwIFEVFdrZLR27f8VoR+85 t0l+LTzL5Jsuq03MBlHAzpUzKwSET7ZkRSeEK37/LPiGnIX8SJl76WSiatsQ1GXeX0EZ i87visLb+6DgN7nWI9voCn76F9lpB+oNd/QrImkvnl/XCqvr/cbD2cSK3aEiyETJfJUQ LjZn0TqEUJppVbe8lhaSI5NI+ZIJsCeyaqjEk0iHOpkrOUD2snIijwlB+UbbnG8dJZim MPZ202v1+yiPf00BbM/PvBTJvCSxATclQyl+/uiksOCZqg72o6gUziZZWJP0ZvhLpZf+ P+TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rgwYt8hQ; 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 a7si294832oia.120.2020.03.10.18.10.00; Tue, 10 Mar 2020 18:10:19 -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=rgwYt8hQ; 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 S1727952AbgCKBJd (ORCPT + 99 others); Tue, 10 Mar 2020 21:09:33 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53151 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726463AbgCKBJb (ORCPT ); Tue, 10 Mar 2020 21:09:31 -0400 Received: by mail-wm1-f67.google.com with SMTP id 11so290509wmo.2; Tue, 10 Mar 2020 18:09:27 -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=qNOlzK/j2ABuDiTQyPDlyVcS7soeVQMuTQgrAWWcf9I=; b=rgwYt8hQrRtJDhPqL6acSbVwj/ifctSn0OpICmzrNnRH811aS44QXkIK0YtQwU7F5L V771hlOItZjHjl77Kw1rboEs1OxQEIH7/6KCMqUaqzeyAkHMox3zNhiQbBQfMs6Bg1Bn paqYACEq4IdQ1pCsXEsK/pnJGvzCyidgzQl1AkzPSt36fj3wl231L636qb4RDEtHgFyG 56qYR2bST/BXbOV0+THwtrfBnS64s9rNpql8Nr04Rsa6NEJa6lBdhmKibjg/oNFH787L A3iDpPqrVCzsEjTH/19w3Y30JcTgee1BKiy4AOJwm1Cpbx4NRvUdu+U4CYazW6B6dvkd KKtw== 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=qNOlzK/j2ABuDiTQyPDlyVcS7soeVQMuTQgrAWWcf9I=; b=gkd1RL2TxXg+TQgwG/GWg9l/W7tcBxV360BnPYrTfi78ri6OWEiUvRZE25PYMxX1P1 gX1LrFFo/wLD4ueS+9wRQpsB0QRiqWa+LipO/ydPL1zFKVPsXRGha87uW01j5rmKhPM0 voBPt24kLSPWwUd8uBAEPGBxNxBwbnXHFwZgwX292aOcGhPCDFQLIQA1t7afNyi1iVDJ Mj4KhdwKrEbgXFT8Q6XP5c03Q9/B1jTQvvNXnBcrZhdJe69p2hRyjz4OabpQK0XzPLGf 00khDMGRyUVGPpC3x3L+lCn87O9l8IRI28Ddu5JerNS2iOynZd6NxAKraKfMA6YRwMnW riTA== X-Gm-Message-State: ANhLgQ1E5iMWz+TKVUEYXyYkmQ6lU/HDhtFMHK4PnYOUu9E/Tf7k7I+5 JnpzwfoAZP4nwYedqdz7YA== X-Received: by 2002:a05:600c:280b:: with SMTP id m11mr415679wmb.93.1583888967050; Tue, 10 Mar 2020 18:09:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2020 18:09:26 -0700 (PDT) From: Jules Irenge To: boqun.feng@gmail.com Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski Subject: [PATCH 2/8] raw: Add missing annotations to raw_seq_start() and raw_seq_stop() Date: Wed, 11 Mar 2020 01:09:02 +0000 Message-Id: <20200311010908.42366-3-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 raw_seq_start() and raw_seq_stop() warning: context imbalance in raw_seq_start() - wrong count at exit warning: context imbalance in raw_seq_stop() - unexpected unlock The root cause is the missing annotations at raw_seq_start() and raw_seq_stop() Add the missing __acquires(&h->lock) annotation Add the missing __releases(&h->lock) annotation Signed-off-by: Jules Irenge --- net/ipv4/raw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 3183413ebc6c..47665919048f 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -1034,6 +1034,7 @@ static struct sock *raw_get_idx(struct seq_file *seq, loff_t pos) } void *raw_seq_start(struct seq_file *seq, loff_t *pos) + __acquires(&h->lock) { struct raw_hashinfo *h = PDE_DATA(file_inode(seq->file)); @@ -1056,6 +1057,7 @@ void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos) EXPORT_SYMBOL_GPL(raw_seq_next); void raw_seq_stop(struct seq_file *seq, void *v) + __releases(&h->lock) { struct raw_hashinfo *h = PDE_DATA(file_inode(seq->file)); -- 2.24.1