]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
jbd2: fix invalid descriptor block checksum
authorluojiajun <luojiajun3@huawei.com>
Fri, 1 Mar 2019 05:30:00 +0000 (00:30 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2019 20:29:07 +0000 (22:29 +0200)
commita05d994409db22778afe9a763ebdd87efe8ab8fe
treec9eaadb68c8dbd20e3502dcb89cdea356e5671cd
parent9d5a48f12e4848b1f855a2046797ba214ade92c7
jbd2: fix invalid descriptor block checksum

[ Upstream commit 6e876c3dd205d30b0db6850e97a03d75457df007 ]

In jbd2_journal_commit_transaction(), if we are in abort mode,
we may flush the buffer without setting descriptor block checksum
by goto start_journal_io. Then fs is mounted,
jbd2_descriptor_block_csum_verify() failed.

[  271.379811] EXT4-fs (vdd): shut down requested (2)
[  271.381827] Aborting journal on device vdd-8.
[  271.597136] JBD2: Invalid checksum recovering block 22199 in log
[  271.598023] JBD2: recovery failed
[  271.598484] EXT4-fs (vdd): error loading journal

Fix this problem by keep setting descriptor block checksum if the
descriptor buffer is not NULL.

This checksum problem can be reproduced by xfstests generic/388.

Signed-off-by: luojiajun <luojiajun3@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/jbd2/commit.c