Comment # 14 on bug 989284 from
(In reply to Jan Kara from comment #13)
> OK. So u-boot fails not because it would check feature bits in superblock
> and find a feature that it does not understand but because it tries to use
> the values in group descriptors and fails.
> 
> Let me make one thing clear: U-boot support of ext2 / ext4 is *dangerous*.
> Any ext? driver must check feature bits in the superblock and make sure it
> understands *each* set bit in the feature_incompat set. If it intends to
> write to the filesystem, it must also make sure it understand *each* set bit
> in the feature_ro_compat set. U-boot seems to completely ignore feature bits
> and thus can read garbage or corrupt filesystem because of filesystem
> features it does not understand. The same holds for journal feature bits.
> 
> And I understand this means that u-boot may refuse to touch filesystems
> which it previously was able to access and it is a tedious task to propely
> implement all ext? features u-boot may need to support to access the
> filesystem but returning garbage or corrupting filesystem is worse.

That matches what I have seen so far. E.g. the write code seems to completely
lack any Endian awareness.

I think making U-Boot aware of the FEATURE_INCOMPAT flags and implement these
to be working at least read-only for the default set in mke2fs.conf is not to
hard. Most features seem to be already supported (e.g INCOMPAT_FILETYPE,
INCOMPAT_EXTENTS), although this is undocumented. Stuff like INLINE_DATA should
be trivial.

INCOMPAT_64BIT actually is trivial for the read-only, checksum-ignoring case.
If the size of the group-descriptor size is set correctly, U-Boot is able to
read the root fs from our images.


You are receiving this mail because: