]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: fix minor errors in journal handling
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 8 Sep 2014 23:12:48 +0000 (16:12 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 11 Sep 2014 20:45:42 +0000 (16:45 -0400)
The journal superblock's s_sequence field seems to track the tid of
the tail (oldest) transaction in the log.  Therefore, when we release
the journal, set the s_sequence to the tail_sequence, because setting
it to the transaction_sequence means that we're setting the tid to
that of the head of the log.  Granted, for replay these two are
usually the same (and s_start == 0 anyway) so thus far we've gotten
lucky and nobody noticed.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/journal.c

index d12e3176b1c23d727517af3354efda04bc2f609e..6119cda6c441c3b18ccc93848bb933228f1348bf 100644 (file)
@@ -769,7 +769,7 @@ static void e2fsck_journal_release(e2fsck_t ctx, journal_t *journal,
                mark_buffer_clean(journal->j_sb_buffer);
        else if (!(ctx->options & E2F_OPT_READONLY)) {
                jsb = journal->j_superblock;
-               jsb->s_sequence = htonl(journal->j_transaction_sequence);
+               jsb->s_sequence = htonl(journal->j_tail_sequence);
                if (reset)
                        jsb->s_start = 0; /* this marks the journal as empty */
                e2fsck_journal_sb_csum_set(journal, jsb);