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=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 28941C433DB for ; Mon, 4 Jan 2021 10:43:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8E87E21E92 for ; Mon, 4 Jan 2021 10:43:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E87E21E92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7607C8D000B; Mon, 4 Jan 2021 05:43:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 738888D000A; Mon, 4 Jan 2021 05:43:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64EBD8D000B; Mon, 4 Jan 2021 05:43:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id 4D1678D000A for ; Mon, 4 Jan 2021 05:43:18 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1BE03180AD802 for ; Mon, 4 Jan 2021 10:43:18 +0000 (UTC) X-FDA: 77667755676.21.copy48_610ddc3274cf Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id E07B7180442C2 for ; Mon, 4 Jan 2021 10:43:17 +0000 (UTC) X-HE-Tag: copy48_610ddc3274cf X-Filterd-Recvd-Size: 6142 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Mon, 4 Jan 2021 10:43:17 +0000 (UTC) Received: by mail-il1-f172.google.com with SMTP id r17so24794825ilo.11 for ; Mon, 04 Jan 2021 02:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3l9UhkzSQuGNhhSoOB/EKfTtvl8Ybm/n2gWJAEInW68=; b=SFdzl8oXoGeZUwjzXxM0DEuVx6x2mh9u7VonItYpLnN5C6DJEAkyrfCnp/S996evCm YXmySSBSOgxradjHUyZ/ZuNuJXzBpsuvUo/fnIs1Ie7PREI3m7lHJ8uJ2dV9prp9rE8s mG0Z//pdiio5XlUsX1FHXMihbb2tTfafUbuKXhRZIbkl3/0CJhlV/g0G3d7bhekbvpAZ f0zHe2sQeNtIjIed+pj5c4WImUgTh0YFOj9C22HsUuYbnW5y3oSV22R9PC6R0Cnife3m PNnN8vJMUZMIFWEwalGD70GzkXowPB+4fRS5fuC5jtbZyre/6aUJnbeH/wj/dxl7aIaj YJvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3l9UhkzSQuGNhhSoOB/EKfTtvl8Ybm/n2gWJAEInW68=; b=fkGCanNMDqIXqPq6wlNj0kP1hrT+aMcBvoWhae4APbM8WLF8Ay9BbPIcX64737s0g4 rq+mH1/DnIPv34rmpXlXWSqKC9IxI4O5SwJGS62yLjY1sB11ExnSRrW1MjxgVTbUPOMh w0cl3+oOKCC2QTw4PfAAy/nss4qrY/5yL5E2faal/kb/yH+6Hf3XIhUieu5RQjbPZPgd uWOzD/YtplzwRQsDRWKvhCeQtGABGEwGJp1+DODGjhVPDQO1Zgkc7klG8ugWGWxMWNpL F7icX5YkRDB5HHxNs8cp3B8nZEoh8yjfbUKxwM/JF8qYmlUqTB3ue0laHWZtcOJknO38 go0Q== X-Gm-Message-State: AOAM531SUEOXKTvcB6mulKgUwgSS5hfFk34NOSBtKYgEqTW+MS74k+dM rzhTcvjuVOFRdAkksj5x33/brWnwQHmbJUv3U2A= X-Google-Smtp-Source: ABdhPJyRLGSMPviRnCBw25zlf1PIUYFkgyAVvONCYe415ftLgiibcjOVK2zvUCm3SC+BrBMWag5Jjy51CpT3lgimRiE= X-Received: by 2002:a05:6e02:102f:: with SMTP id o15mr70104237ilj.142.1609756996831; Mon, 04 Jan 2021 02:43:16 -0800 (PST) MIME-Version: 1.0 References: <20201222012131.47020-5-laoar.shao@gmail.com> <20201231030158.GB379@xsang-OptiPlex-9020> <20210101215353.GB331610@dread.disaster.area> In-Reply-To: <20210101215353.GB331610@dread.disaster.area> From: Yafang Shao Date: Mon, 4 Jan 2021 18:42:41 +0800 Message-ID: Subject: Re: [xfs] db962cd266: Assertion_failed To: Dave Chinner Cc: kernel test robot , 0day robot , "Darrick J. Wong" , Matthew Wilcox , Christoph Hellwig , Michal Hocko , David Howells , Jeff Layton , LKML , lkp@lists.01.org, Christoph Hellwig , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, linux-xfs@vger.kernel.org, Linux MM Content-Type: text/plain; charset="UTF-8" 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 Sat, Jan 2, 2021 at 5:53 AM Dave Chinner wrote: > > On Fri, Jan 01, 2021 at 05:10:49PM +0800, Yafang Shao wrote: > > On Thu, Dec 31, 2020 at 10:46 AM kernel test robot > > wrote: > ..... > > > [ 552.905799] XFS: Assertion failed: !current->journal_info, file: fs/xfs/xfs_trans.h, line: 280 > > > [ 553.104459] xfs_trans_reserve+0x225/0x320 [xfs] > > > [ 553.110556] xfs_trans_roll+0x6e/0xe0 [xfs] > > > [ 553.116134] xfs_defer_trans_roll+0x104/0x2a0 [xfs] > > > [ 553.122489] ? xfs_extent_free_create_intent+0x62/0xc0 [xfs] > > > [ 553.129780] xfs_defer_finish_noroll+0xb8/0x620 [xfs] > > > [ 553.136299] xfs_defer_finish+0x11/0xa0 [xfs] > > > [ 553.142017] xfs_itruncate_extents_flags+0x141/0x440 [xfs] > > > [ 553.149053] xfs_setattr_size+0x3da/0x480 [xfs] > > > [ 553.154939] ? setattr_prepare+0x6a/0x1e0 > > > [ 553.160250] xfs_vn_setattr+0x70/0x120 [xfs] > > > [ 553.165833] notify_change+0x364/0x500 > > > [ 553.170820] ? do_truncate+0x76/0xe0 > > > [ 553.175673] do_truncate+0x76/0xe0 > > > [ 553.180184] path_openat+0xe6c/0x10a0 > > > [ 553.184981] do_filp_open+0x91/0x100 > > > [ 553.189707] ? __check_object_size+0x136/0x160 > > > [ 553.195493] do_sys_openat2+0x20d/0x2e0 > > > [ 553.200481] do_sys_open+0x44/0x80 > > > [ 553.204926] do_syscall_64+0x33/0x40 > > > [ 553.209588] entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > > > Thanks for the report. > > > > At a first glance, it seems we should make a similar change as we did > > in xfs_trans_context_clear(). > > > > static inline void > > xfs_trans_context_set(struct xfs_trans *tp) > > { > > /* > > * We have already handed over the context via xfs_trans_context_swap(). > > */ > > if (current->journal_info) > > return; > > current->journal_info = tp; > > tp->t_pflags = memalloc_nofs_save(); > > } > > Ah, no. > > Remember how I said "split out the wrapping of transaction > context setup in xfs_trans_reserve() from > the lifting of the context setting into xfs_trans_alloc()"? > > Well, you did the former and dropped the latter out of the patch > set. > I misunderstood what you mean. > Now when a transaction rolls after xfs_trans_context_swap(), it > calls xfs_trans_reserve() and tries to do transaction context setup > work inside a transaction context that already exists. IOWs, you > need to put the patch that lifts of the context setting up into > xfs_trans_alloc() back into the patchset before adding the > current->journal functionality patch. > Sure. > Also, you need to test XFS code with CONFIG_XFS_DEBUG=y so that > asserts are actually built into the code and exercised, because this > ASSERT should have fired on the first rolling transaction that the > kernel executes... > I really forgot to enable CONFIG_XFS_DEBUG... -_-b -- Thanks Yafang