u-boot is not tolerant of unclean ext2 file systems

Bug #450906 reported by Michael Casadevall
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Adana
Incomplete
High
Unassigned

Bug Description

u-boot will fail to load files from an unclean filesystem. As an ext2 filesystem can be marked unclean just by a sudden restart, this means that the system will then fail to load the uImage and uInitrd from the filesystem. As power interruptions, or a sudden restart is always possible, this creates a situation where the system then must be rescued with an external boot media.

STEPS TO REPRODUCE:
1. Crash the system in a way that causes an ext2 partition to be unclean. (mounting a partition, then suddenly hitting the reset switch should work)
2. Try to load a file at the u-boot prompt, and watch how it fails with an error

EXPECTED BEHAVIOR:
1. u-boot attempt to load despite the clean/non-clean status of the filesystem

Loïc Minier (lool)
Changed in adana:
importance: Undecided → High
Revision history for this message
Michael Casadevall (mcasadevall) wrote :

It seems this doesn't always happen when the filesystem is marked unclean, as I just had my Y1 come up properly on an unclean file system, but there were no issues with the directory tree. Obviously the lack of robustness with ext2 is still an issue.

Revision history for this message
Maen Suleiman (maen-marvell) wrote :

The U-Boot ext2 code actually does test the status field in the superblock structure and thus the U-Boot doesn't care if the ext2 is clean or not.

Revision history for this message
Maen Suleiman (maen-marvell) wrote :

correction: The U-Boot ext2 code actually does NOT test the status field in the superblock structure and thus the U-Boot doesn't care if the ext2 is clean or not.

Revision history for this message
Loïc Minier (lool) wrote :

Incomplete for now; please reopen when you have a more specific issue.

Changed in adana:
status: New → Incomplete
Revision history for this message
Maen Suleiman (maen-marvell) wrote :

As Loic noticed, To work with current U-Boot, EXT2 should be formatted using "mkfs.ext2 -I 128" to limit node size to 128.
It is recommended to format the ext2 file system with "-I 128" to work properly with U-Boot.
Latest mainline U-Boot include a patch that fixes inode calculation and should support inodes with larger size; we are considering applying this patch to our U-Boot.

http://git.denx.de/?p=u-boot.git;a=blob;f=fs/ext2/ext2fs.c;h=d54f60b30b9397f6955b9c26df98eeb1f2cd6675;hb=master

Michael - Can you please apply this patch and see if it fixes your issue, meanwhile I am having issues with installing ubuntu and can't re-produce it.

Loïc Minier (lool)
visibility: private → public
Revision history for this message
Loïc Minier (lool) wrote :

NB: I made this bug public to document the rationale for the fix to partman-uboot I just uploaded.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.