public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bob Furber <bob@steroidmicros.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] ext2fs.c/ext2fs_mount() fails when inode_size = 256
Date: Wed, 12 Aug 2009 09:18:00 -0700	[thread overview]
Message-ID: <4A82EB38.6060802@steroidmicros.com> (raw)

Our SBC have been happily booting uClinux from ext3 partitioned SD cards 
prepared on a Fedora Linux-2.6.15 PC.

But, when we prepared our 2GB SD cards on a brand new Ubuntu 
Linux-2.6.27 PC, out SBCs were no longer able to find /boot/linux.bin.

Linux/dumpe2fs showed that the bootable [Fedora] 2GB SD cards had 
inode_size = 128, whereas the delinquent [Ubuntu] SD cards had 
inode_size = 256. Adding a "-I 128" switch to mkfs.ext3 in the script 
that prepares an loads the SD cards solved the problem. That is, our 
SBCs can now boot from Ubuntu prepared SD cards. However, this brings up 
the point that, somewhere along the line, the default inode_size for SD 
cards is no longer 128 bytes. It could be double, quadruple or more.

There is some suspicious code in ext2fs.c/ext2fs_mount():

    inodes_per_block = EXT2_BLOCK_SIZE (data) / 128;

However, when this was replaced by

    inodes_per_block = EXT2_BLOCK_SIZE (data) / INODE_SIZE(data);

..the 2GB/128 byte inode SD cards booted and the 2GB/256 byte inode SD 
cards didn't.

When reading a 2GB/256 byte inode card, 
ext2fs_mount()/ext2fs_read_inode(data, 2, data->inode) returns 
data->inode filled with zeros. Either there is a flaw in data or data is 
not being interpreted correctly. Regrettably, the root problem eludes me.

Any thoughts or comments would be appreciated.

Bob Furber

             reply	other threads:[~2009-08-12 16:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12 16:18 Bob Furber [this message]
2009-08-12 20:07 ` [U-Boot] ext2fs.c/ext2fs_mount() fails when inode_size = 256 Wolfgang Denk
     [not found]   ` <4A832C44.3060503@steroidmicros.com>
2009-08-12 21:40     ` Wolfgang Denk
2009-08-13 21:48       ` Bob Furber
2009-08-13 22:03         ` Wolfgang Denk
2009-08-13 22:19           ` Bob Furber

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=4A82EB38.6060802@steroidmicros.com \
    --to=bob@steroidmicros.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox