Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5396492rwl; Tue, 21 Mar 2023 18:35:18 -0700 (PDT) X-Google-Smtp-Source: AK7set9H56kMh3SV0TS4v4oQZ1G8+xRqpaDHQu5SLOLe9dgAh0N9DAK/VWSWDVWP2w6StFnqEiVa X-Received: by 2002:aa7:d0cc:0:b0:4fa:ba31:6c66 with SMTP id u12-20020aa7d0cc000000b004faba316c66mr5141212edo.42.1679448917866; Tue, 21 Mar 2023 18:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679448917; cv=none; d=google.com; s=arc-20160816; b=WvyT5iNFllyjl+fUsovXhzMj1AqE/8KWty7D0IIRS1dcw2+bT8F7+HarCctnh1kBHy yiJpzd677aI8s8B5w3YdhQlE/2HgQ0B3hwiQOLK+wSyJDs/bopNuFDTFoFBoXizRmjs0 YuRW8CXcv5eUIn6cDUYxoMTL82hifjqnbljbGH1fui2U0iYk4VKe8NVyIc7qxsCtFcbS jG5T1Njrs1vtLoqxh+2n80ndzkPxHd9Ns2LRELe2Vwk37isqKVNlIjrZruFxOHaiqOK+ /qtN0ubnLtL25NG6E/gbvF2FlY2ylePnYcUW2nbwdX+Umo1A3Qx2Lx/Cm0p448yYmBVE 8XvA== 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=35xkQM+1vpfBoftlZdkCkmFvpxSW9ME3PgPBs9Qb/cg=; b=Yh8cMzkTTVr9XogBLp9W+/KlAHdFvSx0GZckJwJOptqGIBkvbqUMz9tInla5EmuixO 1eVyoKyAQEiawlU+quuD/awnQPfwK8uwDA28mEg/aZiTLpFpQ+8CHdwSuf8IAc58zRZF DQUCB5HzMOmPm3rh/YuFxojq2+pz5dI1iGWPhS67Xid8PlMdyMURaBxC4pQl47IWK9DL 0ym62j1+omlebldvF8m6thVav0TPu4zonMRYzmCYk0VgQ0YzwIy8f+klQV2V1n41ADh6 O1+Ea3ZJql46yQKHHYycogsVJriOE9mTrExmN9fyJVYVhI/1wU78FOqFNDH6rGjzmAk5 j5bA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay21-20020a056402203500b004fd1ee1380fsi14829615edb.612.2023.03.21.18.34.54; Tue, 21 Mar 2023 18:35:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229666AbjCVBe1 (ORCPT + 99 others); Tue, 21 Mar 2023 21:34:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229672AbjCVBeY (ORCPT ); Tue, 21 Mar 2023 21:34:24 -0400 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F30AB303E1 for ; Tue, 21 Mar 2023 18:34:23 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4Ph9xR040wz4f3khd for ; Wed, 22 Mar 2023 09:34:19 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.170]) by APP4 (Coremail) with SMTP id gCh0CgD3X7MBWxpkVwFQFw--.12828S6; Wed, 22 Mar 2023 09:34:20 +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 2/3] ext4: add journal cycled recording support Date: Wed, 22 Mar 2023 09:33:52 +0800 Message-Id: <20230322013353.1843306-3-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230322013353.1843306-1-yi.zhang@huaweicloud.com> References: <20230322013353.1843306-1-yi.zhang@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgD3X7MBWxpkVwFQFw--.12828S6 X-Coremail-Antispam: 1UD129KBjvdXoWruFWkGFy8Cr4rAr47GFW5GFg_yoWDAFb_X3 yIyF47Xw43JF4S9a1rCa1UWr1YvFs7ur1rG34xt3sYgF1DtF4DGF4qqr92krn8WFZ5trZx Jr4xJF1Iqr9FqjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb-kFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUXwA2048vs2IY02 0Ec7CjxVAFwI0_Gr0_Xr1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM2 8EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AI xVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20x vE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xv r2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48JMxC20s 026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_ JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14 v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xva j40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JV W8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUjYiiDUUUUU== X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 From: Zhang Yi Always enable 'JBD2_CYCLE_RECORD' journal option on ext4, letting the jbd2 continue to record new journal transactions from the recovered journal head or the checkpointed transactions in the previous mount. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara --- fs/ext4/super.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 88f7b8a88c76..9b46adae241b 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5691,6 +5691,11 @@ static void ext4_init_journal_params(struct super_block *sb, journal_t *journal) journal->j_flags |= JBD2_ABORT_ON_SYNCDATA_ERR; else journal->j_flags &= ~JBD2_ABORT_ON_SYNCDATA_ERR; + /* + * Always enable journal cycle record option, letting the journal + * records log transactions continuously between each mount. + */ + journal->j_flags |= JBD2_CYCLE_RECORD; write_unlock(&journal->j_state_lock); } -- 2.31.1