Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372150
b: refs/heads/master
c: e678a4f
h: refs/heads/master
v: v3
  • Loading branch information
Jan Kara committed Mar 27, 2013
1 parent 7d32017 commit e962cd6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e643692138cfa33528f054b071ba2583509bb217
refs/heads/master: e678a4f0f50d4fa4f7aaa6de8eb3f071513356a0
11 changes: 11 additions & 0 deletions trunk/fs/jbd/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,16 @@ int log_wait_commit(journal_t *journal, tid_t tid)
spin_unlock(&journal->j_state_lock);
#endif
spin_lock(&journal->j_state_lock);
/*
* Not running or committing trans? Must be already committed. This
* saves us from waiting for a *long* time when tid overflows.
*/
if (!((journal->j_running_transaction &&
journal->j_running_transaction->t_tid == tid) ||
(journal->j_committing_transaction &&
journal->j_committing_transaction->t_tid == tid)))
goto out_unlock;

if (!tid_geq(journal->j_commit_waited, tid))
journal->j_commit_waited = tid;
while (tid_gt(tid, journal->j_commit_sequence)) {
Expand All @@ -575,6 +585,7 @@ int log_wait_commit(journal_t *journal, tid_t tid)
!tid_gt(tid, journal->j_commit_sequence));
spin_lock(&journal->j_state_lock);
}
out_unlock:
spin_unlock(&journal->j_state_lock);

if (unlikely(is_journal_aborted(journal))) {
Expand Down

0 comments on commit e962cd6

Please sign in to comment.