Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1896313ybv; Sun, 23 Feb 2020 17:53:22 -0800 (PST) X-Google-Smtp-Source: APXvYqxMXYSYepbCVIh7WcLeFMgH6bcfKgmL2kuj48FR/i0EGtihx9cCQco8LpQseLzmeDDmhPvA X-Received: by 2002:aca:be57:: with SMTP id o84mr11053921oif.138.1582509201893; Sun, 23 Feb 2020 17:53:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582509201; cv=none; d=google.com; s=arc-20160816; b=PB3d1BnMjaf4D7Ti9PXogA1djebT4HihwGyhKBmCx7r4jLgJrTJxSLS3OgiPVXyEWj uOtn5EAg6PutfhFGYLGL4HSxROwwW2aq00D4XXIT8u1eg2WMQG4foTlcbaAJutGsC2Fn 4ham5Z7czGGf2Z7H8X/scjbWRjtGH1ga1SmWPrluLKhJ0WX3NHxQU4FS1ovP4rblbsbu gdT3m1XatCsJhU1DugFvh8+CcwkmOiYk1qadDFuspkckuf7bK01+7H/JSEi9P8hSEW3h a4TbNSS3xRAasdN1Bl0zsF8h/+ye5DnvTdGy5inoJgIpwD6hjJyGmpaYIkJfKafhWmnY 9tGg== 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=bePtqkOtN8bWwToVFpsa47O9n3CjlFSsJncktXr4Drw=; b=Oi/reOneBlUqriLXfFGjNIbiWL0+DkNs3gxBNARLykgaYuF+PWwn8r81qpNsDP8LyB M40fJbTy0KxNV36ORL7RJ016u2+89Wk86nQ3O8Tw+fdWUZKFaIYxB/3EllRCJu4l1TF3 RmkGIa/9XhmFmhWik4lfs6LtKjiO6+XhKheayE+oCdhvzy4sh+orj18BqhdZfr/Oc8YF T+V1ANf15uJlmEpbjBzweQcKvoHSpW/rB5amqcIkWRahY0arXS91avSokWYhGvg091ng kVa+Zxd/FvoEVjEKU3Iu+bXfmIb4Yf1EmOgO5j5LdDtUByWnm4tED4KhTfl2fkU4mQ9x er1g== 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 d125si3963704oia.86.2020.02.23.17.53.09; Sun, 23 Feb 2020 17:53: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 S1727177AbgBXBwn (ORCPT + 99 others); Sun, 23 Feb 2020 20:52:43 -0500 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:46942 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727151AbgBXBwn (ORCPT ); Sun, 23 Feb 2020 20:52:43 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04428;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0TqhdyQQ_1582509160; Received: from JosephdeMacBook-Pro.local(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0TqhdyQQ_1582509160) by smtp.aliyun-inc.com(127.0.0.1); Mon, 24 Feb 2020 09:52:40 +0800 Subject: Re: [PATCH 30/30] sgi-xp: Add missing annotation for ocfs2_inode_cache_lock() and ocfs2_inode_cache_unlock() To: Jules Irenge , boqun.feng@gmail.com Cc: linux-kernel@vger.kernel.org, Mark Fasheh , Joel Becker , "moderated list:ORACLE CLUSTER FILESYSTEM 2 (OCFS2)" , Andrew Morton References: <0/30> <20200223231711.157699-1-jbi.octave@gmail.com> <20200223231711.157699-31-jbi.octave@gmail.com> From: Joseph Qi Message-ID: Date: Mon, 24 Feb 2020 09:52:39 +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: <20200223231711.157699-31-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/24 07:17, Jules Irenge wrote: > Sparse reports a warning at ocfs2_inode_cache_lock() > and ocfs2_inode_cache_unlock() > warning: context imbalance in ocfs2_inode_cache_lock() > - wrong count at exit > > warning: context imbalance in ocfs2_inode_cache_unlock() > - unexpected unlock > The root cause is a missing annotation at ocfs2_inode_cache_lock() > and at ocfs2_inode_cache_unlock() > > Add the missing __acquires(&oi->ip_lock) annotation > Add the missing __releases(&oi->ip_lock) annotation > > Signed-off-by: Jules Irenge Looks good. BTW, there are another co_cache_[lock|unlock] implementations also miss the annotations: ocfs2_refcount_cache_lock ocfs2_refcount_cache_unlock So could we add the missing annotations as well? Thanks, Joseph > --- > fs/ocfs2/inode.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c > index 7c9dfd50c1c1..0b87e0a63ab9 100644 > --- a/fs/ocfs2/inode.c > +++ b/fs/ocfs2/inode.c > @@ -1623,6 +1623,7 @@ static struct super_block *ocfs2_inode_cache_get_super(struct ocfs2_caching_info > } > > static void ocfs2_inode_cache_lock(struct ocfs2_caching_info *ci) > + __acquires(&oi->ip_lock) > { > struct ocfs2_inode_info *oi = cache_info_to_inode(ci); > > @@ -1630,6 +1631,7 @@ static void ocfs2_inode_cache_lock(struct ocfs2_caching_info *ci) > } > > static void ocfs2_inode_cache_unlock(struct ocfs2_caching_info *ci) > + __releases(&oi->ip_lock) > { > struct ocfs2_inode_info *oi = cache_info_to_inode(ci); > >