Whamcloud - gitweb
LU-11310 ldiskfs: Support for SUSE 15 GA and SP1
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / suse15 / ext4-dont-check-before-replay.patch
1 Subject: [PATCH] ext4: don't verify group descriptors until after journal
2  replay
3
4 When ldiskfs runs in failover mode with read-only disk, it may
5 lose part of allocation updates and fail while mounting the
6 filesystem due to group descriptor checks before journal replay.
7 Don't panic with on-disk checks in read-only mode.
8
9 Seagate-bug-id: MRP-797
10 Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
11 Signed-off-by: Lokesh Nagappa Jaliminche <lokesh.jaliminche@seagate.com>
12 Lustre-change: https://review.whamcloud.com/21141
13 ---
14  fs/ext4/super.c | 12 +++++++-----
15  1 file changed, 7 insertions(+), 5 deletions(-)
16
17 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
18 index 6ea4936..134308f 100644
19 --- a/fs/ext4/super.c
20 +++ b/fs/ext4/super.c
21 @@ -4145,11 +4145,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
22                 }
23         }
24         sbi->s_gdb_count = db_count;
25 -       if (!ext4_check_descriptors(sb, logical_sb_block, &first_not_zeroed)) {
26 -               ext4_msg(sb, KERN_ERR, "group descriptors corrupted!");
27 -               ret = -EFSCORRUPTED;
28 -               goto failed_mount2;
29 -       }
30         get_random_bytes(&sbi->s_next_generation, sizeof(u32));
31         spin_lock_init(&sbi->s_next_gen_lock);
32  
33 @@ -4289,6 +4284,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
34         sbi->s_journal->j_commit_callback = ext4_journal_commit_callback;
35  
36  no_journal:
37 +
38 +       if (!ext4_check_descriptors(sb, logical_sb_block, &first_not_zeroed)) {
39 +               ext4_msg(sb, KERN_ERR, "group descriptors corrupted!");
40 +               ret = -EFSCORRUPTED;
41 +               goto failed_mount_wq;
42 +       }
43 +
44         sbi->s_mb_cache = ext4_xattr_create_cache();
45         if (!sbi->s_mb_cache) {
46                 ext4_msg(sb, KERN_ERR, "Failed to create an mb_cache");
47 -- 
48 2.20.1
49