Delete all spin_lock(t_handle_lock) statements inside write_lock(j_state_lock) because the critical code sections can be protected by write_lock(j_state_lock) only. Signed-off-by: Toshiyuki Okajima <toshi.okajima@xxxxxxxxxxxxxx> Reported-by: Yongqiang Yang <xiaoqiangnk@xxxxxxxxx> --- fs/jbd2/commit.c | 4 ---- fs/jbd2/transaction.c | 6 +----- 2 files changed, 1 insertions(+), 9 deletions(-) diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 68d704d..1030d47 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -364,22 +364,18 @@ void jbd2_journal_commit_transaction(journal_t *journal) stats.run.rs_running = jbd2_time_diff(commit_transaction->t_start, stats.run.rs_locked); - spin_lock(&commit_transaction->t_handle_lock); while (atomic_read(&commit_transaction->t_updates)) { DEFINE_WAIT(wait); prepare_to_wait(&journal->j_wait_updates, &wait, TASK_UNINTERRUPTIBLE); if (atomic_read(&commit_transaction->t_updates)) { - spin_unlock(&commit_transaction->t_handle_lock); write_unlock(&journal->j_state_lock); schedule(); write_lock(&journal->j_state_lock); - spin_lock(&commit_transaction->t_handle_lock); } finish_wait(&journal->j_wait_updates, &wait); } - spin_unlock(&commit_transaction->t_handle_lock); J_ASSERT (atomic_read(&commit_transaction->t_outstanding_credits) <= journal->j_max_transaction_buffers); diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index 76f2eca..c418ed9 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c @@ -516,14 +516,10 @@ void jbd2_journal_lock_updates(journal_t *journal) if (!transaction) break; - spin_lock(&transaction->t_handle_lock); - if (!atomic_read(&transaction->t_updates)) { - spin_unlock(&transaction->t_handle_lock); + if (!atomic_read(&transaction->t_updates)) break; - } prepare_to_wait(&journal->j_wait_updates, &wait, TASK_UNINTERRUPTIBLE); - spin_unlock(&transaction->t_handle_lock); write_unlock(&journal->j_state_lock); schedule(); finish_wait(&journal->j_wait_updates, &wait); -- 1.5.5.6 -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html