Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112961
b: refs/heads/master
c: 23f8b79
h: refs/heads/master
i:
  112959: 77f0a3c
v: v3
  • Loading branch information
Duane Griffin authored and Theodore Ts'o committed Oct 9, 2008
1 parent bf843c3 commit c805566
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c806e68f5647109350ec546fee5b526962970fd2
refs/heads/master: 23f8b79eae8a74e42a006ffa7c456e295c7e1c0d
19 changes: 17 additions & 2 deletions trunk/fs/jbd2/checkpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,29 @@ void __jbd2_log_wait_for_space(journal_t *journal)

/*
* Test again, another process may have checkpointed while we
* were waiting for the checkpoint lock
* were waiting for the checkpoint lock. If there are no
* outstanding transactions there is nothing to checkpoint and
* we can't make progress. Abort the journal in this case.
*/
spin_lock(&journal->j_state_lock);
spin_lock(&journal->j_list_lock);
nblocks = jbd_space_needed(journal);
if (__jbd2_log_space_left(journal) < nblocks) {
int chkpt = journal->j_checkpoint_transactions != NULL;

spin_unlock(&journal->j_list_lock);
spin_unlock(&journal->j_state_lock);
jbd2_log_do_checkpoint(journal);
if (chkpt) {
jbd2_log_do_checkpoint(journal);
} else {
printk(KERN_ERR "%s: no transactions\n",
__func__);
jbd2_journal_abort(journal, 0);
}

spin_lock(&journal->j_state_lock);
} else {
spin_unlock(&journal->j_list_lock);
}
mutex_unlock(&journal->j_checkpoint_mutex);
}
Expand Down

0 comments on commit c805566

Please sign in to comment.