Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp423043pxj; Thu, 10 Jun 2021 04:17:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzR47vLNSbaJ7rqnywHnVA66tBMefLYmvl/QqXUo0vh2iObHm0lxZ4MHOmPYzFU/J1pG4NY X-Received: by 2002:aa7:d648:: with SMTP id v8mr4031498edr.203.1623323824877; Thu, 10 Jun 2021 04:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623323824; cv=none; d=google.com; s=arc-20160816; b=wbM3yAhidAOrtsu/d3Zk+H+MDRiKJClinwaIZcEN43gB5ZfsfgPNaj75BNo76oQfYd 8dI273ilxUx9V85oNOSfzIm1I7nU36GAzCtF61h1bVX+Fb+TjykI9Q8Na8SINqmrkNT2 UOhlgiPoymbzP5xrsF3UTu5eOtBUB2GDeGyiO8Yybs/drPGuxDCtZtyLy5tspSlzpiEv 54U42HCZTTofHj0pV4yV0kO9yWJRUOsuYViJ0D2CTCW2v6esAw9rseKRA7ClGFlIqMiV lwG+8NQC41q1ep4FJaTZLxo6hBbcLi7kv5lopIBDtq8ceo9M0viMq0MHkgbj36opkJtp yZ4Q== 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=B0TOK+al0HLqeYZhYKcNCYEMl1VMSF18EXR80jBcwcM=; b=hEcdMgZU1ZLJxnbBF0s4TRhZt0OyDk5baHrD1P8ph1OMJWkpvX1iciUwIdwvbrH8b8 acmBU7cs4jqDfdMieszXF2CPCClJ+GO2DaPOVvKcM7AOgg5s2ACgu8svIsZuuQ33mfAF 4WJuMT2kO27avQdb58o/F2bBWU3SSHxmyCeO6JkNhKi7/QnrTswyU+6z8cHtoA1t2gfs e99Fag5L7ulqlwjlMr0CeIIJunNAzDl8yjvZvjZiRGwAjfPyksaNufGK42peeEr75CZP Vw+JqWNW2cNQDeEP7McKR++9gymeHy5X4fZ6+JKMzzWc/l6nqIW155x0kuR1LvlbnDs3 r+SA== 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 r10si1975826edy.600.2021.06.10.04.16.41; Thu, 10 Jun 2021 04:17:04 -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 S229935AbhFJLRy (ORCPT + 99 others); Thu, 10 Jun 2021 07:17:54 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3940 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230175AbhFJLRt (ORCPT ); Thu, 10 Jun 2021 07:17:49 -0400 Received: from dggeme752-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G11Xv0xmNz6wtQ; Thu, 10 Jun 2021 19:12:47 +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, 10 Jun 2021 19:15:51 +0800 From: Zhang Yi To: , , , CC: , , , Subject: [RFC PATCH v4 3/8] jbd2: don't abort the journal when freeing buffers Date: Thu, 10 Jun 2021 19:24:35 +0800 Message-ID: <20210610112440.3438139-4-yi.zhang@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210610112440.3438139-1-yi.zhang@huawei.com> References: <20210610112440.3438139-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: dggems701-chm.china.huawei.com (10.3.19.178) 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 we can be sure the journal is aborted once a buffer has failed to be written back to disk, we can remove the journal abort logic in jbd2_journal_try_to_free_buffers() which was introduced in commit c044f3d8360d ("jbd2: abort journal if free a async write error metadata buffer"), because it may cost and propably is not safe. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara --- fs/jbd2/transaction.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index e8fc45fd751f..8804e126805f 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c @@ -2123,7 +2123,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)); @@ -2148,26 +2147,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.31.1