Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp426385pxy; Wed, 21 Apr 2021 06:25:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqdbjQ2bega+gBF2NTrTt8RrA0Yrk7V/TQ9H6DGr0O+cGUyqzVCP7G84T4djX2Dv5CMYun X-Received: by 2002:a63:aa48:: with SMTP id x8mr21957919pgo.246.1619011542643; Wed, 21 Apr 2021 06:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619011542; cv=none; d=google.com; s=arc-20160816; b=ucy4k+KeM68DV8OU1OxXcrJVogHjHWNdWQOrX1HJUmbVX/mkR7EAteHvQTCiT8vMNj aapuev67Du9XS2XWIIGCFxhhKQKXB/VozJDbia4tl26271E7TL5KbF+b+MaLE3CmVeGb axiDqjIn/D1k1pK+dc94FHqT2c+Oo9McYcJNiguZvYPUKvMP7+/+xYiz7HCRszC3u+ql kByoU1j4OaZLlnFu+c86xpm5KzxDiELn/ndWXooiyCbFSl2JnSuNY1azay/2KagR+q9o Z2ZEPidZLrii93WnG+R6GTPUWIRPHqunN6Zfv4BbWBMLyJtcvlC7u0Ov6Xi3d+1c70sZ BJZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=jKQvZoYyqiMc+cdSXZgUzGRpZD/Yz8UVMVsekH+NO4g=; b=NgT1Q+ZqEGVzj7VAHU65GhzQbPMtis/QSilvg927PCjr2VLQrFTyiYin4O/Zk0b1fe s+4G45yNzAVWAaSdT1dquMkOkFLrtuoVhK3lwCh10TRt433m5ZUp31N0I/dspNFxSCPq hubhx0lvzD0Z9DCwlrKo14NVjp/B3ywIT/uUsTTHOhHA+k201E0IhJXQ9DhSreJLTekT fFAe6CAmvhExwUvlhpzhotINfYPvC/jk5bwCKGNrz+PZZsEZPPvv0R11rH+B8RMRCz4m TbbeTaOIYkMNRYg4mp/3ZTDXkSPw3TWZ+Sr79yGnfNZPzpiKaxykJwtFgx4PWabAtd4+ yJSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si2688936pgf.338.2021.04.21.06.25.30; Wed, 21 Apr 2021 06:25:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241647AbhDUNZU (ORCPT + 99 others); Wed, 21 Apr 2021 09:25:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:34740 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242963AbhDUNY3 (ORCPT ); Wed, 21 Apr 2021 09:24:29 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 65F22B1DE; Wed, 21 Apr 2021 13:23:55 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id B14331F2B69; Wed, 21 Apr 2021 15:23:54 +0200 (CEST) Date: Wed, 21 Apr 2021 15:23:54 +0200 From: Jan Kara To: Zhang Yi Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, yukuai3@huawei.com Subject: Re: [RFC PATCH v2 3/7] jbd2: don't abort the journal when freeing buffers Message-ID: <20210421132354.GS8706@quack2.suse.cz> References: <20210414134737.2366971-1-yi.zhang@huawei.com> <20210414134737.2366971-4-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210414134737.2366971-4-yi.zhang@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed 14-04-21 21:47:33, Zhang Yi wrote: > Now, we can make sure to abort the journal once the original buffer was ^^ Now that we can be sure the journal is aborted once a buffer has failed to be written back to disk, ... > failed to write back to disk, we can remove the journal abort logic in > jbd2_journal_try_to_free_buffers() which was introduced in > ("jbd2: abort journal if free a async write error > metadata buffer"), because it may costs and propably not safe. ^^ cost ^^ probably is > Signed-off-by: Zhang Yi Looks good. You can add: Reviewed-by: Jan Kara Honza > --- > fs/jbd2/transaction.c | 17 ----------------- > 1 file changed, 17 deletions(-) > > diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c > index 9396666b7314..3e0db4953fe4 100644 > --- a/fs/jbd2/transaction.c > +++ b/fs/jbd2/transaction.c > @@ -2118,7 +2118,6 @@ int jbd2_journal_try_to_free_buffers(journal_t *journal, struct page *page) > { > struct buffer_head *head; > struct buffer_head *bh; > - bool has_write_io_error = false; > int ret = 0; > > J_ASSERT(PageLocked(page)); > @@ -2143,26 +2142,10 @@ int jbd2_journal_try_to_free_buffers(journal_t *journal, struct page *page) > jbd2_journal_put_journal_head(jh); > if (buffer_jbd(bh)) > goto busy; > - > - /* > - * If we free a metadata buffer which has been failed to > - * write out, the jbd2 checkpoint procedure will not detect > - * this failure and may lead to filesystem inconsistency > - * after cleanup journal tail. > - */ > - if (buffer_write_io_error(bh)) { > - pr_err("JBD2: Error while async write back metadata bh %llu.", > - (unsigned long long)bh->b_blocknr); > - has_write_io_error = true; > - } > } while ((bh = bh->b_this_page) != head); > > ret = try_to_free_buffers(page); > - > busy: > - if (has_write_io_error) > - jbd2_journal_abort(journal, -EIO); > - > return ret; > } > > -- > 2.25.4 > -- Jan Kara SUSE Labs, CR