aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/jbd2/commit.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 7c068c189d80..d6aeb1f6cfe0 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -701,6 +701,16 @@ start_journal_io:
701 } 701 }
702 } 702 }
703 703
704 err = journal_finish_inode_data_buffers(journal, commit_transaction);
705 if (err) {
706 printk(KERN_WARNING
707 "JBD2: Detected IO errors while flushing file data "
708 "on %s\n", journal->j_devname);
709 if (journal->j_flags & JBD2_ABORT_ON_SYNCDATA_ERR)
710 jbd2_journal_abort(journal, err);
711 err = 0;
712 }
713
704 /* 714 /*
705 * If the journal is not located on the file system device, 715 * If the journal is not located on the file system device,
706 * then we must flush the file system device before we issue 716 * then we must flush the file system device before we issue
@@ -719,19 +729,6 @@ start_journal_io:
719 &cbh, crc32_sum); 729 &cbh, crc32_sum);
720 if (err) 730 if (err)
721 __jbd2_journal_abort_hard(journal); 731 __jbd2_journal_abort_hard(journal);
722 if (journal->j_flags & JBD2_BARRIER)
723 blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL,
724 BLKDEV_IFL_WAIT);
725 }
726
727 err = journal_finish_inode_data_buffers(journal, commit_transaction);
728 if (err) {
729 printk(KERN_WARNING
730 "JBD2: Detected IO errors while flushing file data "
731 "on %s\n", journal->j_devname);
732 if (journal->j_flags & JBD2_ABORT_ON_SYNCDATA_ERR)
733 jbd2_journal_abort(journal, err);
734 err = 0;
735 } 732 }
736 733
737 /* Lo and behold: we have just managed to send a transaction to 734 /* Lo and behold: we have just managed to send a transaction to
@@ -845,6 +842,12 @@ wait_for_iobuf:
845 } 842 }
846 if (!err && !is_journal_aborted(journal)) 843 if (!err && !is_journal_aborted(journal))
847 err = journal_wait_on_commit_record(journal, cbh); 844 err = journal_wait_on_commit_record(journal, cbh);
845 if (JBD2_HAS_INCOMPAT_FEATURE(journal,
846 JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) &&
847 journal->j_flags & JBD2_BARRIER) {
848 blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL,
849 BLKDEV_IFL_WAIT);
850 }
848 851
849 if (err) 852 if (err)
850 jbd2_journal_abort(journal, err); 853 jbd2_journal_abort(journal, err);