1 commit a70b020e5b2f1bbe3b759232852beaac4f0852b5
2 Author: Lokesh Nagappa Jaliminche <lokesh.jaliminche@seagate.com>
3 AuthorDate: Fri Nov 25 16:17:09 2016 +0530
4 LU-8364 ext4: fixes for failover mode.
6 When ext4 runs in failover mode with read-only disk,
7 it may loose part of allocation updates and fail while
8 mounting fs due to group descriptor checks before journal
9 replay not being valid after journal replay is complete.
10 Don't produce panics with on disk checks in read-only mode.
12 Seagate-bug-id: MRP-797
13 Change-Id: I54bee3a0aeb9a15f5ee2a79f7a2a2a905f19af1a
14 Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
15 Signed-off-by: Lokesh Nagappa Jaliminche <lokesh.jaliminche@seagate.com>
16 Reviewed-on: https://review.whamcloud.com/21141
18 fs/ext4/super.c | 12 +++++++-----
19 1 file changed, 7 insertions(+), 5 deletions(-)
21 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
22 index 6ea4936..134308f 100644
25 @@ -4145,11 +4145,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
28 sbi->s_gdb_count = db_count;
29 - if (!ext4_check_descriptors(sb, logical_sb_block, &first_not_zeroed)) {
30 - ext4_msg(sb, KERN_ERR, "group descriptors corrupted!");
31 - ret = -EFSCORRUPTED;
34 get_random_bytes(&sbi->s_next_generation, sizeof(u32));
35 spin_lock_init(&sbi->s_next_gen_lock);
37 @@ -4289,6 +4284,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
38 sbi->s_journal->j_commit_callback = ext4_journal_commit_callback;
42 + if (!ext4_check_descriptors(sb, logical_sb_block, &first_not_zeroed)) {
43 + ext4_msg(sb, KERN_ERR, "group descriptors corrupted!");
44 + ret = -EFSCORRUPTED;
45 + goto failed_mount_wq;
48 sbi->s_mb_cache = ext4_xattr_create_cache();
49 if (!sbi->s_mb_cache) {
50 ext4_msg(sb, KERN_ERR, "Failed to create an mb_cache");