]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/jbd2/commit.c
Merge branch 'proc' of git://git.kernel.org/pub/scm/linux/kernel/git/adobriyan/proc
[linux-2.6-omap-h63xx.git] / fs / jbd2 / commit.c
index 0d3814a35ed11e19a09beb3007113bfa067d0ecb..8b119e16aa36d9970c881a5c41b0f98ff06962fa 100644 (file)
@@ -504,9 +504,10 @@ void jbd2_journal_commit_transaction(journal_t *journal)
                jh = commit_transaction->t_buffers;
 
                /* If we're in abort mode, we just un-journal the buffer and
-                  release it for background writing. */
+                  release it. */
 
                if (is_journal_aborted(journal)) {
+                       clear_buffer_jbddirty(jh2bh(jh));
                        JBUFFER_TRACE(jh, "journal is aborting: refile");
                        jbd2_journal_refile_buffer(journal, jh);
                        /* If that was the last one, we need to clean up
@@ -683,6 +684,8 @@ start_journal_io:
                printk(KERN_WARNING
                        "JBD2: Detected IO errors while flushing file data "
                       "on %s\n", journal->j_devname);
+               if (journal->j_flags & JBD2_ABORT_ON_SYNCDATA_ERR)
+                       jbd2_journal_abort(journal, err);
                err = 0;
        }
 
@@ -783,6 +786,9 @@ wait_for_iobuf:
                /* AKPM: bforget here */
        }
 
+       if (err)
+               jbd2_journal_abort(journal, err);
+
        jbd_debug(3, "JBD: commit phase 5\n");
 
        if (!JBD2_HAS_INCOMPAT_FEATURE(journal,
@@ -881,6 +887,8 @@ restart_loop:
                if (buffer_jbddirty(bh)) {
                        JBUFFER_TRACE(jh, "add to new checkpointing trans");
                        __jbd2_journal_insert_checkpoint(jh, commit_transaction);
+                       if (is_journal_aborted(journal))
+                               clear_buffer_jbddirty(bh);
                        JBUFFER_TRACE(jh, "refile for checkpoint writeback");
                        __jbd2_journal_refile_buffer(jh);
                        jbd_unlock_bh_state(bh);
@@ -987,6 +995,9 @@ restart_loop:
        }
        spin_unlock(&journal->j_list_lock);
 
+       if (journal->j_commit_callback)
+               journal->j_commit_callback(journal, commit_transaction);
+
        trace_mark(jbd2_end_commit, "dev %s transaction %d head %d",
                   journal->j_devname, commit_transaction->t_tid,
                   journal->j_tail_sequence);