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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 2B770C2B9F4 for ; Thu, 17 Jun 2021 19:14:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 89380613CB for ; Thu, 17 Jun 2021 19:14:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89380613CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 25C476B0071; Thu, 17 Jun 2021 15:14:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 220576B0072; Thu, 17 Jun 2021 15:14:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10FBF6B0073; Thu, 17 Jun 2021 15:14:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id D685D6B0071 for ; Thu, 17 Jun 2021 15:14:33 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7D1341DE9D for ; Thu, 17 Jun 2021 19:14:33 +0000 (UTC) X-FDA: 78264167226.39.A12ED5B Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by imf13.hostedemail.com (Postfix) with ESMTP id EF865E00026C for ; Thu, 17 Jun 2021 19:14:31 +0000 (UTC) IronPort-HdrOrdr: =?us-ascii?q?A9a23=3ADNwU3K3wOMVKRJwb8Xc7oAqjBMckLtp133Aq?= =?us-ascii?q?2lEZdPU7SKKlfqyV8cjzqyWftN95YhhJ8uxoU5PufZqzz/JI3bU=3D?= X-IronPort-AV: E=Sophos;i="5.83,281,1616454000"; d="scan'208";a="385383548" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2021 21:14:29 +0200 Date: Thu, 17 Jun 2021 21:14:29 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Matthew Wilcox cc: "Darrick J. Wong" , 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) In-Reply-To: Message-ID: References: <20210617185044.GD158186@locust> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf13.hostedemail.com: domain of julia.lawall@inria.fr designates 192.134.164.104 as permitted sender) smtp.mailfrom=julia.lawall@inria.fr X-Stat-Signature: kfpgn4sfjrfsfhkdaay99r1cnkyuugqt X-Rspamd-Queue-Id: EF865E00026C X-Rspamd-Server: rspam06 X-HE-Tag: 1623957271-311972 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, 17 Jun 2021, 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); > I'm not sure that the rule would detect that now, but it could be made to do that. So this could be useful. julia