linux/fs/jbd2
changfengnan fc750a3b44 jbd2: avoid transaction reuse after reformatting
When ext4 is formatted with lazy_journal_init=1 and transactions from
the previous filesystem are still on disk, it is possible that they are
considered during a recovery after a crash. Because the checksum seed
has changed, the CRC check will fail, and the journal recovery fails
with checksum error although the journal is otherwise perfectly valid.
Fix the problem by checking commit block time stamps to determine
whether the data in the journal block is just stale or whether it is
indeed corrupt.

Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Fengnan Chang <changfengnan@hikvision.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20201012164900.20197-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2020-10-18 10:37:26 -04:00
..
checkpoint.c block: remove the error_sector argument to blkdev_issue_flush 2020-05-22 08:45:46 -06:00
commit.c jbd2, ext4, ocfs2: introduce/use journal callbacks j_submit|finish_inode_data_buffers() 2020-10-18 10:37:15 -04:00
journal.c jbd2: introduce/export functions jbd2_journal_submit|finish_inode_data_buffers() 2020-10-18 10:37:15 -04: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 transaction reuse after reformatting 2020-10-18 10:37:26 -04:00
revoke.c jbd2: Reserve space for revoke descriptor blocks 2019-11-05 16:00:48 -05:00
transaction.c jbd2: remove unused parameter in jbd2_journal_try_to_free_buffers() 2020-08-07 14:12:35 -04:00