Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp287801rdf; Thu, 2 Nov 2023 23:58:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTz0+pboritKvVodZsaYfsnAatAbV4HEcvWdn3xpLapYGOru/wDkh1MyWIL9YmvZp/EY+r X-Received: by 2002:a05:6a20:840d:b0:180:7df:76ab with SMTP id c13-20020a056a20840d00b0018007df76abmr15862611pzd.44.1698994689795; Thu, 02 Nov 2023 23:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698994689; cv=none; d=google.com; s=arc-20160816; b=BbJJzoUoOAVYvYrLB/K0bZAe7qA36IyBTI9umwe2RPym3MyIc0XV0G9MkvhCrmX1Hj awbphXzL9YVb9u4ZwXJI0390FsP6dbX3YgC967gsxqR7cAVYl4Vr8tRfrWFYyPc59jSw rBmaWRKDph3qK0ImU02XMyynCu9Iz26wa4BZFvBEA6qdDhrbMc6wa3pHVdyVnOT8pnFG uztdjtacf9ut1CWXFK4aSwoMX0c01Nnrf77VgxrmVEht+tbqu3T7F5xB2ljZmAc26q6P 1+U6Mpcf77uL0KPkpc1ByibWZ7N52k6FsS3lN3nchVyJf3jJajjdxflgcy3xQ06n/kGi K15A== 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=HHz/cZqjGzNshUEYOiWNBcHLRD3ErzQ/xgD/FE2RFTE=; fh=FsznnDxpmef1vC1z7PHIgrdOV6pY0Temw/oyToZsikg=; b=0JS+6xonfspJCBaHZ6+WBB7FXrWlobRl4iv/3Z5Xd24jTblGCUjH1ILFGuvLG/yB6s 5tSvcQm3tlnBjpfHvBtqapTxZfGJEumaIPKm7Rrpwzud0stoMMUmul1U+SoxLf14jRdv c4AtwobNJrLUTmmGhxV40YnIzoRuplr0fw8DFrwgCDHCkUl8QHke04hZVCFcFRpNS7zz fVy0HS62woUz3a/Uh09moizMwOkMjO+7pS/rhEC1OPvu6VLTes+61zY43f95FeRWVK/O YbNSYuhQoGJwFiAMoTp/cqEg9a/vHDkp0GJOkyKpAWEpATm5NeLtUTIv/HTvcN3PqijK eSrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bq20-20020a056a02045400b005b9602a7ba3si1049887pgb.475.2023.11.02.23.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 23:58:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6121F80AB1D6; Thu, 2 Nov 2023 23:58:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232634AbjKCG6H (ORCPT + 99 others); Fri, 3 Nov 2023 02:58:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232693AbjKCG6G (ORCPT ); Fri, 3 Nov 2023 02:58:06 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10D1191 for ; Thu, 2 Nov 2023 23:58:03 -0700 (PDT) Received: from kwepemm000013.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SMBM45lrfzrTyf; Fri, 3 Nov 2023 14:54:56 +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.31; Fri, 3 Nov 2023 14:58:00 +0800 From: Zhihao Cheng To: , CC: , , Subject: [PATCH 2/5] jbd2: Replace journal state flag by checking errseq Date: Fri, 3 Nov 2023 22:52:47 +0800 Message-ID: <20231103145250.2995746-3-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231103145250.2995746-1-chengzhihao1@huawei.com> References: <20231103145250.2995746-1-chengzhihao1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.67] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm000013.china.huawei.com (7.193.23.81) X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 23:58:08 -0700 (PDT) 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 --- 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 a655d9a88f79..b60d19505f8a 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1850,7 +1850,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; } @@ -2148,12 +2148,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