Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116975
b: refs/heads/master
c: be07c4e
h: refs/heads/master
i:
  116973: cf2caf1
  116971: f63d959
  116967: 4b0fb7d
  116959: c71ae24
v: v3
  • Loading branch information
Duane Griffin authored and Linus Torvalds committed Oct 23, 2008
1 parent 27efad1 commit c5cb68c
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: 9f818b4ac04f53458d0354950b4f229f54be4dbf
refs/heads/master: be07c4ed4043ab8c26f222348136141335e47a2f
19 changes: 17 additions & 2 deletions trunk/fs/jbd/checkpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,29 @@ void __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 (__log_space_left(journal) < nblocks) {
int chkpt = journal->j_checkpoint_transactions != NULL;

spin_unlock(&journal->j_list_lock);
spin_unlock(&journal->j_state_lock);
log_do_checkpoint(journal);
if (chkpt) {
log_do_checkpoint(journal);
} else {
printk(KERN_ERR "%s: no transactions\n",
__func__);
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 c5cb68c

Please sign in to comment.