Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5038301rdb; Tue, 12 Dec 2023 17:52:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFL8yhyI1+ZxbzJv3obE26a7+eRLHJoEdAEW1ydApc4klRaekx0f9CFMsyHAvHz1CAKMAN/ X-Received: by 2002:a0d:c386:0:b0:5d7:1940:b386 with SMTP id f128-20020a0dc386000000b005d71940b386mr6066329ywd.82.1702432348587; Tue, 12 Dec 2023 17:52:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702432348; cv=none; d=google.com; s=arc-20160816; b=Tr2XE5zqeBXMwUosvhWEZx05y1J49DSTYQAbmPIHQ7iHQ34WAKgX1rU8HxmJs7n+Am kNmj4lX8V3nA1Xya/EWldcrXGVuvhXWTC49TaZOZjJEXmFZMrOLrG1eBp08t5T+EHsYy coRjZOHktVRkCOdgz+p5gveSPCTqnJQBxUqiis4dhYQN4ToQQPF3bZdIvEi1U2u56S8M 75DfHe/5qb+j7L6sKWG4DKNctSDsijC7CpCHN84TwkwlD6p4s7WDqgpng8fYOIWS/4zk hetKU9hGLBzVSRstjKbKTWSAnaOJCkw23OFDhWlaXdenulbTUpjSTqSyk5WnAWSkjwaT 5gxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=vkVTCe1dUcKnHIXSRIwHDFk3Xj9tLqSfCxOtwlJFZ6Y=; fh=1ocxhdHf0Y/iI8w2wCrH9lkxpX+94NXA0fnSi498MuY=; b=PJZ5CoyCZOJDyFhNn2NLXP6IqozgFe9oqmmIpFl00sWNIpNBl0KT+SPBdDOniGD5yU TM6EbwhC+pDI1V1HMS9jhBLjwzItUemj/hG8nnk/7ol/iujx4WBESU0lZzdZCAdCHeRf vBxBpHfOoUfQKOISpe7F/YDd0mo+jNxDP42xqpa+HonO1U80wdh5QhxJNAxmNtJWD0SV 2jgVRgCg4kOSJ6c84QDqVVv1qV2JNeUBFgalFhNhmAQ3g1ShiE0xaIsDo9vtIS4ZGeiS +XrVWk0EdGSyMfry/nGnMqQRkFy3kNts3o2a1axrv8EM9UB5bF5KLD2plMWAOLaFFQJw ugzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-420-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-420-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e12-20020a170902ed8c00b001d33c7ff093si1604877plj.585.2023.12.12.17.52.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 17:52:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-420-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-420-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-420-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 57E95282490 for ; Wed, 13 Dec 2023 01:52:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5504915A7; Wed, 13 Dec 2023 01:52:22 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DD09AD for ; Tue, 12 Dec 2023 17:52:18 -0800 (PST) Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4SqdK15tHCz1kvB1; Wed, 13 Dec 2023 09:32:53 +0800 (CST) Received: from kwepemm000013.china.huawei.com (unknown [7.193.23.81]) by mail.maildlp.com (Postfix) with ESMTPS id C0B2B1800DD; Wed, 13 Dec 2023 09:34:00 +0800 (CST) Received: from huawei.com (10.175.104.67) by kwepemm000013.china.huawei.com (7.193.23.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 13 Dec 2023 09:33:58 +0800 From: Zhihao Cheng To: , CC: , Subject: [PATCH v2 2/5] jbd2: Replace journal state flag by checking errseq Date: Wed, 13 Dec 2023 09:32:21 +0800 Message-ID: <20231213013224.2100050-3-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231213013224.2100050-1-chengzhihao1@huawei.com> References: <20231213013224.2100050-1-chengzhihao1@huawei.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm000013.china.huawei.com (7.193.23.81) Now JBD2 detects metadata writeback error of fs dev according to errseq. Replace journal state flag by checking errseq. Signed-off-by: Zhihao Cheng Suggested-by: Jan Kara Reviewed-by: Jan Kara --- fs/jbd2/journal.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 559938a82379..b6c114c11b97 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1862,7 +1862,7 @@ int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid, if (is_journal_aborted(journal)) return -EIO; - if (test_bit(JBD2_CHECKPOINT_IO_ERROR, &journal->j_atomic_flags)) { + if (jbd2_check_fs_dev_write_error(journal)) { jbd2_journal_abort(journal, -EIO); return -EIO; } @@ -2160,12 +2160,12 @@ int jbd2_journal_destroy(journal_t *journal) /* * OK, all checkpoint transactions have been checked, now check the - * write out io error flag and abort the journal if some buffer failed - * to write back to the original location, otherwise the filesystem - * may become inconsistent. + * writeback errseq of fs dev and abort the journal if some buffer + * failed to write back to the original location, otherwise the + * filesystem may become inconsistent. */ if (!is_journal_aborted(journal) && - test_bit(JBD2_CHECKPOINT_IO_ERROR, &journal->j_atomic_flags)) + jbd2_check_fs_dev_write_error(journal)) jbd2_journal_abort(journal, -EIO); if (journal->j_sb_buffer) { -- 2.39.2