--- linux/fs/reiserfs/journal.c Sat Sep 8 08:05:32 2001 +++ linux/fs/reiserfs/journal.c Thu Sep 20 13:15:04 2001 @@ -2872,17 +2872,12 @@ /* write any buffers that must hit disk before this commit is done */ fsync_inode_buffers(&(SB_JOURNAL(p_s_sb)->j_dummy_inode)) ; - /* honor the flush and async wishes from the caller */ + /* honor the flush wishes from the caller, simple commits can + ** be done outside the journal lock, they are done below + */ if (flush) { - flush_commit_list(p_s_sb, SB_JOURNAL_LIST(p_s_sb) + orig_jindex, 1) ; flush_journal_list(p_s_sb, SB_JOURNAL_LIST(p_s_sb) + orig_jindex , 1) ; - } else if (commit_now) { - if (wait_on_commit) { - flush_commit_list(p_s_sb, SB_JOURNAL_LIST(p_s_sb) + orig_jindex, 1) ; - } else { - commit_flush_async(p_s_sb, orig_jindex) ; - } } /* reset journal values for the next transaction */ @@ -2944,6 +2939,16 @@ atomic_set(&(SB_JOURNAL(p_s_sb)->j_jlock), 0) ; /* wake up any body waiting to join. */ wake_up(&(SB_JOURNAL(p_s_sb)->j_join_wait)) ; + + if (!flush && commit_now) { + if (current->need_resched) + schedule() ; + if (wait_on_commit) { + flush_commit_list(p_s_sb, SB_JOURNAL_LIST(p_s_sb) + orig_jindex, 1) ; + } else { + commit_flush_async(p_s_sb, orig_jindex) ; + } + } return 0 ; } .