aboutsummaryrefslogtreecommitdiff
path: root/scripts/gcc-plugins/randomize_layout_plugin.c
diff options
context:
space:
mode:
authorJoseph Qi <[email protected]>2022-01-29 13:41:27 -0800
committerLinus Torvalds <[email protected]>2022-01-30 09:56:58 +0200
commitddf4b773aa40790dfa936bd845c18e735a49c61c (patch)
tree97440df1c55aaee1ef35be9eb5dc4bdb7f4aafd5 /scripts/gcc-plugins/randomize_layout_plugin.c
parent4cd1103d8c66b2cdb7e64385c274edb0ac5e8887 (diff)
ocfs2: fix a deadlock when commit trans
commit 6f1b228529ae introduces a regression which can deadlock as follows: Task1: Task2: jbd2_journal_commit_transaction ocfs2_test_bg_bit_allocatable spin_lock(&jh->b_state_lock) jbd_lock_bh_journal_head __jbd2_journal_remove_checkpoint spin_lock(&jh->b_state_lock) jbd2_journal_put_journal_head jbd_lock_bh_journal_head Task1 and Task2 lock bh->b_state and jh->b_state_lock in different order, which finally result in a deadlock. So use jbd2_journal_[grab|put]_journal_head instead in ocfs2_test_bg_bit_allocatable() to fix it. Link: https://lkml.kernel.org/r/[email protected] Fixes: 6f1b228529ae ("ocfs2: fix race between searching chunks and release journal_head from buffer_head") Signed-off-by: Joseph Qi <[email protected]> Reported-by: Gautham Ananthakrishna <[email protected]> Tested-by: Gautham Ananthakrishna <[email protected]> Reported-by: Saeed Mirzamohammadi <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Andreas Dilger <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Gang He <[email protected]> Cc: Joel Becker <[email protected]> Cc: Jun Piao <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/randomize_layout_plugin.c')
0 files changed, 0 insertions, 0 deletions