• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 003125b2f00aed8f0a1d8b5bd80fcbb1e8e2f13e Mon Sep 17 00:00:00 2001
2From: zhanchengbin <zhanchengbin1@huawei.com>
3Date: Thu, 4 Aug 2022 18:33:39 +0800
4Subject: [PATCH] tune2fs: do not change j_tail_sequence in journal superblock
5
6The function recover_ext3_journal() in debugfs/journal.c, if the log
7replay is over, the j_tail_sequence in journal superblock is not
8changed to the value of the last transaction sequence.  This will
9cause subsequent log commitids to count from the commitid in last
10time.  After tune2fs -e, the log commitid is counted from the commitid
11in last time, if the log ID of the current operation overlaps with
12that of the last operation, this will cause logs that were previously
13replayed by tune2fs to be replayed here.
14
15Signed-off-by: zhanchengbin <zhanchengbin1@huawei.com>
16Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
17Signed-off-by: liangyun <liangyun2@huawei.com>
18Signed-off-by: Theodore Ts'o <tytso@mit.edu>
19---
20 debugfs/journal.c | 2 ++
21 1 file changed, 2 insertions(+)
22
23diff --git a/debugfs/journal.c b/debugfs/journal.c
24index 095fff00..5bac0d3b 100644
25--- a/debugfs/journal.c
26+++ b/debugfs/journal.c
27@@ -769,6 +769,8 @@ static errcode_t recover_ext3_journal(ext2_filsys fs)
28 		mark_buffer_dirty(journal->j_sb_buffer);
29 	}
30
31+	journal->j_tail_sequence = journal->j_transaction_sequence;
32+
33 errout:
34 	jbd2_journal_destroy_revoke(journal);
35 	jbd2_journal_destroy_revoke_record_cache();
36--
372.37.1
38
39