public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Pedro Falcato" <pedro.falcato@gmail.com>
To: Jeff Brasen <jbrasen@nvidia.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>
Subject: Re: [PATCH 2/2] Ext4Pkg: Support non-cleanlty unmounted filesystems
Date: Fri, 10 Sep 2021 05:35:16 +0100	[thread overview]
Message-ID: <CAKbZUD2s5VbmkQz8x=eX0DzTYKUQtWox6jxzcSH6_Yy8ZN7vyQ@mail.gmail.com> (raw)
In-Reply-To: <36024a6bf15f115313e6fa134ee44dc6002de740.1631219610.git.jbrasen@nvidia.com>

Comments below.

The patch itself also looks good.

Commit message issue: typo on "non-cleanlty".

On Thu, Sep 9, 2021 at 9:41 PM Jeff Brasen <jbrasen@nvidia.com> wrote:
>
> Support for uncleanly mounted filesystems, if there is a recovery
> journal mark filesystem as read-only.
>
> Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
> ---
>  Features/Ext4Pkg/Ext4Dxe/Superblock.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/Features/Ext4Pkg/Ext4Dxe/Superblock.c b/Features/Ext4Pkg/Ext4Dxe/Superblock.c
> index 1f8cdd3705..444dd3ca97 100644
> --- a/Features/Ext4Pkg/Ext4Dxe/Superblock.c
> +++ b/Features/Ext4Pkg/Ext4Dxe/Superblock.c
> @@ -18,7 +18,7 @@ STATIC CONST UINT32  gSupportedIncompatFeat =
>    EXT4_FEATURE_INCOMPAT_64BIT | EXT4_FEATURE_INCOMPAT_DIRDATA |
>    EXT4_FEATURE_INCOMPAT_FLEX_BG | EXT4_FEATURE_INCOMPAT_FILETYPE |
>    EXT4_FEATURE_INCOMPAT_EXTENTS | EXT4_FEATURE_INCOMPAT_LARGEDIR |
> -  EXT4_FEATURE_INCOMPAT_MMP;
> +  EXT4_FEATURE_INCOMPAT_MMP | EXT4_FEATURE_INCOMPAT_RECOVER;
>
>  // Future features that may be nice additions in the future:
>  // 1) Btree support: Required for write support and would speed up lookups in large directories.
> @@ -88,10 +88,8 @@ Ext4SuperblockValidate (
>      return FALSE;
>    }
>
> -  // Is this correct behaviour? Imagine the power cuts out, should the system fail to boot because
> -  // we're scared of touching something corrupt?
>    if ((Sb->s_state & EXT4_FS_STATE_UNMOUNTED) == 0) {
> -    return FALSE;
> +    DEBUG ((DEBUG_WARN, "[ext4] filesystem was not unmounted cleanly\n"));
Nitpick: filesystem should be capitalized.
>    }
>
>    return TRUE;
> @@ -214,6 +212,11 @@ Ext4OpenSuperblock (
>      return EFI_UNSUPPORTED;
>    }
>
> +  if ((Partition->FeaturesIncompat & EXT4_FEATURE_INCOMPAT_RECOVER) == EXT4_FEATURE_INCOMPAT_RECOVER) {

New code that wants to test for features/feature-sets should use
EXT4_HAS_INCOMPAT, EXT4_HAS_COMPAT, EXT4_HAS_RO_COMPAT.
The code in this function that's testing for features using i.e:
FeaturesIncompat & FEATURE manually should likely be replaced by the
macros.

> +    DEBUG ((DEBUG_WARN, "[ext4] Needs journal recovery mount read-only\n"));
The debug message looks poorly worded; something like "[ext4] Needs
journal recovery, mounting read-only\n" sounds good?
> +    Partition->ReadOnly = TRUE;
> +  }
> +
>    // At the time of writing, it's the only supported checksum.
>    if (Partition->FeaturesCompat & EXT4_FEATURE_RO_COMPAT_METADATA_CSUM &&
>        Sb->s_checksum_type != EXT4_CHECKSUM_CRC32C) {
> --
> 2.17.1
>


-- 
Pedro Falcato

  reply	other threads:[~2021-09-10  4:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 20:40 [PATCH 0/2] ExtPkg Updates Jeff Brasen
2021-09-09 20:41 ` [PATCH 1/2] Ext4Pkg: Improve Binding support behavior Jeff Brasen
2021-09-10  4:22   ` Pedro Falcato
2021-09-10  4:34     ` Jeff Brasen
2021-09-10 16:24   ` [edk2-devel] " Marvin Häuser
2021-09-09 20:41 ` [PATCH 2/2] Ext4Pkg: Support non-cleanlty unmounted filesystems Jeff Brasen
2021-09-10  4:35   ` Pedro Falcato [this message]
2021-09-10  4:40 ` [PATCH 0/2] ExtPkg Updates Pedro Falcato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKbZUD2s5VbmkQz8x=eX0DzTYKUQtWox6jxzcSH6_Yy8ZN7vyQ@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox