Skip to content

Commit 772279c

Browse files
Mingming Caotorvalds
authored andcommitted
jbd: need to hold j_state_lock to updates to transaction t_state to T_COMMIT
Updating the current transaction's t_state is protected by j_state_lock. We need to do the same when updating the t_state to T_COMMIT. Signed-off-by: Mingming Cao <cmm@us.ibm.com> Acked-by: Jan Kara <jack@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent c3723ca commit 772279c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/jbd/commit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,9 @@ void journal_commit_transaction(journal_t *journal)
470470
* transaction! Now comes the tricky part: we need to write out
471471
* metadata. Loop over the transaction's entire buffer list:
472472
*/
473+
spin_lock(&journal->j_state_lock);
473474
commit_transaction->t_state = T_COMMIT;
475+
spin_unlock(&journal->j_state_lock);
474476

475477
J_ASSERT(commit_transaction->t_nr_buffers <=
476478
commit_transaction->t_outstanding_credits);

0 commit comments

Comments
 (0)