diff options
Diffstat (limited to 'fs/jbd/commit.c')
-rw-r--r-- | fs/jbd/commit.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index ecb44c94ba8d..28a9ddaa0c49 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c | |||
@@ -786,6 +786,12 @@ wait_for_iobuf: | |||
786 | 786 | ||
787 | jbd_debug(3, "JBD: commit phase 6\n"); | 787 | jbd_debug(3, "JBD: commit phase 6\n"); |
788 | 788 | ||
789 | /* All metadata is written, now write commit record and do cleanup */ | ||
790 | spin_lock(&journal->j_state_lock); | ||
791 | J_ASSERT(commit_transaction->t_state == T_COMMIT); | ||
792 | commit_transaction->t_state = T_COMMIT_RECORD; | ||
793 | spin_unlock(&journal->j_state_lock); | ||
794 | |||
789 | if (journal_write_commit_record(journal, commit_transaction)) | 795 | if (journal_write_commit_record(journal, commit_transaction)) |
790 | err = -EIO; | 796 | err = -EIO; |
791 | 797 | ||
@@ -923,7 +929,7 @@ restart_loop: | |||
923 | 929 | ||
924 | jbd_debug(3, "JBD: commit phase 8\n"); | 930 | jbd_debug(3, "JBD: commit phase 8\n"); |
925 | 931 | ||
926 | J_ASSERT(commit_transaction->t_state == T_COMMIT); | 932 | J_ASSERT(commit_transaction->t_state == T_COMMIT_RECORD); |
927 | 933 | ||
928 | commit_transaction->t_state = T_FINISHED; | 934 | commit_transaction->t_state = T_FINISHED; |
929 | J_ASSERT(commit_transaction == journal->j_committing_transaction); | 935 | J_ASSERT(commit_transaction == journal->j_committing_transaction); |