Whamcloud - gitweb
LU-11412 kernel: kernel update [SLES12 SP3 4.4.155-94.50]
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / sles12sp3 / ext4-dont-check-before-replay.patch
1 Index: linux-stage/fs/ext4/super.c
2 When ldiskfs run in failover mode whith read-only disk.
3 Part of allocation updates are lost and ldiskfs may fail
4 while mounting this is due to inconsistent state of
5 group-descriptor. Group-descriptor check is added after
6 journal replay.
7 ===================================================================
8 --- linux-stage/fs/ext4/super.c 2016-11-06 15:15:30.892386878 +0530
9 +++ linux-stage.orig.1/fs/ext4/super.c  2016-11-08 10:56:45.579892189 +0530
10 @@ -3884,12 +3884,6 @@ static int ext4_fill_super(struct super_
11                 }
12         }
13         sbi->s_gdb_count = db_count;
14 -       if (!ext4_check_descriptors(sb, logical_sb_block, &first_not_zeroed)) {
15 -               ext4_msg(sb, KERN_ERR, "group descriptors corrupted!");
16 -               ret = -EFSCORRUPTED;
17 -               goto failed_mount2;
18 -       }
19 -
20         get_random_bytes(&sbi->s_next_generation, sizeof(u32));
21         spin_lock_init(&sbi->s_next_gen_lock);
22  
23 @@ -4020,6 +4014,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         sbi->s_mb_cache = ext4_xattr_create_cache();
35         if (!sbi->s_mb_cache) {
36                 ext4_msg(sb, KERN_ERR, "Failed to create an mb_cache");