aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/journal.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index 12b62a3cbf69..11a1178d5ee8 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -256,11 +256,9 @@ handle_t *ocfs2_start_trans(struct ocfs2_super *osb, int max_buffs)
256 BUG_ON(osb->journal->j_state == OCFS2_JOURNAL_FREE); 256 BUG_ON(osb->journal->j_state == OCFS2_JOURNAL_FREE);
257 BUG_ON(max_buffs <= 0); 257 BUG_ON(max_buffs <= 0);
258 258
259 /* JBD might support this, but our journalling code doesn't yet. */ 259 /* Nested transaction? Just return the handle... */
260 if (journal_current_handle()) { 260 if (journal_current_handle())
261 mlog(ML_ERROR, "Recursive transaction attempted!\n"); 261 return jbd2_journal_start(journal, max_buffs);
262 BUG();
263 }
264 262
265 down_read(&osb->journal->j_trans_barrier); 263 down_read(&osb->journal->j_trans_barrier);
266 264
@@ -285,16 +283,18 @@ handle_t *ocfs2_start_trans(struct ocfs2_super *osb, int max_buffs)
285int ocfs2_commit_trans(struct ocfs2_super *osb, 283int ocfs2_commit_trans(struct ocfs2_super *osb,
286 handle_t *handle) 284 handle_t *handle)
287{ 285{
288 int ret; 286 int ret, nested;
289 struct ocfs2_journal *journal = osb->journal; 287 struct ocfs2_journal *journal = osb->journal;
290 288
291 BUG_ON(!handle); 289 BUG_ON(!handle);
292 290
291 nested = handle->h_ref > 1;
293 ret = jbd2_journal_stop(handle); 292 ret = jbd2_journal_stop(handle);
294 if (ret < 0) 293 if (ret < 0)
295 mlog_errno(ret); 294 mlog_errno(ret);
296 295
297 up_read(&journal->j_trans_barrier); 296 if (!nested)
297 up_read(&journal->j_trans_barrier);
298 298
299 return ret; 299 return ret;
300} 300}