All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kever Yang <kever.yang@rock-chips.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/7] ext4: determine group descriptor size for 64bit feature
Date: Mon, 26 Dec 2016 16:23:39 +0800	[thread overview]
Message-ID: <5860D38B.4040309@rock-chips.com> (raw)
In-Reply-To: <7d97c22947c140c880d8e7bd9f7f781b@rwthex-w2-b.rwth-ad.de>

Hi Stefan, Tom,

     I'm using genext2fs command in Linux to generate my boot image for
kernel and its dtb, my command is like this:
     $ genext2fs -b 32768 -B $((32*1024*1024/32768)) -d boot/ -i 8192 -U 
boot.img

     In the latest version of U-Boot, the image from above command is 
not able
to be mount. After debug, I found out that the root cause is that the 
genext2fs
does not have a initial value for revision_level in super block. After I 
do the mount
and umount for the image in Linux, the U-Boot then can mount the image.

     Is it possible to still support the ext2 image generated by 
genext2fs command in U-Boot?

Thanks,
- Kever
On 09/17/2016 08:10 AM, Stefan Br?ns wrote:
> If EXT4_FEATURE_INCOMPAT_64BIT is set, the descriptor can be read from
> the superblocks, otherwise it defaults to 32.
>
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> ---
>   fs/ext4/ext4_common.c | 18 ++++++++++++++----
>   include/ext4fs.h      |  2 ++
>   2 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
> index a78b0b8..416a9db 100644
> --- a/fs/ext4/ext4_common.c
> +++ b/fs/ext4/ext4_common.c
> @@ -2233,13 +2233,23 @@ int ext4fs_mount(unsigned part_length)
>   		goto fail;
>   	}
>   
> -	if (le32_to_cpu(data->sblock.revision_level) == 0)
> +	if (le32_to_cpu(data->sblock.revision_level) == 0) {
>   		fs->inodesz = 128;
> -	else
> +	} else {
> +		debug("EXT4 features COMPAT: %08x INCOMPAT: %08x RO_COMPAT: %08x\n",
> +		      __le32_to_cpu(data->sblock.feature_compatibility),
> +		      __le32_to_cpu(data->sblock.feature_incompat),
> +		      __le32_to_cpu(data->sblock.feature_ro_compat));
> +
>   		fs->inodesz = le16_to_cpu(data->sblock.inode_size);
> +		fs->gdsize = le32_to_cpu(data->sblock.feature_incompat) &
> +			EXT4_FEATURE_INCOMPAT_64BIT ?
> +			le16_to_cpu(data->sblock.descriptor_size) : 32;
> +	}
>   
> -	debug("EXT2 rev %d, inode_size %d\n",
> -	       le32_to_cpu(data->sblock.revision_level), fs->inodesz);
> +	debug("EXT2 rev %d, inode_size %d, descriptor size %d\n",
> +	      le32_to_cpu(data->sblock.revision_level),
> +	      fs->inodesz, fs->gdsize);
>   
>   	data->diropen.data = data;
>   	data->diropen.ino = 2;
> diff --git a/include/ext4fs.h b/include/ext4fs.h
> index 6e31c73..7e1ee6c 100644
> --- a/include/ext4fs.h
> +++ b/include/ext4fs.h
> @@ -87,6 +87,8 @@ struct ext_filesystem {
>   	uint32_t inodesz;
>   	/* Sectors per Block */
>   	uint32_t sect_perblk;
> +	/* Group Descriptor size */
> +	uint16_t gdsize;
>   	/* Group Descriptor Block Number */
>   	uint32_t gdtable_blkno;
>   	/* Total block groups of partition */

  parent reply	other threads:[~2016-12-26  8:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160917001012.10498-1-stefan.bruens@rwth-aachen.de>
2016-09-17  0:10 ` [U-Boot] [PATCH 1/7] ext4: Update ext2/3/4 superblock, group descriptor and inode structures Stefan Brüns
2016-09-23 19:56   ` [U-Boot] [U-Boot, " Tom Rini
2016-09-17  0:10 ` [U-Boot] [PATCH 2/7] ext4: determine group descriptor size for 64bit feature Stefan Brüns
2016-09-23 19:56   ` [U-Boot] [U-Boot, " Tom Rini
2016-12-26  8:23   ` Kever Yang [this message]
2016-12-27  1:37     ` [U-Boot] [PATCH " Stefan Bruens
2016-09-17  0:10 ` [U-Boot] [PATCH 3/7] ext4: Add helper functions for block group descriptor field access Stefan Brüns
2016-09-17  0:10 ` [U-Boot] [PATCH 4/7] ext4: Use correct descriptor size when reading the block group descriptor Stefan Brüns
2016-09-23 19:56   ` [U-Boot] [U-Boot, " Tom Rini
2016-09-17  0:10 ` [U-Boot] [PATCH 5/7] ext4: Use helper function to access group descriptor and its fields Stefan Brüns
2016-09-23 19:56   ` [U-Boot] [U-Boot, " Tom Rini
2016-09-17  0:10 ` [U-Boot] [PATCH 6/7] ext4: Respect group descriptor size when adjusting free counts Stefan Brüns
2016-09-17  0:10 ` [U-Boot] [PATCH 7/7] ext4: Revert rejection of 64bit enabled ext4 fs Stefan Brüns
2016-09-23 19:56   ` [U-Boot] [U-Boot, " Tom Rini

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-all 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=5860D38B.4040309@rock-chips.com \
    --to=kever.yang@rock-chips.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.