ext2fs.c/ext2fs_mount() fails when inode_size = 256
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
Wolfgang Denk
Tested-byDear Bob Furber,
Quoted 2 lines · In message <[email protected]> you wrote:
Our SBC have been happily booting uClinux from ext3 partitioned SD cards prepared on a Fedora Linux-2.6.15 PC.
...
Quoted 1 line
Any thoughts or comments would be appreciated.
You failed to mention some really important fects, like for example which version of U-Boot you are using.
Me deems that it must be an old one.
This commit most probably fixes your issue:
commit 56fdaadc124a8ef9ec0fd8ff578233ec3b1137be
Author: Weirich, Bernhard <[email protected]> Date: Wed Jun 10 14:00:37 2009 +0200
ext2: fix inode size and calculations
I recommend you update your code, and try again.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de I'm what passes for a Unix guru in my office. This is a frightening concept. - Lee Ann Goldstein, in <[email protected]>
Dear Bob Furber,
please keep the mailing list on cc:
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 3 lines
You failed to mention some really important fects, like for example which version of U-Boot you are using.
ftp://ftp.denx.de/pub/u-boot/ --> u-boot-2009.08-rc2.tar.bz2, which appeared to be the most recent relrase.
Indeed.
Quoted 8 lines
Quoted 8 lines
This commit most probably fixes your issue:
commit
56fdaadc124a8ef9ec0fd8ff578233ec3b1137beAuthor: Weirich, Bernhard <[email protected]> Date: Wed Jun 10 14:00:37 2009 +0200ext2: fix inode size and calculations
Quoted 8 lines
Quoted 5 lines
Signed-off-by unsik Kim <[email protected]>Signed-off-by Bernhard Weirich <[email protected]>Signed-off-by Wolfgang Denk <[email protected]>Tested-by Wolfgang Denk <[email protected]>Forgive me, but I am new at this and I have no idea how to locate "commit
56fdaadc124a8ef9ec0fd8ff578233ec3b1137be".
You can use for example "git show" in your U-Boot git repository. In worst case, you can search the CHANGELOG.
Anyway - commit 56fdaadc is:
-> git-describe 56fdaadc v2009.08-rc1-1-g56fdaad
so it's the first commit after v2009.08-rc1 and thus included in v2009.08-rc2.
If this doesn't work for you, I'd be interested in receiving a test case, i. e. a minimal (as small as possible) file system image that shows the erroneous behaviour.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I don't mind criticism. You know me. I've never been one to take
offence at criticism. No one could say I'm the sort to take offence
at criticism -- Not twice, anyway. Not without blowing bubbles.
- Terry Pratchett, _Witches Abroad_Wolfgang Denk wrote:
Thanks Wolfgang. You were right. I had used u-boot-2009.08-rc1 which still had the 128 byte inode size hard-coded in ...\u-boot-2009.08-rc1\fs\ext2\ext2fs.c. Upgrading to u-boot-2009.08-rc2 now allows me to boot from 2GB SD cards formatted with Ubuntu-2.6.27.
Thanks,
Bob Furber
Quoted 2 lines
please keep the mailing list on cc:
My carelessness. I am new to this list and accustomed to simply click "Reply".
Quoted 50 lines
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 3 lines
You failed to mention some really important fects, like for example which version of U-Boot you are using.
ftp://ftp.denx.de/pub/u-boot/ --> u-boot-2009.08-rc2.tar.bz2, which appeared to be the most recent relrase.
Indeed.
Quoted 8 lines
Quoted 8 lines
This commit most probably fixes your issue:
commit
56fdaadc124a8ef9ec0fd8ff578233ec3b1137beAuthor: Weirich, Bernhard <[email protected]> Date: Wed Jun 10 14:00:37 2009 +0200ext2: fix inode size and calculations
Quoted 9 lines
Quoted 6 lines
Signed-off-by unsik Kim <[email protected]>Signed-off-by Bernhard Weirich <[email protected]>Signed-off-by Wolfgang Denk <[email protected]>Tested-by Wolfgang Denk <[email protected]>Forgive me, but I am new at this and I have no idea how to locate "commit
56fdaadc124a8ef9ec0fd8ff578233ec3b1137be".You can use for example "git show" in your U-Boot git repository. In worst case, you can search the CHANGELOG.
Anyway - commit
56fdaadcis:-> git-describe 56fdaadc v2009.08-rc1-1-g56fdaadso it's the first commit after v2009.08-rc1 and thus included in v2009.08-rc2.
If this doesn't work for you, I'd be interested in receiving a test case, i. e. a minimal (as small as possible) file system image that shows the erroneous behaviour.
Best regards,
Wolfgang Denk
Dear Bob Furber,
Quoted 5 lines · In message <[email protected]> you wrote:
Thanks Wolfgang. You were right. I had used u-boot-2009.08-rc1 which still had the 128 byte inode size hard-coded in ...\u-boot-2009.08-rc1\fs\ext2\ext2fs.c. Upgrading to u-boot-2009.08-rc2 now allows me to boot from 2GB SD cards formatted with Ubuntu-2.6.27.
Thanks for the confirmation.
Note: Your keyboard seems to be broken, it emits backslashes where there should be forward slashes.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de C++ is the best example of second-system effect since OS/360.
Quoted 11 lines · Wolfgang Denk
Quoted 5 lines
Thanks Wolfgang. You were right. I had used u-boot-2009.08-rc1 which still had the 128 byte inode size hard-coded in ...\u-boot-2009.08-rc1\fs\ext2\ext2fs.c. Upgrading to u-boot-2009.08-rc2 now allows me to boot from 2GB SD cards formatted with Ubuntu-2.6.27.
Thanks for the confirmation.
Note: Your keyboard seems to be broken, it emits backslashes where there should be forward slashes.
Yes, I feel like a intruder in U-boot land, given that I use a WinVistaPC for our s/w maintenance ;o)
Bob Furber