From: Ye Bin <yebin10@huawei.com>
To: <tytso@mit.edu>, <adilger.kernel@dilger.ca>,
<linux-ext4@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <jack@suse.cz>,
Ye Bin <yebin10@huawei.com>
Subject: [PATCH -next] jbd2: discard last transaction when commit block checksum broken in v2v3
Date: Wed, 29 Sep 2021 11:55:28 +0800 [thread overview]
Message-ID: <20210929035528.1990993-1-yebin10@huawei.com> (raw)
Now, we meet an issue that commit block has broken checksum when cold reboot
device, that lead to mount failed.
The reason maybe only some sector store on disk, and then device power off.
But we calculate checksum with whole logic block.The data stored on disk can
only ensure the atomicity of sector level.
Actually, we already replay previous transactions. We can just discard last
transaction. As now, descriptor/revocation/commit/superblock has it's own
checksum.
Fixes:80b3767fbe15("jbd2: don't wipe the journal on a failed journal checksum")
Signed-off-by: Ye Bin <yebin10@huawei.com>
---
fs/jbd2/journal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 35302bc192eb..a3dd7b757b3d 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2080,7 +2080,7 @@ int jbd2_journal_load(journal_t *journal)
if (jbd2_journal_recover(journal))
goto recovery_error;
- if (journal->j_failed_commit) {
+ if (journal->j_failed_commit && !jbd2_journal_has_csum_v2or3(journal)) {
printk(KERN_ERR "JBD2: journal transaction %u on %s "
"is corrupt.\n", journal->j_failed_commit,
journal->j_devname);
--
2.31.1
next reply other threads:[~2021-09-29 3:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-29 3:55 Ye Bin [this message]
2021-11-22 18:22 ` [PATCH -next] jbd2: discard last transaction when commit block checksum broken in v2v3 Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210929035528.1990993-1-yebin10@huawei.com \
--to=yebin10@huawei.com \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).