diff options
Diffstat (limited to 'fs/jbd2/checkpoint.c')
-rw-r--r-- | fs/jbd2/checkpoint.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index c78841ee81cf..7f34f4716165 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c | |||
@@ -120,8 +120,8 @@ void __jbd2_log_wait_for_space(journal_t *journal) | |||
120 | int nblocks, space_left; | 120 | int nblocks, space_left; |
121 | /* assert_spin_locked(&journal->j_state_lock); */ | 121 | /* assert_spin_locked(&journal->j_state_lock); */ |
122 | 122 | ||
123 | nblocks = jbd_space_needed(journal); | 123 | nblocks = jbd2_space_needed(journal); |
124 | while (__jbd2_log_space_left(journal) < nblocks) { | 124 | while (jbd2_log_space_left(journal) < nblocks) { |
125 | if (journal->j_flags & JBD2_ABORT) | 125 | if (journal->j_flags & JBD2_ABORT) |
126 | return; | 126 | return; |
127 | write_unlock(&journal->j_state_lock); | 127 | write_unlock(&journal->j_state_lock); |
@@ -140,8 +140,8 @@ void __jbd2_log_wait_for_space(journal_t *journal) | |||
140 | */ | 140 | */ |
141 | write_lock(&journal->j_state_lock); | 141 | write_lock(&journal->j_state_lock); |
142 | spin_lock(&journal->j_list_lock); | 142 | spin_lock(&journal->j_list_lock); |
143 | nblocks = jbd_space_needed(journal); | 143 | nblocks = jbd2_space_needed(journal); |
144 | space_left = __jbd2_log_space_left(journal); | 144 | space_left = jbd2_log_space_left(journal); |
145 | if (space_left < nblocks) { | 145 | if (space_left < nblocks) { |
146 | int chkpt = journal->j_checkpoint_transactions != NULL; | 146 | int chkpt = journal->j_checkpoint_transactions != NULL; |
147 | tid_t tid = 0; | 147 | tid_t tid = 0; |
@@ -156,7 +156,15 @@ void __jbd2_log_wait_for_space(journal_t *journal) | |||
156 | /* We were able to recover space; yay! */ | 156 | /* We were able to recover space; yay! */ |
157 | ; | 157 | ; |
158 | } else if (tid) { | 158 | } else if (tid) { |
159 | /* | ||
160 | * jbd2_journal_commit_transaction() may want | ||
161 | * to take the checkpoint_mutex if JBD2_FLUSHED | ||
162 | * is set. So we need to temporarily drop it. | ||
163 | */ | ||
164 | mutex_unlock(&journal->j_checkpoint_mutex); | ||
159 | jbd2_log_wait_commit(journal, tid); | 165 | jbd2_log_wait_commit(journal, tid); |
166 | write_lock(&journal->j_state_lock); | ||
167 | continue; | ||
160 | } else { | 168 | } else { |
161 | printk(KERN_ERR "%s: needed %d blocks and " | 169 | printk(KERN_ERR "%s: needed %d blocks and " |
162 | "only had %d space available\n", | 170 | "only had %d space available\n", |
@@ -625,10 +633,6 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh) | |||
625 | 633 | ||
626 | __jbd2_journal_drop_transaction(journal, transaction); | 634 | __jbd2_journal_drop_transaction(journal, transaction); |
627 | jbd2_journal_free_transaction(transaction); | 635 | jbd2_journal_free_transaction(transaction); |
628 | |||
629 | /* Just in case anybody was waiting for more transactions to be | ||
630 | checkpointed... */ | ||
631 | wake_up(&journal->j_wait_logspace); | ||
632 | ret = 1; | 636 | ret = 1; |
633 | out: | 637 | out: |
634 | return ret; | 638 | return ret; |
@@ -690,9 +694,7 @@ void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transact | |||
690 | J_ASSERT(transaction->t_state == T_FINISHED); | 694 | J_ASSERT(transaction->t_state == T_FINISHED); |
691 | J_ASSERT(transaction->t_buffers == NULL); | 695 | J_ASSERT(transaction->t_buffers == NULL); |
692 | J_ASSERT(transaction->t_forget == NULL); | 696 | J_ASSERT(transaction->t_forget == NULL); |
693 | J_ASSERT(transaction->t_iobuf_list == NULL); | ||
694 | J_ASSERT(transaction->t_shadow_list == NULL); | 697 | J_ASSERT(transaction->t_shadow_list == NULL); |
695 | J_ASSERT(transaction->t_log_list == NULL); | ||
696 | J_ASSERT(transaction->t_checkpoint_list == NULL); | 698 | J_ASSERT(transaction->t_checkpoint_list == NULL); |
697 | J_ASSERT(transaction->t_checkpoint_io_list == NULL); | 699 | J_ASSERT(transaction->t_checkpoint_io_list == NULL); |
698 | J_ASSERT(atomic_read(&transaction->t_updates) == 0); | 700 | J_ASSERT(atomic_read(&transaction->t_updates) == 0); |