Skip to content

Commit

Permalink
jbd2: Drop pointless wakeup from jbd2_journal_stop()
Browse files Browse the repository at this point in the history
When we drop last handle from a transaction and journal->j_barrier_count
> 0, jbd2_journal_stop() wakes up journal->j_wait_transaction_locked
wait queue. This looks pointless - wait for outstanding handles always
happens on journal->j_wait_updates waitqueue.
journal->j_wait_transaction_locked is used to wait for transaction state
changes and by start_this_handle() for waiting until
journal->j_barrier_count drops to 0. The first case is clearly
irrelevant here since only jbd2 thread changes transaction state. The
second case looks related but jbd2_journal_unlock_updates() is
responsible for the wakeup in this case. So just drop the wakeup.

Reviewed-by: Theodore Ts'o <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
  • Loading branch information
jankara authored and tytso committed Nov 5, 2019
1 parent 150549e commit 5559b2d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/jbd2/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,11 +1831,8 @@ int jbd2_journal_stop(handle_t *handle)
* once we do this, we must not dereference transaction
* pointer again.
*/
if (atomic_dec_and_test(&transaction->t_updates)) {
if (atomic_dec_and_test(&transaction->t_updates))
wake_up(&journal->j_wait_updates);
if (journal->j_barrier_count)
wake_up(&journal->j_wait_transaction_locked);
}

rwsem_release(&journal->j_trans_commit_map, 1, _THIS_IP_);

Expand Down

0 comments on commit 5559b2d

Please sign in to comment.