Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp407338pxj; Thu, 3 Jun 2021 09:31:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhnvhfzabJa+3XAaO/cqJuZwFbYjgM/T2csYH+mquSloPe7D+JH+7WVVgGaHXibciMWqSN X-Received: by 2002:a50:ee18:: with SMTP id g24mr345303eds.11.1622737886432; Thu, 03 Jun 2021 09:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622737886; cv=none; d=google.com; s=arc-20160816; b=eFz3Dn0/gs8UEjQ9YFi8PvQ7PEwQPCunDB2X908vWd4PT1TzoEU280C4p/gznoGIMA hyVLwHxG3UcZJpvQaxsdV682XYlZ2qyZhjqk2wsER1p10P1jPQQ9MxzalUmPIPEjquND 2qWVBDL7SB8WKDtNvNoVXdoLUHp9dEV1zOqnwmYoR5gG42iEz+xpYHgvVqm94oYuVPgG 4ezBPs1tpAIsWGrhWLjboqwquPr2xIbcp3FO3XxZ6mln4x3jICCdo1+PglZgScJSfU7C Fz7WCtlkajkFsTYJF32gAotnXJCkKDRr8qc/wSFrXs7rbMhKe0/EK0aGvk4eFUoO/d5I 2StQ== 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 :dkim-signature:dkim-signature; bh=r3b5V6hWqhRifzETnYFu5TUec6aWRDq9Hi/WRpJibP0=; b=tt1peTU4pOMtXFLIcxoqrZRYMP5DXJV2IbfOANVQEMCjleDbM0ih5vIpMb1W2K1fzJ yBdS59mH08qh1Srs4rJtCsE+kFLXXCuGC5SkIC/bxKsF6nHU11BYWBRgd6DXeQ0+HSQj A/TjNB9Y7E9HeBRcdle9CUutq8StTxds67m7rQ91OVCNtT5wJNmgoYOGvdX0p/qYhQqA WFDLX3OyALqlR4tB4RKpW8vYEOMLwBfA00ZCDsYaVPWXJe29cHMFKNKM2lWKHvIS44r/ 8z4c2DVsOIjONPCVtCglcFvPfmkTJKQj8in4XWCC2Ciwyn4yuBI1CcctMeNmOcKugpIA drXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="PbbZ/SvJ"; dkim=neutral (no key) header.i=@suse.cz; 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 y25si3008744ejb.210.2021.06.03.09.30.59; Thu, 03 Jun 2021 09:31:26 -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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="PbbZ/SvJ"; dkim=neutral (no key) header.i=@suse.cz; 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 S229695AbhFCQap (ORCPT + 99 others); Thu, 3 Jun 2021 12:30:45 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:43864 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229656AbhFCQap (ORCPT ); Thu, 3 Jun 2021 12:30:45 -0400 Received: from relay2.suse.de (unknown [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id BBFD21FD4E; Thu, 3 Jun 2021 16:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1622737739; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=r3b5V6hWqhRifzETnYFu5TUec6aWRDq9Hi/WRpJibP0=; b=PbbZ/SvJJfimU7g6J1jLXqQe1R+ENrdYQcTMR0Thvcypul34VW7e4cHlDYBQa9laAm7MK3 mAIBek86lDvyxog+KS4JgidNIRM6i5jCfYxs0HaP1V+ai7TttbImNX8oW6CpYEzd9JgyOn uEEm26z7XpOIXSr8bLJDqwg7+sayclw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1622737739; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=r3b5V6hWqhRifzETnYFu5TUec6aWRDq9Hi/WRpJibP0=; b=VP3Z6VUPpd6Xt4zf6r9B9RRqpCuohh+AWmuQJYZ9FKjhAz87CZpQyBkZK3Uha0PtBiOoIp 1NgRgc4T+CdBKWAA== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id AF51DA3B85; Thu, 3 Jun 2021 16:28:59 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 8A50F1F2C96; Thu, 3 Jun 2021 18:28:59 +0200 (CEST) Date: Thu, 3 Jun 2021 18:28:59 +0200 From: Jan Kara To: Zhang Yi Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, yukuai3@huawei.com Subject: Re: [RFC PATCH v3 4/8] jbd2: remove redundant buffer io error checks Message-ID: <20210603162859.GN23647@quack2.suse.cz> References: <20210527135641.420514-1-yi.zhang@huawei.com> <20210527135641.420514-5-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210527135641.420514-5-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 Thu 27-05-21 21:56:37, Zhang Yi wrote: > Now that __jbd2_journal_remove_checkpoint() can detect buffer io error > and mark journal checkpoint error, then we abort the journal later > before updating log tail to ensure the filesystem works consistently. > So we could remove other redundant buffer io error checkes. > > Signed-off-by: Zhang Yi > --- > fs/jbd2/checkpoint.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c > index 2cbac0e3cff3..c1f746a5cc1a 100644 > --- a/fs/jbd2/checkpoint.c > +++ b/fs/jbd2/checkpoint.c > @@ -91,8 +91,7 @@ static int __try_to_free_cp_buf(struct journal_head *jh) > int ret = 0; > struct buffer_head *bh = jh2bh(jh); > > - if (jh->b_transaction == NULL && !buffer_locked(bh) && > - !buffer_dirty(bh) && !buffer_write_io_error(bh)) { > + if (!jh->b_transaction && !buffer_locked(bh) && !buffer_dirty(bh)) { > JBUFFER_TRACE(jh, "remove from checkpoint list"); > ret = __jbd2_journal_remove_checkpoint(jh) + 1; > } > @@ -295,8 +294,6 @@ int jbd2_log_do_checkpoint(journal_t *journal) > goto restart; > } > if (!buffer_dirty(bh)) { > - if (unlikely(buffer_write_io_error(bh)) && !result) > - result = -EIO; > BUFFER_TRACE(bh, "remove from checkpoint"); > if (__jbd2_journal_remove_checkpoint(jh)) > /* The transaction was released; we're done */ > @@ -356,8 +353,6 @@ int jbd2_log_do_checkpoint(journal_t *journal) > spin_lock(&journal->j_list_lock); > goto restart2; > } > - if (unlikely(buffer_write_io_error(bh)) && !result) > - result = -EIO; > > /* > * Now in whatever state the buffer currently is, we You can also drop: if (result < 0) jbd2_journal_abort(journal, result); in jbd2_log_do_checkpoint() as there's now nothing which can set 'result' in the loops... Otherwise looks good. Feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR