Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp140699pxj; Wed, 9 Jun 2021 19:07:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyK3YFFB6IxNT+mk8JIx2bprRhNgYFq6iAj8FBWmU/MHeblB2oUAkPRr8F97/oslr2YzUY X-Received: by 2002:a17:906:c212:: with SMTP id d18mr2330695ejz.291.1623290827394; Wed, 09 Jun 2021 19:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623290827; cv=none; d=google.com; s=arc-20160816; b=io78F6GbMJFn50r3Xv0RB65cUdc5+zCEx34SJfi2PB3m28kE+2ROo8UrSb497Zk2LF bnWYq391OaQhkCdNWR5vjf0iVitH1EWviJLXFDv/IWGqdYAMWpy8l7gNLi25iq7xrxjA HCAhYBiqEifd8cjMPJ/n3z0+w7K+76NPp8dHd1WsVJx50aOWGPMlSo1Xcj57DiEjeXRj hxm5pFiXyvuXQ4Ec+gjriGeP4ZodtKm0Nh9/YqHi+xn8cQ1v2VhmFdsKZXtgQtzZW9aR GAbCkDYooUhDJyQ/r2NElpF01wIkQmYvRdWyqIu5b2lpW+6LCbEzgk3KRoi9lBRpSBVh qvqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=vcMrYd+4y6s/rC5FP3Jz1t2TChAI2U2rKbg+WStjvik=; b=z41a5NvJerVWr/1gw82T1zIFKCevPhgLqH9kz88AVVHv1VEpS5BkFaNVcSAxZgYpsL wb6E/xisw2RHdIplhCWXTo+wyrA0wMTj8mghXFjt+bjBZqVWBmYYPhpELPKM36UEJYtK WayW2jMOpQg+bIRxuJZj5i8WPbguCuRhC8B1i5ylhYffzyHSpMXDtpwZBU1flM7mIG9Q 34likkvBtV9RBtvckCSNb2gDNU4+ReJG8tWte02LiHrMFLrpP8eK7l1753HzSD2nz+cg hkI/VJq0NokR2yagciHIrCYyF6r0rKzIjdlxRXpUSlhYxqCnXB2aKctCNgn44PdKQRy3 NrYg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f10si1181978edy.212.2021.06.09.19.06.13; Wed, 09 Jun 2021 19:07:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229507AbhFJCHL (ORCPT + 99 others); Wed, 9 Jun 2021 22:07:11 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:5363 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229937AbhFJCHK (ORCPT ); Wed, 9 Jun 2021 22:07:10 -0400 Received: from dggeme752-chm.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4G0nJd11rSz6w3X; Thu, 10 Jun 2021 10:01:21 +0800 (CST) Received: from [10.174.178.134] (10.174.178.134) by dggeme752-chm.china.huawei.com (10.3.19.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 10 Jun 2021 10:05:13 +0800 Subject: Re: [RFC PATCH v3 4/8] jbd2: remove redundant buffer io error checks To: Jan Kara CC: , , , References: <20210527135641.420514-1-yi.zhang@huawei.com> <20210527135641.420514-5-yi.zhang@huawei.com> <20210603162859.GN23647@quack2.suse.cz> From: Zhang Yi Message-ID: <8ff5d45c-8195-adf9-4bfe-87ac33e522f8@huawei.com> Date: Thu, 10 Jun 2021 10:05:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <20210603162859.GN23647@quack2.suse.cz> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.134] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggeme752-chm.china.huawei.com (10.3.19.98) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 2021/6/4 0:28, Jan Kara wrote: > 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: > Yes, I will remove it in the next iteration, thanks for the review. Thanks, Yi.