Re: Bug#252391: kernel-source-2.6.6: Assertion failure injournal_flush() ... "!journal->j_running_transaction"

From: Andrew Morton
Date: Thu Jun 03 2004 - 23:34:21 EST


Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:
>
> Andrew, what's stopping a journal_start() from setting j_running_transaction
> just before the last spin_lock(&journal->j_state_lock) that guards the
> J_ASSERT that was hit below?

Not much, it appears. I'll queue the below for post-2.6.7.


--- 25/fs/ext3/super.c~ext3-journal_flush-needs-journal_lock_updates 2004-06-03 21:15:57.911628872 -0700
+++ 25-akpm/fs/ext3/super.c 2004-06-03 21:15:57.916628112 -0700
@@ -1907,13 +1907,17 @@ static void ext3_commit_super (struct su
static void ext3_mark_recovery_complete(struct super_block * sb,
struct ext3_super_block * es)
{
- journal_flush(EXT3_SB(sb)->s_journal);
+ journal_t *journal = EXT3_SB(sb)->s_journal;
+
+ journal_lock_updates(journal);
+ journal_flush(journal);
if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER) &&
sb->s_flags & MS_RDONLY) {
EXT3_CLEAR_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER);
sb->s_dirt = 0;
ext3_commit_super(sb, es, 1);
}
+ journal_unlock_updates(journal);
}

/*
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/