ext4: add journal cycled recording support
authorZhang Yi <yi.zhang@huawei.com>
Wed, 22 Mar 2023 01:33:52 +0000 (09:33 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 26 Jun 2023 23:35:13 +0000 (19:35 -0400)
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 <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230322013353.1843306-3-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/super.c

index fcc8dad6b661b14925b046bf05e58aa4795c94d1..433550e935616a35f27a29665455fe4011a977ed 100644 (file)
@@ -5738,6 +5738,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);
 }