Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp563879pxj; Thu, 27 May 2021 06:48:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLigiSwrcaz3JuT7tRgjOQ9TCfBqVW9UalRAXL0qp2TJvlIjDP5nd++GRf16vj5Hudo2Rw X-Received: by 2002:a92:700a:: with SMTP id l10mr3007618ilc.44.1622123308539; Thu, 27 May 2021 06:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622123308; cv=none; d=google.com; s=arc-20160816; b=q79ibQx3IWDRPIGgiwr4kxY+ywpbuibEC3kOkib8X1YFIXYS3BTHIdHvCGuhYrVGXn eyYQR/eI6ZnRO4ACB51POfIgyQ00ShxMq4mveBqjnJWpFRdNGD59puTIgCT5NlnRRRPi GeshQe9uTwqprcHc23RIQ1d7lS2kjHG291/8LPrIfiVZKpE8DihrCOXSyphw7PoomnG+ OSNLGCDCWBJ46ZfaSMjzbaEecIhjQZqOJlNr7zoaF5LdJ5l/VV5VeWJhx0XFxVKPqOAl x7PSt/9lkdRYnjcjN+YfF0wGke8LvZSXJJ6dS8OsbrcF/GqWlEN/TD7tfldYwR3m0BNh tRfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=prUDNR3a9kRiptmewz+ZIoXi0pVGuLvyBTwM4ZyghvM=; b=A8idBg2KLrKlCBuU47fT1fbUcKOoheXiGy0IN0jD2RtTN/Vb9KOoImme0uo+LQCoyH OlxS5HgL6bpalJh+CiddDd0tY+aDRXPK1tVPsubkLaS1Tqh+2xBI5eDfSpzYFmdtGu+j bNW9B8/JMfDdwmuCZRMJ6296BtFm0bUKsm5IrXckx3cjYlqjJO8RIyF3YcJQBU8kQYUr Jmv9EF6W5H7dV+YwSMIuVD3UlnyIeMneUGgs8ZopjCagOEGOqcTmbPmBrj3HSpA+DyXC PUXoJdsZBN0yXDW5CGEn4H8n8+SHYmYBj/CVg2XMI4rqxxt6dn9uj4RDrIMhn/wa9aPd Voaw== 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 w31si2400657jal.77.2021.05.27.06.48.15; Thu, 27 May 2021 06:48:28 -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 S236602AbhE0NtA (ORCPT + 99 others); Thu, 27 May 2021 09:49:00 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:2065 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236605AbhE0Nsz (ORCPT ); Thu, 27 May 2021 09:48:55 -0400 Received: from dggeme752-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FrTXM3Fp4zWp36; Thu, 27 May 2021 21:42:43 +0800 (CST) Received: from huawei.com (10.175.127.227) 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, 27 May 2021 21:47:18 +0800 From: Zhang Yi To: CC: , , , , Subject: [RFC PATCH v3 4/8] jbd2: remove redundant buffer io error checks Date: Thu, 27 May 2021 21:56:37 +0800 Message-ID: <20210527135641.420514-5-yi.zhang@huawei.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210527135641.420514-1-yi.zhang@huawei.com> References: <20210527135641.420514-1-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] 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 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 -- 2.25.4