Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b048d8462652159c5314d19b191220b0ec384edb
Commit:     b048d8462652159c5314d19b191220b0ec384edb
Parent:     531021f2ca681faf58f926771f85bb5c76f13eba
Author:     Mingming Cao <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 5 08:52:45 2008 -0500
Committer:  Theodore Ts'o <[EMAIL PROTECTED]>
CommitDate: Tue Feb 5 08:52:45 2008 -0500

    jbd2: Add error check to journal_wait_on_commit_record to avoid oops
    
    The buffer head pointer passed to journal_wait_on_commit_record() could
    be NULL if the previous journal_submit_commit_record() failed or journal
    has already aborted.
    
    Looking at the jbd2 debug messages, before the oops happened, the jbd2
    is aborted due to trying to access the next log block beyond the end
    of device. This might be caused by using a corrupted image.
    
    We need to check the error returns from journal_submit_commit_record()
    and avoid calling journal_wait_on_commit_record() in the failure case.
    
    This addresses Kernel Bugzilla #9849
    
    Signed-off-by: Mingming Cao <[EMAIL PROTECTED]>
    Signed-off-by: "Theodore Ts'o" <[EMAIL PROTECTED]>
---
 fs/jbd2/commit.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 4f302d2..48b3cb8 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -872,7 +872,8 @@ wait_for_iobuf:
                if (err)
                        __jbd2_journal_abort_hard(journal);
        }
-       err = journal_wait_on_commit_record(cbh);
+       if (!err && !is_journal_aborted(journal))
+               err = journal_wait_on_commit_record(cbh);
 
        if (err)
                jbd2_journal_abort(journal, err);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to