Skip to content
Commit 24dc9864 authored by Lukas Czerner's avatar Lukas Czerner Committed by Theodore Ts'o
Browse files

jbd2: make sure jh have b_transaction set in refile/unfile_buffer



Callers of __jbd2_journal_unfile_buffer() and
__jbd2_journal_refile_buffer() assume that the b_transaction is set. In
fact if it's not, we can end up with journal_head refcounting errors
leading to crash much later that might be very hard to track down. Add
asserts to make sure that is the case.

We also make sure that b_next_transaction is NULL in
__jbd2_journal_unfile_buffer() since the callers expect that as well and
we should not get into that stage in this state anyway, leading to
problems later on if we do.

Tested with fstests.

Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20200617092549.6712-1-lczerner@redhat.com


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent e030a288
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment