aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/commit.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jbd2/commit.c')
-rw-r--r--fs/jbd2/commit.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index a8173081f831..4d99685fdce4 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -520,22 +520,6 @@ void jbd2_journal_commit_transaction(journal_t *journal)
520 jbd_debug (3, "JBD: commit phase 2\n"); 520 jbd_debug (3, "JBD: commit phase 2\n");
521 521
522 /* 522 /*
523 * First, drop modified flag: all accesses to the buffers
524 * will be tracked for a new trasaction only -bzzz
525 */
526 spin_lock(&journal->j_list_lock);
527 if (commit_transaction->t_buffers) {
528 new_jh = jh = commit_transaction->t_buffers->b_tnext;
529 do {
530 J_ASSERT_JH(new_jh, new_jh->b_modified == 1 ||
531 new_jh->b_modified == 0);
532 new_jh->b_modified = 0;
533 new_jh = new_jh->b_tnext;
534 } while (new_jh != jh);
535 }
536 spin_unlock(&journal->j_list_lock);
537
538 /*
539 * Now start flushing things to disk, in the order they appear 523 * Now start flushing things to disk, in the order they appear
540 * on the transaction lists. Data blocks go first. 524 * on the transaction lists. Data blocks go first.
541 */ 525 */
@@ -576,7 +560,9 @@ void jbd2_journal_commit_transaction(journal_t *journal)
576 * transaction! Now comes the tricky part: we need to write out 560 * transaction! Now comes the tricky part: we need to write out
577 * metadata. Loop over the transaction's entire buffer list: 561 * metadata. Loop over the transaction's entire buffer list:
578 */ 562 */
563 spin_lock(&journal->j_state_lock);
579 commit_transaction->t_state = T_COMMIT; 564 commit_transaction->t_state = T_COMMIT;
565 spin_unlock(&journal->j_state_lock);
580 566
581 stats.u.run.rs_logging = jiffies; 567 stats.u.run.rs_logging = jiffies;
582 stats.u.run.rs_flushing = jbd2_time_diff(stats.u.run.rs_flushing, 568 stats.u.run.rs_flushing = jbd2_time_diff(stats.u.run.rs_flushing,
@@ -584,6 +570,9 @@ void jbd2_journal_commit_transaction(journal_t *journal)
584 stats.u.run.rs_blocks = commit_transaction->t_outstanding_credits; 570 stats.u.run.rs_blocks = commit_transaction->t_outstanding_credits;
585 stats.u.run.rs_blocks_logged = 0; 571 stats.u.run.rs_blocks_logged = 0;
586 572
573 J_ASSERT(commit_transaction->t_nr_buffers <=
574 commit_transaction->t_outstanding_credits);
575
587 descriptor = NULL; 576 descriptor = NULL;
588 bufs = 0; 577 bufs = 0;
589 while (commit_transaction->t_buffers) { 578 while (commit_transaction->t_buffers) {