Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1274727lfc; Wed, 1 Jun 2022 13:52:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzscVGVJlreQ4CrC6JhvsIj05tP2IvuiXtN6EkXp5NVLjM85xNW/b/CtXdMtbBWxtUEhrG6 X-Received: by 2002:a17:90b:4b0a:b0:1e3:1823:ca9f with SMTP id lx10-20020a17090b4b0a00b001e31823ca9fmr15743025pjb.12.1654116755062; Wed, 01 Jun 2022 13:52:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654116755; cv=none; d=google.com; s=arc-20160816; b=AOrkD2HXeobbzYFieQfNpNpF1/nDz2YjoKO4Ox78pjRt1d1P4L33A+iTB7CkIKB4Ad plgjYo0M7v/aAvFOfT+q0nQVKV/0DyOg+IRlAuqgFsV1B4b14qvrbmFPMFSZcgNAZuoz hM0fJ8FIMP+CmpPcPvd+VpIqSRXuFO2pNZFG4uO+3/HutSSnbec9UlQeWUGSpHHlWOAo 3h/b5p5RQcOi7IvF1LA+Z31nQL/74/Iu3CdwZwXOkQAMramtXGZPqaG7MdapGZq6tZbQ aQmjQcwOKJeNAMsYCtdB7weB6CPKt26P4RwNSRdN8TgQs1SN9EaBAvz3tI9z2DNrGHC/ pMUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fTxdM4FSLoudm9qNGxkHMxJHzf43vLhFwNmW/rU7VTA=; b=GMXMjnORRMGojupgtnqGSUlEExqJtNxxYx2fX8CDGqD+vCjlCbBMl+A1FjcQgyW+nB +U9XQFfMMNMYVaM7WH3ihrV6o/8BF38Ck4+ZjTjo3AdDbrVGovfKvQWm0sJP6YDRb/0V vhZz1kSWufJiGI+0FoWWv7h+T3DPS1Nd2+ulXa85Yxqae7+3TgOvi+Qrbp3KSyUGAE5Z S5tinNSJ/CIjXTbpt/AUSozRwY31d6R+5sLHRW1s+gBZtuFghkllYnav4xxMo9jEBXEA +LJ1doEm8YKxow3DLvc+HupmED2BLw8YZQnylRswlMn6a7xMIVIYQ2DrIMLPza4W0alM iV4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=KMkCQvG7; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q36-20020a17090a4fa700b001cac1e802d5si3329255pjh.82.2022.06.01.13.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:52:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=KMkCQvG7; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 69BD72AD5C0; Wed, 1 Jun 2022 12:55:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345758AbiEaPjo (ORCPT + 99 others); Tue, 31 May 2022 11:39:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242627AbiEaPjm (ORCPT ); Tue, 31 May 2022 11:39:42 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F6CC8BD18; Tue, 31 May 2022 08:39:41 -0700 (PDT) Received: from cwcc.thunk.org (pool-108-7-220-252.bstnma.fios.verizon.net [108.7.220.252]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 24VFdFJH004068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 May 2022 11:39:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1654011558; bh=fTxdM4FSLoudm9qNGxkHMxJHzf43vLhFwNmW/rU7VTA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=KMkCQvG7tjlVWymzZpN13bzwSnBHf6sP9CXk0af4AXfcYb40gq0W3IadVs0L/CfZk 2W4S3DE2bNZHFbaRO3Kmj9txctBWNYjtjPg2RGCvsLE0CGmjZ8f8RZdRkyAFVz3nZP nTFnKXlwqga67Yu6w0lk+LGYh3cVk/vD6Vdms22aJds9K0X2q64a0ONQBsgg00hwl2 Jfr2UIk8D8Q2V494kj3hXJZlv7sTBHTc0kJeTt7WrUiO+ORAN0S+SwROLrssrtS/so anbbVYx6N5W0qTz+Pjwgf30dETyvvFJrIT/5lf5r6iUPvATZCJtAxkowqCZNFWr6fY mFjYMTQYQuXyA== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 36EBF15C3E1F; Tue, 31 May 2022 11:39:15 -0400 (EDT) Date: Tue, 31 May 2022 11:39:15 -0400 From: "Theodore Ts'o" To: Donald Buczek Cc: Jan Kara , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, it+linux@molgen.mpg.de, Linux Kernel Mailing List Subject: Re: ext4_writepages: jbd2_start: 5120 pages, ino 11; err -5 Message-ID: References: <4e83fb26-4d4a-d482-640c-8104973b7ebf@molgen.mpg.de> <20220531103834.vhscyk3yzsocorco@quack3.lan> <3bfd0ad9-d378-9631-310f-0a1a80d8e482@molgen.mpg.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3bfd0ad9-d378-9631-310f-0a1a80d8e482@molgen.mpg.de> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hmmm..... I think this patch should fix your issues. If the journal has been aborted (which happens as part of the shutdown, we will never write out the commit block --- so it should be fine to skip the writeback of any dirty inodes in data=ordered mode. BTW, if you know that the file system is going to get nuked in this way all the time, so you never care about file system after it is shut down, you could mount the file system with the mount option data=writeback. - Ted diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 8ff4c6545a49..2e18211121f6 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -542,7 +542,10 @@ static int ext4_journalled_submit_inode_data_buffers(struct jbd2_inode *jinode) static int ext4_journal_submit_inode_data_buffers(struct jbd2_inode *jinode) { int ret; + journal_t *journal = EXT4_SB(jinode->i_vfs_inode->i_sb)->s_journal; + if (!journal || is_journal_aborted(journal)) + return 0; if (ext4_should_journal_data(jinode->i_vfs_inode)) ret = ext4_journalled_submit_inode_data_buffers(jinode); else @@ -554,7 +557,10 @@ static int ext4_journal_submit_inode_data_buffers(struct jbd2_inode *jinode) static int ext4_journal_finish_inode_data_buffers(struct jbd2_inode *jinode) { int ret = 0; + journal_t *journal = EXT4_SB(jinode->i_vfs_inode->i_sb)->s_journal; + if (!journal || is_journal_aborted(journal)) + return 0; if (!ext4_should_journal_data(jinode->i_vfs_inode)) ret = jbd2_journal_finish_inode_data_buffers(jinode);