X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fjbd%2Fcheckpoint.c;h=98d830401c56c7e50463e85acfe994f76171bb99;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=2615ad1d86ed827fc2f311463a6d44afade8e353;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c index 2615ad1d8..98d830401 100644 --- a/fs/jbd/checkpoint.c +++ b/fs/jbd/checkpoint.c @@ -333,6 +333,10 @@ int log_do_checkpoint(journal_t *journal) break; } retry = __flush_buffer(journal, jh, bhs, &batch_count, &drop_count); + if (cond_resched_lock(&journal->j_list_lock)) { + retry = 1; + break; + } } while (jh != last_jh && !retry); if (batch_count) @@ -487,6 +491,14 @@ int __journal_clean_checkpoint_list(journal_t *journal) /* Use trylock because of the ranknig */ if (jbd_trylock_bh_state(jh2bh(jh))) ret += __try_to_free_cp_buf(jh); + /* + * This function only frees up some memory + * if possible so we dont have an obligation + * to finish processing. Bail out if preemption + * requested: + */ + if (need_resched()) + goto out; } while (jh != last_jh); } } while (transaction != last_transaction); @@ -616,7 +628,6 @@ void __journal_drop_transaction(journal_t *journal, transaction_t *transaction) J_ASSERT(transaction->t_log_list == NULL); J_ASSERT(transaction->t_checkpoint_list == NULL); J_ASSERT(transaction->t_updates == 0); - J_ASSERT(list_empty(&transaction->t_jcb)); J_ASSERT(journal->j_committing_transaction != transaction); J_ASSERT(journal->j_running_transaction != transaction);