ext4: annotate data race in jbd2_journal_dirty_metadata()
authorJan Kara <jack@suse.cz>
Tue, 6 Apr 2021 16:18:00 +0000 (18:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:37 +0000 (14:47 +0200)
commit346190959f9750f50ae56872c17e71cda1562688
tree35adcfeea9996a2f7e725f6679f9a51307df0fef
parent9aca313726cb657325eeb01ab00142a6572c2175
ext4: annotate data race in jbd2_journal_dirty_metadata()

commit 83fe6b18b8d04c6c849379005e1679bac9752466 upstream.

Assertion checks in jbd2_journal_dirty_metadata() are known to be racy
but we don't want to be grabbing locks just for them.  We thus recheck
them under b_state_lock only if it looks like they would fail. Annotate
the checks with data_race().

Cc: stable@kernel.org
Reported-by: Hao Sun <sunhao.th@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20210406161804.20150-2-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/jbd2/transaction.c