From: Jan Kara My original patch (jbd-fix-bug-in-journal_commit_transaction.patch in -mm) fixing assertion failure in journal_commit_transaction() on J_ASSERT_JH(jh, jh->b_next_transaction == NULL); had one flaw in it. The fix was to refile buffers that had b_next_transaction set as that was perfectly correct situation. But __journal_refile_buffer() places all the buffers on BJ_Metadata list. As we can refile also buffers that are not jbddirty() it sometimes happened that the buffer was never marked jbddirty() and an assertion in journal_write_metadata_buffer() failed when committing the next transaction. Attached patch makes journal_refile_buffer() file buffer into BJ_Reserved list when it is not jbddirty(). IBM and one other guy seeing the problem are now testing the patch and it seems to do its job. Please put it into -mm tree for some more widespread testing. Thanks. Non-jbddirty buffers should be filed to BJ_Reserved and not BJ_Metadata list. It can actually happen that we refile such buffers during the commit phase when we reallocate in the running transaction blocks deleted in committing transaction (and that can happen if the committing transaction already wrote all the data and is just cleaning up BJ_Forget list). Signed-off-by: Jan Kara Cc: "Stephen C. Tweedie" Signed-off-by: Andrew Morton --- fs/jbd/transaction.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -puN fs/jbd/transaction.c~jbd-fix-bug-in-journal_commit_transaction-fix fs/jbd/transaction.c --- 25/fs/jbd/transaction.c~jbd-fix-bug-in-journal_commit_transaction-fix Fri Jun 2 14:14:05 2006 +++ 25-akpm/fs/jbd/transaction.c Fri Jun 2 14:14:05 2006 @@ -2038,7 +2038,8 @@ void __journal_refile_buffer(struct jour __journal_temp_unlink_buffer(jh); jh->b_transaction = jh->b_next_transaction; jh->b_next_transaction = NULL; - __journal_file_buffer(jh, jh->b_transaction, BJ_Metadata); + __journal_file_buffer(jh, jh->b_transaction, + was_dirty ? BJ_Metadata : BJ_Reserved); J_ASSERT_JH(jh, jh->b_transaction->t_state == T_RUNNING); if (was_dirty) _