From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A7AAC2B9F4 for ; Thu, 17 Jun 2021 19:08:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F1BE0613CB for ; Thu, 17 Jun 2021 19:08:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F1BE0613CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8911C6B0070; Thu, 17 Jun 2021 15:08:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 841106B0071; Thu, 17 Jun 2021 15:08:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E2896B0072; Thu, 17 Jun 2021 15:08:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 36E026B0070 for ; Thu, 17 Jun 2021 15:08:53 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D06F01D5F1 for ; Thu, 17 Jun 2021 19:08:52 +0000 (UTC) X-FDA: 78264152904.17.FD72E06 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf17.hostedemail.com (Postfix) with ESMTP id 1872641AD7A8 for ; Thu, 17 Jun 2021 19:08:51 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 0661F60FE9; Thu, 17 Jun 2021 19:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623956930; bh=aFgLTfohwFHCIJ8e12BhbWXreDZIPMQH8qp5Wf3LfFQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rnbYQsIKFp5rJvPNcG9vQ0MBXqmuXJFWe2oAxXI8+Tsd7rD+jpVCjyBDbUt5kl+Zm swuV7aPiodRbXvN1bDmoipwtWEC/KOPCTptcP65mfzt8Wi9ZTm6hXWGd78ekc1BIH9 27qMaPiY13YTUcqkrwMlHPGh4vtt/N0Q1r02Un42fyE6yxp8Pgvz+yDLA9YKOjQnLV PcvgiyjdblMJ8jv2OSEeXGyj0MGt8sDzD/XvUV4EZ/UX3a+KRUURGD/YuSHvHAxE8c eZNjTltgywvKSeLGXFmIH7fG63OfvAA97rVb7rv88A9medQtKcWzjwQTjKb0Ve12pz yCew8bk1jG5BA== Date: Thu, 17 Jun 2021 12:08:49 -0700 From: "Darrick J. Wong" To: Matthew Wilcox Cc: Julia Lawall , Dave Chinner , kbuild-all@lists.01.org, Linux Memory Management List , Chandan Babu R , Allison Henderson Subject: Re: [kbuild-all] [linux-next:master 6373/10489] fs/xfs/xfs_log_cil.c:897:1-10: second lock on line 900 (fwd) Message-ID: <20210617190849.GE158232@locust> References: <20210617185044.GD158186@locust> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=rnbYQsIK; spf=pass (imf17.hostedemail.com: domain of djwong@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=djwong@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 1872641AD7A8 X-Stat-Signature: hi1i6spp4cfnmmh6taiidag3czi14cgz X-HE-Tag: 1623956931-891022 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jun 17, 2021 at 07:59:00PM +0100, Matthew Wilcox wrote: > On Thu, Jun 17, 2021 at 11:50:44AM -0700, Darrick J. Wong wrote: > > On Thu, Jun 17, 2021 at 08:28:24PM +0200, Julia Lawall wrote: > > > cocci warnings: (new ones prefixed by >>) > > > >> fs/xfs/xfs_log_cil.c:897:1-10: second lock on line 900 > > > > > > 5fd9256ce156ef Dave Chinner 2021-06-03 891 /* > > > 5fd9256ce156ef Dave Chinner 2021-06-03 892 * If the checkpoint spans multiple iclogs, wait for all previous > > > cb1acb3f324636 Dave Chinner 2021-06-04 893 * iclogs to complete before we submit the commit_iclog. In this case, > > > cb1acb3f324636 Dave Chinner 2021-06-04 894 * the commit_iclog write needs to issue a pre-flush so that the > > > cb1acb3f324636 Dave Chinner 2021-06-04 895 * ordering is correctly preserved down to stable storage. > > > 5fd9256ce156ef Dave Chinner 2021-06-03 896 */ > > > 5fd9256ce156ef Dave Chinner 2021-06-03 @897 spin_lock(&log->l_icloglock); > > > cb1acb3f324636 Dave Chinner 2021-06-04 898 if (ctx->start_lsn != commit_lsn) { > > > 5fd9256ce156ef Dave Chinner 2021-06-03 899 xlog_wait_on_iclog(commit_iclog->ic_prev); > > > cb1acb3f324636 Dave Chinner 2021-06-04 @900 spin_lock(&log->l_icloglock); > > > > xlog_wait_on_commit drops l_icloglock, either directly or via xlog_wait. > > It looks odd (perhaps there should be a comment?) but at least in theory > > the functions are annotated so I guess that means the static checking > > doesn't know that commit_iclog->ic_log == log? > > I think it's hard for a tool to reach into fs/xfs/xfs_log.c and look for > the __releases annotation on the definition of xlog_wait_on_commit(). > Should we also annotate the prototype in fs/xfs/xfs_log_priv.h ? > > For example, > > void wbc_attach_and_unlock_inode(struct writeback_control *wbc, > struct inode *inode) > __releases(&inode->i_lock); That depends on whether or not amending the declaration in that manner actually satisfies the checking tool? Ah, I see, __releases is a macro that only expands to anything if __CHECKER__, which is probably why the actual checker tool doesn't see this, and possibly why gcc can't complain about the mismatch between declaration and definition. --D