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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 5A3B2C2B9F4 for ; Thu, 17 Jun 2021 18:59:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ECEEA613E7 for ; Thu, 17 Jun 2021 18:59:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECEEA613E7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7C3D56B0070; Thu, 17 Jun 2021 14:59:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7456A6B0071; Thu, 17 Jun 2021 14:59:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B3596B0072; Thu, 17 Jun 2021 14:59:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id 238C56B0070 for ; Thu, 17 Jun 2021 14:59:36 -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 AEC9B1E06A for ; Thu, 17 Jun 2021 18:59:35 +0000 (UTC) X-FDA: 78264129510.17.CED18AE Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP id CF65A34B for ; Thu, 17 Jun 2021 18:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gzvNiGk2rCm8oNJMDP1TZX95o4bpvTRV0ZtAzkrz5V4=; b=Xec5dX7vbo296eFm+O6T5bhUbp rXqaGy2yw6LJYcU47fZeNnjNlz53w8lJK5h0CDQZFvrNOHr6/JBEBSZhfa90K8AI9OTVjeOxDSZz5 8Jh4vj265G0XbNJR9B4kzJgVwe8FzMJKfhDJ0a8/qr2YMd/0A1oQcBMHqHcpB9OROPeAGJ5FpIy+W k9b3TfAtz0sOgdqVgESY+AAU9Bnu0MSpb52TPABn1VWWHkPxwjYOh60CUVK1QwB+qG6v8LQfpe3E/ K7hD6+j+VleDgzo/XzFcUEfegBMPh8RyGqFI1wM1/RyiJKlg4T0CUReUPtf7rQ852dCwgr3ruhgAL xeJ0K/hg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltxEC-009TUE-FR; Thu, 17 Jun 2021 18:59:07 +0000 Date: Thu, 17 Jun 2021 19:59:00 +0100 From: Matthew Wilcox To: "Darrick J. Wong" 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: References: <20210617185044.GD158186@locust> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210617185044.GD158186@locust> Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Xec5dX7v; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: CF65A34B X-Stat-Signature: nwip3w6rttnnbazpn4e8a7jzwmnh1qwe X-HE-Tag: 1623956374-372535 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 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);