Re: [PATCH] EXT4: fixes for recovery mode.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 8, 2016, at 2:36 AM, Lokesh Jaliminche <lokesh.jaliminche@xxxxxxxxxxx> wrote:
> 
> commit 3fd23caad436c961339ea3866a910354a83849d2
> Author: Lokesh Nagappa Jaliminche <lokesh.jaliminche@xxxxxxxxxxx>
> Date:   Tue Nov 8 14:27:48 2016 +0530
> 
>     ext4: fixes for recovery mode.
> 
>     After kernel crash when ext4 runs in recovery mode,
>     with read-only disk, it may loose part of allocation
>     updates and fail while mounting fs due to group
>     descriptor checks before journal replay. So group
>     descriptor check is moved after journal replay.
> 
>     Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xxxxxxxxxxx>
>     Signed-off-by: Lokesh Nagappa Jaliminche <lokesh.jaliminche@xxxxxxxxxxx>

Reviewed-by: Andreas Dilger <adilger@xxxxxxxxx>

> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 20da99d..3922487 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -3820,11 +3820,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>                         goto failed_mount2;
>                 }
>         }
> -       if (!ext4_check_descriptors(sb, logical_sb_block, &first_not_zeroed)) {
> -               ext4_msg(sb, KERN_ERR, "group descriptors corrupted!");
> -               ret = -EFSCORRUPTED;
> -               goto failed_mount2;
> -       }
> 
>         sbi->s_gdb_count = db_count;
>         get_random_bytes(&sbi->s_next_generation, sizeof(u32));
> @@ -3957,6 +3952,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>         sbi->s_journal->j_commit_callback = ext4_journal_commit_callback;
> 
>  no_journal:
> +
> +       if (!ext4_check_descriptors(sb, logical_sb_block, &first_not_zeroed)) {
> +               ext4_msg(sb, KERN_ERR, "group descriptors corrupted!");
> +               ret = -EFSCORRUPTED;
> +               goto failed_mount2;
> +       }
>         sbi->s_mb_cache = ext4_xattr_create_cache();
>         if (!sbi->s_mb_cache) {
>                 ext4_msg(sb, KERN_ERR, "Failed to create an mb_cache");


Cheers, Andreas





Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux