Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp34009ybh; Tue, 10 Mar 2020 18:42:17 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu0pGJQ22aumVN4AyO6r5YT2c9FNrVXfjzmiJ+Vk5/x0DZburRxsSPDAWZFonq98be0BIoB X-Received: by 2002:aca:ded4:: with SMTP id v203mr383572oig.19.1583890937435; Tue, 10 Mar 2020 18:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583890937; cv=none; d=google.com; s=arc-20160816; b=06maav7lP5A9KWxUn4DVe1NXJVlTd21KnXzQubIlNxFFnHGq9P9gpD/OGSzCuODD9L eoWb9XF0ME35ZPYoPlhQ7rpIm1K/zw6DF3iRYjG4Ke+Z0LQe3rmgDswjJ3lGuHb+6awl OPxdbBjOtipO6H1FbMO2vPqbw+9fqFoGrzV574PtzgqOYF3efPiONXOUBCPKcLQBJcpA pYNk7/44zrUXT0P7uaNnRaJApUgB20q9fahVU+/BuKyMgZSaCLaMtT4O3ZiOSYrkLTck G3uI5FD6sL8Nn3ivjHDQWEWB1reOMnYWUMqwRCHHfx7te00Kl5uxy5DY/+p/HxUD7vPJ Jj/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:date:from:dkim-signature; bh=AFzWa9AtXFLGIfoMPoJK6d5wfqfho8/Wj5PljPDOXn0=; b=bfU4i7oLmbJ+IK+foJrp8oieracyR355ISj1qY6TmxVH5n62eJhoAp6CMWmDw2xEbF 98vjT0BdIMqhHkrdOSiLpPhHZqNrl5wWiv/oo2Ns94sR/yCYvbaa+k5vKFt3n2/4IxQd g2UdqgNPEI1Ulu2oDk9H/jEXWVk26Khm0Plk5/8AKLZ5OeJkeWL06pN0gTPoqtKFU7+6 WYqWcUD+x3F6S5XWFHzlSKjrZGKOgCDFMh/934IcWP6WNWomhIYYOuTz8gqZCLTkBpOL OoO5yXd+Aio/RS3Q24vxS2aoMfKxLbEc3Z5Dcu/ADXcaNTUy6qz6ipHttlr6dXHSuBnx K0WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Eb8DoaMt; 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 t3si309425oig.25.2020.03.10.18.42.05; Tue, 10 Mar 2020 18:42:17 -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=Eb8DoaMt; 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 S1727744AbgCKBk7 (ORCPT + 99 others); Tue, 10 Mar 2020 21:40:59 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35958 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727484AbgCKBk6 (ORCPT ); Tue, 10 Mar 2020 21:40:58 -0400 Received: by mail-wm1-f65.google.com with SMTP id g62so351077wme.1; Tue, 10 Mar 2020 18:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=AFzWa9AtXFLGIfoMPoJK6d5wfqfho8/Wj5PljPDOXn0=; b=Eb8DoaMtU5ZDMN3aXl+rooK4nC4/8oKVRnqHuvpGBrNcv3iwWZlTZlHDPvfyGZxdC+ QgxC6UkYzdh2PzToUODgu1xeKLl5Pv+5r5RZO0q0zzBgQ9ebjwJg102FoahafrfdwEr+ reHIm9KVkZ/1jGb2hUDghsBkI5zAeDoucHdC6z2Oi8T8Swl//It0jAn8GjEH5R5pcOgd TK+o0d7LkuF7pt4GIyPWRDyv2lAAXoRZvQWayYSDeABb+YmRa5E0TYYu1J9MBjxh3esu XMHgiL4EBnhr/EVOug8RGSpd1NqK0ffNYqHyM0gjHJCrfkkEMTI+yxl/OXAis24Adpw0 u4AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=AFzWa9AtXFLGIfoMPoJK6d5wfqfho8/Wj5PljPDOXn0=; b=fxfGKGXIzq4m6RhOfnWIgtsNX8l76aEm4iz0oFgPjZvb3OEHP76b941ZyZs25IiaJK IFr8NoxNL0rCUvtgFWmZuEfzN4zVO+cpUwgyWoXkLRRFm+mCc/Go4iaOIkD5/560mYmm GJ1/SZHjDFR+aIAjOUOCnyJK6zNK2zR7cLBGmoVNvXgNq1yzhtHWi+9L8Dku7wEWKO0D qsBDsBsP4FiWeIcUbdthBT6XKW0MznYJ9mvy7rTIrRKrPYWQerVn2wxjSw9J9SBqNUjJ /UgW5S9NcZX9Igv8rgdD4kZ6WjtnF1lZuHK2AhFNoHUo8iY7P8Fax4/HfMWa+SUShS6C SQkQ== X-Gm-Message-State: ANhLgQ1E3kF41DhmZcrxFETtFxT24CBsVEy0IyA1tOqe0XLf338kVCKA n+d5EuxAt0Z0Cnj59Ev3iA== X-Received: by 2002:a05:600c:2:: with SMTP id g2mr586617wmc.18.1583890854648; Tue, 10 Mar 2020 18:40:54 -0700 (PDT) Received: from ninjahub.lan (host-2-102-15-144.as13285.net. [2.102.15.144]) by smtp.gmail.com with ESMTPSA id m11sm21774262wrn.92.2020.03.10.18.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2020 18:40:54 -0700 (PDT) From: Jules Irenge X-Google-Original-From: Jules Irenge Date: Wed, 11 Mar 2020 01:40:46 +0000 (GMT) To: Eric Dumazet cc: Jules Irenge , boqun.feng@gmail.com, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski Subject: Re: [PATCH 2/8] raw: Add missing annotations to raw_seq_start() and raw_seq_stop() In-Reply-To: Message-ID: References: <0/8> <20200311010908.42366-1-jbi.octave@gmail.com> <20200311010908.42366-3-jbi.octave@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Mar 2020, Eric Dumazet wrote: > > > On 3/10/20 6:09 PM, Jules Irenge wrote: > > 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) > > I dunno, h variable is not yet defined/declared at this point, > this looks weird. > > > { > > 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)); > > > > > Thanks for the feedback, I think h is a pointer of type struct raw_hashinfo, in which member lock is initialized on line number 89. Kind regards