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: Nkernel test robot <lkp@intel.com> Reviewed-by: NAndreas Dilger <adilger@dilger.ca> Signed-off-by: NFengnan Chang <changfengnan@hikvision.com> Signed-off-by: NJan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20201012164900.20197-1-jack@suse.czSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
Showing
想要评论请 注册 或 登录