Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3038639ybv; Mon, 24 Feb 2020 16:55:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwLiSrTKSic2HAd5JYk/zQWIAGtcJEoDjL2SVotwPau/MtRxmpxO6lpOdgdtaWaidS3I1pm X-Received: by 2002:a9d:2ae5:: with SMTP id e92mr42203787otb.72.1582592121243; Mon, 24 Feb 2020 16:55:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582592121; cv=none; d=google.com; s=arc-20160816; b=hHtSPycP8e8mVoddonSVZmt4MlgR7ZVZGwOxpr4t5L6POjYSmfVnTL5iF3AGcq5TND HykZKRPxOqAyOM+8oXxROELmslxdu4Z5BYYizHfUBp/ooZdqBA/8dQotzjIqdOgoqmVv Qgv/VmptYF8XDcxMjH8k8jxIkSazUg0Oee6uP124qYr1uCAC9pKJpKyr5hYZI4FAIQKx cOW5ZTan9NaZsdsTwykiv/F6fwj1Mbx1suuDsU41W+hCBk4ZJ6I+whN3feJvDp1jwDmZ llktYVCdz54dV0iwp8KavFQR+UY+KiEMOnhyg7dWZ6y7Ve60gMmaxH03/GI67MqlGBQD CtuQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=0NGM4jutCjVL98f4uoH4LzdzDgYjo10vMilXkpX1qeA=; b=xbTlmUus5ReQeP2Btoi4dELuUcAU5Bqb3QGEEYs3jvwcTzvkbbGQ7rubQrzEPyVtfq JmiMRMJqqJxBHegsjJ5MGc1OSXIJkP7BfR59ffcFXOMQIGYI7Svg1YDqRw/5Z+ubqgc5 VbyIcOulxnGxwkbIb1dktaIHwoxk8gilb84ZyQTSyhbPpPgizSHc6pj9nkPiVLmdUjeS 69W6fJgqrLp0MTR3ge6N1n25LLwCkBkBEi1TJ37p1LMAjx6RnyVQqOZr0IQHBIc6BD6O 2szSmtDvP1Q2GF+i5P5cMJ6cTxJmPie55Mx72A7vITZWG4+u5uAtvIn/qEyhR9B4KiNq 46vg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x138si5839608oif.142.2020.02.24.16.55.07; Mon, 24 Feb 2020 16:55:21 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728541AbgBYAxZ (ORCPT + 99 others); Mon, 24 Feb 2020 19:53:25 -0500 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:56571 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727696AbgBYAxZ (ORCPT ); Mon, 24 Feb 2020 19:53:25 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04452;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0Tqr7D9j_1582592002; Received: from JosephdeMacBook-Pro.local(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0Tqr7D9j_1582592002) by smtp.aliyun-inc.com(127.0.0.1); Tue, 25 Feb 2020 08:53:22 +0800 Subject: Re: [PATCH] ocfs2: Add missing annotations for ocfs2_refcount_cache_lock() and ocfs2_refcount_cache_unlock() To: Jules Irenge , boqun.feng@gmail.com Cc: joseph.qi@linux.alibab.com, Mark Fasheh , Joel Becker , "moderated list:ORACLE CLUSTER FILESYSTEM 2 (OCFS2)" , open list , Andrew Morton References: <20200224204130.18178-1-jbi.octave@gmail.com> From: Joseph Qi Message-ID: <0f1b869e-080a-2785-e4c1-01f308f246bb@linux.alibaba.com> Date: Tue, 25 Feb 2020 08:53:21 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200224204130.18178-1-jbi.octave@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/2/25 04:41, Jules Irenge wrote: > Sparse reports warnings at ocfs2_refcount_cache_lock() > and ocfs2_refcount_cache_unlock() > > warning: context imbalance in ocfs2_refcount_cache_lock() > - wrong count at exit > warning: context imbalance in ocfs2_refcount_cache_unlock() > - unexpected unlock > > The root cause is the missing annotation at ocfs2_refcount_cache_lock() > and at ocfs2_refcount_cache_unlock() > > Add the missing __acquires(&rf->rf_lock) annotation > to ocfs2_refcount_cache_lock() > Add the missing __releases(&rf->rf_lock) annotation > to ocfs2_refcount_cache_unlock() > > Signed-off-by: Jules Irenge Acked-by: Joseph Qi > --- > fs/ocfs2/refcounttree.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c > index ee43e51188be..da99c80f49da 100644 > --- a/fs/ocfs2/refcounttree.c > +++ b/fs/ocfs2/refcounttree.c > @@ -154,6 +154,7 @@ ocfs2_refcount_cache_get_super(struct ocfs2_caching_info *ci) > } > > static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci) > + __acquires(&rf->rf_lock) > { > struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci); > > @@ -161,6 +162,7 @@ static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci) > } > > static void ocfs2_refcount_cache_unlock(struct ocfs2_caching_info *ci) > + __releases(&rf->rf_lock) > { > struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci); > >