linux/fs/jbd2
Ye Bin e16c4c2451 jbd2: avoid mount failed when commit block is partial submitted
[ Upstream commit 0bab8db415 ]

We encountered a problem that the file system could not be mounted in
the power-off scenario. The analysis of the file system mirror shows that
only part of the data is written to the last commit block.
The valid data of the commit block is concentrated in the first sector.
However, the data of the entire block is involved in the checksum calculation.
For different hardware, the minimum atomic unit may be different.
If the checksum of a committed block is incorrect, clear the data except the
'commit_header' and then calculate the checksum. If the checkusm is correct,
it is considered that the block is partially committed, Then continue to replay
journal.

Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240620072405.3533701-1-yebin@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-09-12 11:11:37 +02:00
..
checkpoint.c jbd2: remove unused function '__cp_buffer_busy' 2023-08-04 16:32:29 -04:00
commit.c jbd2: make jbd2_journal_get_max_txn_bufs() internal 2024-08-03 08:54:19 +02:00
journal.c jbd2: avoid memleak in jbd2_journal_write_metadata_buffer 2024-08-14 13:58:46 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
recovery.c jbd2: avoid mount failed when commit block is partial submitted 2024-09-12 11:11:37 +02:00
revoke.c jbd2: rename jbd_debug() to jbd2_debug() 2022-08-02 23:52:19 -04:00
transaction.c jbd2: avoid infinite transaction commit loop 2024-08-03 08:54:19 +02:00