Whamcloud - gitweb
LU-14317 ldiskfs: ‘%llu’ mismatch with type ‘long int’ on arm64
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel8 / ext4-dont-check-before-replay.patch
1 When ldiskfs run in failover mode whith read-only disk.
2 Part of allocation updates are lost and ldiskfs may fail
3 while mounting this is due to inconsistent state of
4 group-descriptor. Group-descriptor check is added after
5 journal replay.
6
7 Index: linux-4.18.0-32.el8.x86_64/fs/ext4/super.c
8 ===================================================================
9 --- linux-4.18.0-32.el8.x86_64.orig/fs/ext4/super.c
10 +++ linux-4.18.0-32.el8.x86_64/fs/ext4/super.c
11 @@ -4092,11 +4092,6 @@ static int ext4_fill_super(struct super_
12                 }
13         }
14         sbi->s_gdb_count = db_count;
15 -       if (!ext4_check_descriptors(sb, logical_sb_block, &first_not_zeroed)) {
16 -               ext4_msg(sb, KERN_ERR, "group descriptors corrupted!");
17 -               ret = -EFSCORRUPTED;
18 -               goto failed_mount2;
19 -       }
20  
21         timer_setup(&sbi->s_err_report, print_daily_error_info, 0);
22  
23 @@ -4238,6 +4233,13 @@ static int ext4_fill_super(struct super_
24         sbi->s_journal->j_commit_callback = ext4_journal_commit_callback;
25  
26  no_journal:
27 +
28 +       if (!ext4_check_descriptors(sb, logical_sb_block, &first_not_zeroed)) {
29 +               ext4_msg(sb, KERN_ERR, "group descriptors corrupted!");
30 +               ret = -EFSCORRUPTED;
31 +               goto failed_mount_wq;
32 +       }
33 +
34         if (!test_opt(sb, NO_MBCACHE)) {
35                 sbi->s_ea_block_cache = ext4_xattr_create_cache();
36                 if (!sbi->s_ea_block_cache) {