diff options
Diffstat (limited to 'fs/jbd2/commit.c')
-rw-r--r-- | fs/jbd2/commit.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 4f302d279279..a8173081f831 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
@@ -136,18 +136,20 @@ static int journal_submit_commit_record(journal_t *journal, | |||
136 | 136 | ||
137 | JBUFFER_TRACE(descriptor, "submit commit block"); | 137 | JBUFFER_TRACE(descriptor, "submit commit block"); |
138 | lock_buffer(bh); | 138 | lock_buffer(bh); |
139 | 139 | get_bh(bh); | |
140 | set_buffer_dirty(bh); | 140 | set_buffer_dirty(bh); |
141 | set_buffer_uptodate(bh); | 141 | set_buffer_uptodate(bh); |
142 | bh->b_end_io = journal_end_buffer_io_sync; | 142 | bh->b_end_io = journal_end_buffer_io_sync; |
143 | 143 | ||
144 | if (journal->j_flags & JBD2_BARRIER && | 144 | if (journal->j_flags & JBD2_BARRIER && |
145 | !JBD2_HAS_COMPAT_FEATURE(journal, | 145 | !JBD2_HAS_INCOMPAT_FEATURE(journal, |
146 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) { | 146 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) { |
147 | set_buffer_ordered(bh); | 147 | set_buffer_ordered(bh); |
148 | barrier_done = 1; | 148 | barrier_done = 1; |
149 | } | 149 | } |
150 | ret = submit_bh(WRITE, bh); | 150 | ret = submit_bh(WRITE, bh); |
151 | if (barrier_done) | ||
152 | clear_buffer_ordered(bh); | ||
151 | 153 | ||
152 | /* is it possible for another commit to fail at roughly | 154 | /* is it possible for another commit to fail at roughly |
153 | * the same time as this one? If so, we don't want to | 155 | * the same time as this one? If so, we don't want to |
@@ -166,7 +168,6 @@ static int journal_submit_commit_record(journal_t *journal, | |||
166 | spin_unlock(&journal->j_state_lock); | 168 | spin_unlock(&journal->j_state_lock); |
167 | 169 | ||
168 | /* And try again, without the barrier */ | 170 | /* And try again, without the barrier */ |
169 | clear_buffer_ordered(bh); | ||
170 | set_buffer_uptodate(bh); | 171 | set_buffer_uptodate(bh); |
171 | set_buffer_dirty(bh); | 172 | set_buffer_dirty(bh); |
172 | ret = submit_bh(WRITE, bh); | 173 | ret = submit_bh(WRITE, bh); |
@@ -872,7 +873,8 @@ wait_for_iobuf: | |||
872 | if (err) | 873 | if (err) |
873 | __jbd2_journal_abort_hard(journal); | 874 | __jbd2_journal_abort_hard(journal); |
874 | } | 875 | } |
875 | err = journal_wait_on_commit_record(cbh); | 876 | if (!err && !is_journal_aborted(journal)) |
877 | err = journal_wait_on_commit_record(cbh); | ||
876 | 878 | ||
877 | if (err) | 879 | if (err) |
878 | jbd2_journal_abort(journal, err); | 880 | jbd2_journal_abort(journal, err); |