Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mingming Cao and committed by
Linus Torvalds
772279c5 c3723ca3

+2
+2
fs/jbd/commit.c
··· 470 470 * transaction! Now comes the tricky part: we need to write out 471 471 * metadata. Loop over the transaction's entire buffer list: 472 472 */ 473 + spin_lock(&journal->j_state_lock); 473 474 commit_transaction->t_state = T_COMMIT; 475 + spin_unlock(&journal->j_state_lock); 474 476 475 477 J_ASSERT(commit_transaction->t_nr_buffers <= 476 478 commit_transaction->t_outstanding_credits);