]> err.no Git - linux-2.6/commitdiff
jbd2: fix commit code to properly abort journal
authorJan Kara <jack@suse.cz>
Tue, 16 Oct 2007 22:38:25 +0000 (18:38 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 17 Oct 2007 22:49:58 +0000 (18:49 -0400)
We should really call journal_abort() and not __journal_abort_hard() in
case of errors.  The latter call does not record the error in the journal
superblock and thus filesystem won't be marked as with errors later (and
user could happily mount it without any warning).

Signed-off-by: Jan Kara <jack@suse.cz>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/jbd2/commit.c

index b898ee4ef16af322f30cab59d1518ad899998984..6986f334c643291181cd56c01c42a8820ad110f0 100644 (file)
@@ -475,7 +475,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
        spin_unlock(&journal->j_list_lock);
 
        if (err)
-               __jbd2_journal_abort_hard(journal);
+               jbd2_journal_abort(journal, err);
 
        jbd2_journal_write_revoke_records(journal, commit_transaction);
 
@@ -533,7 +533,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
 
                        descriptor = jbd2_journal_get_descriptor_buffer(journal);
                        if (!descriptor) {
-                               __jbd2_journal_abort_hard(journal);
+                               jbd2_journal_abort(journal, -EIO);
                                continue;
                        }
 
@@ -566,7 +566,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
                   and repeat this loop: we'll fall into the
                   refile-on-abort condition above. */
                if (err) {
-                       __jbd2_journal_abort_hard(journal);
+                       jbd2_journal_abort(journal, err);
                        continue;
                }
 
@@ -757,7 +757,7 @@ wait_for_iobuf:
                err = -EIO;
 
        if (err)
-               __jbd2_journal_abort_hard(journal);
+               jbd2_journal_abort(journal, err);
 
        /* End of a transaction!  Finally, we can do checkpoint
            processing: any buffers committed as a result of this