Skip to content

Commit b71a005

Browse files
tytsogregkh
authored andcommitted
jbd2: don't wipe the journal on a failed journal checksum
commit e6a4742 upstream. If there is a failed journal checksum, don't reset the journal. This allows for userspace programs to decide how to recover from this situation. It may be that ignoring the journal checksum failure might be a better way of recovering the file system. Once we add per-block checksums, we can definitely do better. Until then, a system administrator can try backing up the file system image (or taking a snapshot) and and trying to determine experimentally whether ignoring the checksum failure or aborting the journal replay results in less data loss. Signed-off-by: "Theodore Ts'o" <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 943e167 commit b71a005

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/jbd2/journal.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,13 @@ int jbd2_journal_load(journal_t *journal)
12531253
if (jbd2_journal_recover(journal))
12541254
goto recovery_error;
12551255

1256+
if (journal->j_failed_commit) {
1257+
printk(KERN_ERR "JBD2: journal transaction %u on %s "
1258+
"is corrupt.\n", journal->j_failed_commit,
1259+
journal->j_devname);
1260+
return -EIO;
1261+
}
1262+
12561263
/* OK, we've finished with the dynamic journal bits:
12571264
* reinitialise the dynamic contents of the superblock in memory
12581265
* and reset them on disk. */

0 commit comments

Comments
 (0)