diff mbox series

[v4,2/2] ext4: add journal cycled recording support

Message ID 20230317090926.4149399-3-yi.zhang@huaweicloud.com
State Superseded
Headers show
Series ext4, jbd2: journal cycled record transactions between each mount | expand

Commit Message

Zhang Yi March 17, 2023, 9:09 a.m. UTC
From: Zhang Yi <yi.zhang@huawei.com>

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>
---
 fs/ext4/super.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Jan Kara March 17, 2023, 1:01 p.m. UTC | #1
On Fri 17-03-23 17:09:26, Zhang Yi wrote:
> From: Zhang Yi <yi.zhang@huawei.com>
> 
> 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>

Looks good to me. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  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
>
diff mbox series

Patch

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);
 }