Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp46678pxb; Wed, 14 Apr 2021 09:06:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqUYpg09unkTjtHmZAIFHfOb2j1aPRMiLbuqavd0VRXNoTYw65MYJyvcbqG7qOSalCbmq8 X-Received: by 2002:a63:fb12:: with SMTP id o18mr37364821pgh.438.1618416387457; Wed, 14 Apr 2021 09:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618416387; cv=none; d=google.com; s=arc-20160816; b=0iNESQA6FjoNBvvAaqpq+Qqr/zqsryScQGOuaZlB7RO6ofcV2YpF9tFFKNCrkPjvno NJNhNDEdc5lHV0AJhGIiq8iPWQJ0Wur6ojhqNWZEGezq/EZ/h0IrcLVSaRdwhceDSOlW tsyHgaFmEj+mgqjmoymIdBdgbVxFYVrzKOJiXRHLgw56RTQgCE7k4EFjUSHytxOnvzHE aBa2lAp/6ZdwwJNR/pl3W+V5vsGt+FEk8obwQhkY2LD4gcNrGSNmhwFU0AqxJgOW9xBn CG7pcCwgiaNf/3V5+gVyX8oMT2U9IYUKnurEj6vsbl0UrgNvBUvx045NfmIbfthtXd3J mVVQ== 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=Mr9Z7+PAmiz6lvtRfQX4/RrURvPmDndV6G8GtCKCUes=; b=ItAcEtxnP6St60CGtc7h7gkzRK/Kai2v3YkLhOLxORwjMMTAjrniAXjEDMIJUmzrDS Z69rc0WPGNDdwT/1NBoAO30C8fdI3jr/l+UTRDH4Rsu/Sj+cs/io/kDu5W464KtCUWDk C7jNi0H+PANiLYBkIUNQ9U739DwZT05hP3iQi+Jl2HTDIN6ZB1qP5YG3RpnHnsgr5+yW PPdFRF8NOjlMttCBXPOwSfYPSD9iK1Jk2PttC28tWDXFA2+9h/khFiKU+wtzEBUS6pR9 7MyYWaXpFX4f7E6ZUUKqll42rTaXJyDG2w2UQ7kWIfj5GFwb2NHgQBj8v1ix/S9SrQqv 4Xkg== 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 u2si52807plh.174.2021.04.14.09.06.13; Wed, 14 Apr 2021 09:06:27 -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 S1351422AbhDNNkL (ORCPT + 99 others); Wed, 14 Apr 2021 09:40:11 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:16918 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351446AbhDNNkJ (ORCPT ); Wed, 14 Apr 2021 09:40:09 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FL3SV0VWQzjZS5; Wed, 14 Apr 2021 21:37:46 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Wed, 14 Apr 2021 21:39:27 +0800 From: Zhang Yi To: CC: , , , , , Subject: [RFC PATCH v2 3/7] jbd2: don't abort the journal when freeing buffers Date: Wed, 14 Apr 2021 21:47:33 +0800 Message-ID: <20210414134737.2366971-4-yi.zhang@huawei.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210414134737.2366971-1-yi.zhang@huawei.com> References: <20210414134737.2366971-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-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Now, we can make sure to abort the journal once the original buffer was 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. Signed-off-by: Zhang Yi --- 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