1 Subject: [PATCH] ext4: don't verify group descriptors until after journal
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.
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
14 fs/ext4/super.c | 12 +++++++-----
15 1 file changed, 7 insertions(+), 5 deletions(-)
17 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
18 index 6ea4936..134308f 100644
21 @@ -4145,11 +4145,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
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;
30 get_random_bytes(&sbi->s_next_generation, sizeof(u32));
31 spin_lock_init(&sbi->s_next_gen_lock);
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;
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;
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");