add patch support-read-only-images
[ext4-patch-queue.git] / complain-about-descriptor-block-checksum-errors
blob2c29b44e77f28ea33bf84603c17ce9cc4e135252
1 jbd2: complain about descriptor block checksum errors
3 From: "Darrick J. Wong" <darrick.wong@oracle.com>
5 We should complain in dmesg when journal recovery fails on account of
6 the descriptor block being corrupt, so that the diagnostic data can
7 be recovered.
9 Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 ---
12  fs/jbd2/recovery.c |    3 +++
13  1 file changed, 3 insertions(+)
15 diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
16 index bcbef08..b5128c6 100644
17 --- a/fs/jbd2/recovery.c
18 +++ b/fs/jbd2/recovery.c
19 @@ -524,6 +524,9 @@ static int do_one_pass(journal_t *journal,
20                         if (descr_csum_size > 0 &&
21                             !jbd2_descr_block_csum_verify(journal,
22                                                           bh->b_data)) {
23 +                               printk(KERN_ERR "JBD2: Invalid checksum "
24 +                                      "recovering block %lu in log\n",
25 +                                      next_log_block);
26                                 err = -EIO;
27                                 brelse(bh);
28                                 goto failed;