From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B45DC6FD20 for ; Wed, 22 Mar 2023 01:34:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229735AbjCVBeZ (ORCPT ); Tue, 21 Mar 2023 21:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjCVBeX (ORCPT ); Tue, 21 Mar 2023 21:34:23 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C81152E0F2 for ; Tue, 21 Mar 2023 18:34:22 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Ph9xQ4dZrz4f3wYT for ; Wed, 22 Mar 2023 09:34:18 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.170]) by APP4 (Coremail) with SMTP id gCh0CgD3X7MBWxpkVwFQFw--.12828S4; Wed, 22 Mar 2023 09:34:18 +0800 (CST) From: Zhang Yi To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, yi.zhang@huawei.com, yi.zhang@huaweicloud.com, yukuai3@huawei.com Subject: [PATCH v5 0/3] ext4, jbd2: journal cycled record transactions between each mount Date: Wed, 22 Mar 2023 09:33:50 +0800 Message-Id: <20230322013353.1843306-1-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgD3X7MBWxpkVwFQFw--.12828S4 X-Coremail-Antisp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reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Zhang Yi v4->v5: - Update doc about journal superblock in journal.rst. v3->v4: - Remove journal_cycle_record mount option, always enable it on ext4. v2->v3: - Prevent warning if mount old image with journal_cycle_record enabled. - Limit this mount option into ext4 iamge only. v1->v2: - Fix the format type warning. - Add more check of journal_cycle_record mount options in remount. Hello! This patch set add a new journal option 'JBD2_CYCLE_RECORD' and always enable on ext4. It saves journal head for a clean unmounted file system in the journal super block, which could let us record journal transactions between each mount continuously. It could help us to do journal backtrack and find root cause from a corrupted filesystem. Current filesystem's corruption analysis is difficult and less useful information, especially on the real products. It is useful to some extent, especially for the cases of doing fuzzy tests and deploy in some shout-runing products. I've sent out the corresponding e2fsprogs part v2 separately[1], all of these have done below test cases and also passed xfstests in auto mode. - Mount a filesystem with empty journal. - Mount a filesystem with journal ended in an unrecovered complete transaction. - Mount a filesystem with journal ended in an incomplete transaction. - Mount a corrupted filesystem with out of bound journal s_head. - Mount old filesystem without journal s_head set. Any comments are welcome. [1] https://lore.kernel.org/linux-ext4/20230317091716.4150992-1-yi.zhang@huaweicloud.com Thanks! Yi. v4: https://lore.kernel.org/linux-ext4/20230317090926.4149399-1-yi.zhang@huaweicloud.com/ v3: https://lore.kernel.org/linux-ext4/20230314140522.3266591-1-yi.zhang@huaweicloud.com/ v2: https://lore.kernel.org/linux-ext4/20230202142224.3679549-1-yi.zhang@huawei.com/ v1: https://lore.kernel.org/linux-ext4/20230119034600.3431194-3-yi.zhang@huaweicloud.com/ Zhang Yi (3): jbd2: continue to record log between each mount ext4: add journal cycled recording support ext4: update doc about journal superblock description Documentation/filesystems/ext4/journal.rst | 7 ++++++- fs/ext4/super.c | 5 +++++ fs/jbd2/journal.c | 18 ++++++++++++++++-- fs/jbd2/recovery.c | 22 +++++++++++++++++----- include/linux/jbd2.h | 9 +++++++-- 5 files changed, 51 insertions(+), 10 deletions(-) -- 2.31.1