Commit 376fd482 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] jbd: fix ordered-data writeout logic

There's some nasty code in commit which deals with a lock ranking problem. 
Currently if it fails to get the lock when and local variable `bufs' is zero
we forget to write out some ordered-data buffers.  So a subsequent
crash+recovery could yield stale data in existing files.

Fix it by correctly restarting the t_sync_datalist search.
parent 7176142a
...@@ -262,8 +262,7 @@ void journal_commit_transaction(journal_t *journal) ...@@ -262,8 +262,7 @@ void journal_commit_transaction(journal_t *journal)
if (!jbd_trylock_bh_state(bh)) { if (!jbd_trylock_bh_state(bh)) {
spin_unlock(&journal->j_list_lock); spin_unlock(&journal->j_list_lock);
schedule(); schedule();
spin_lock(&journal->j_list_lock); goto write_out_data;
break;
} }
__journal_unfile_buffer(jh); __journal_unfile_buffer(jh);
jh->b_transaction = NULL; jh->b_transaction = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment