diff options
Diffstat (limited to 'fs/jbd/commit.c')
-rw-r--r-- | fs/jbd/commit.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index f2b9a571f4cf..9d31e6a39205 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c | |||
@@ -298,6 +298,7 @@ void journal_commit_transaction(journal_t *journal) | |||
298 | int tag_flag; | 298 | int tag_flag; |
299 | int i; | 299 | int i; |
300 | struct blk_plug plug; | 300 | struct blk_plug plug; |
301 | int write_op = WRITE; | ||
301 | 302 | ||
302 | /* | 303 | /* |
303 | * First job: lock down the current transaction and wait for | 304 | * First job: lock down the current transaction and wait for |
@@ -413,13 +414,16 @@ void journal_commit_transaction(journal_t *journal) | |||
413 | 414 | ||
414 | jbd_debug (3, "JBD: commit phase 2\n"); | 415 | jbd_debug (3, "JBD: commit phase 2\n"); |
415 | 416 | ||
417 | if (tid_geq(journal->j_commit_waited, commit_transaction->t_tid)) | ||
418 | write_op = WRITE_SYNC; | ||
419 | |||
416 | /* | 420 | /* |
417 | * Now start flushing things to disk, in the order they appear | 421 | * Now start flushing things to disk, in the order they appear |
418 | * on the transaction lists. Data blocks go first. | 422 | * on the transaction lists. Data blocks go first. |
419 | */ | 423 | */ |
420 | blk_start_plug(&plug); | 424 | blk_start_plug(&plug); |
421 | err = journal_submit_data_buffers(journal, commit_transaction, | 425 | err = journal_submit_data_buffers(journal, commit_transaction, |
422 | WRITE_SYNC); | 426 | write_op); |
423 | blk_finish_plug(&plug); | 427 | blk_finish_plug(&plug); |
424 | 428 | ||
425 | /* | 429 | /* |
@@ -478,7 +482,7 @@ void journal_commit_transaction(journal_t *journal) | |||
478 | 482 | ||
479 | blk_start_plug(&plug); | 483 | blk_start_plug(&plug); |
480 | 484 | ||
481 | journal_write_revoke_records(journal, commit_transaction, WRITE_SYNC); | 485 | journal_write_revoke_records(journal, commit_transaction, write_op); |
482 | 486 | ||
483 | /* | 487 | /* |
484 | * If we found any dirty or locked buffers, then we should have | 488 | * If we found any dirty or locked buffers, then we should have |
@@ -649,7 +653,7 @@ start_journal_io: | |||
649 | clear_buffer_dirty(bh); | 653 | clear_buffer_dirty(bh); |
650 | set_buffer_uptodate(bh); | 654 | set_buffer_uptodate(bh); |
651 | bh->b_end_io = journal_end_buffer_io_sync; | 655 | bh->b_end_io = journal_end_buffer_io_sync; |
652 | submit_bh(WRITE_SYNC, bh); | 656 | submit_bh(write_op, bh); |
653 | } | 657 | } |
654 | cond_resched(); | 658 | cond_resched(); |
655 | 659 | ||