[U-Boot] [RFC] FAT errors

AKASHI Takahiro takahiro.akashi at linaro.org
Tue Sep 10 00:53:47 UTC 2019


On Sun, Sep 08, 2019 at 01:49:30AM +0200, Heinrich Schuchardt wrote:
> On 9/5/19 10:37 AM, AKASHI Takahiro wrote:
> >On Thu, Sep 05, 2019 at 08:43:43AM +0200, Heinrich Schuchardt wrote:
> >>Currently we do no have a maintainer for the FAT file system. Takahiro
> >>has done a great job fixing some of the most prominent deficiencies. But
> >>still the driver is not in good shape:
> >>
> >>I once again ran upon errors in FAT when executing the UEFI SCT.
> >>
> >>Here is some of the output of
> >>dosfsck -w -r -l -a -v -t
> >>The full output has hundreds of errors recorded.
> >
> >While I don't deny shifting to other code base for FAT,
> >I'm willing to debug the current code if you send me
> >binary data of corrupted file system.
> >The first 1MB or so, which will contains directory meta data,
> >would be good enough as I said before.
> >
> >I think that most errors stem from wrong long-file-name handling.
> >
> >-Takahiro Akashi
> 
> The SCT test that really shows the trouble is for
> EFI_FILE_PROTOCOL.GetInfo(). On FAT16 it hits the 512 files per
> directory limit.

Please note that, on FAT16, the root directory can have a fixed
number of blocks and that there is definitely an upper limit of
maximum number of entries allowed under it.

> Both on FAT16 and FAT32 it crashes when saving the log.

Did you see any message, or the file system got corrupted silently?

-Takahiro Akashi

> Observed on qemu_arm64_defconfig with edk2-test HEAD.
> 
> Best regards
> 
> Heinrich
> 
> >
> >
> >>Orphaned long file name part "Sct.log"
> >>   Auto-deleting.
> >>Orphaned long file name part "Sct.log"
> >>   Auto-deleting.
> >>/Log/RuntimeServicesTest/VariableServicesTest0/QueryVariableInfo_Conf_0_0_61758774-91A3-47DD-BDBD-B81094A5F62D.log
> >>   Duplicate directory entry.
> >>   First    Size 4712 bytes, date 01:00:00 Dec 31 1979
> >>   Second   Size 5086 bytes, date 01:00:00 Dec 31 1979
> >>   Auto-renaming second.
> >>   Renamed to FSCK0000.008
> >>
> >>BareBox is using a (somewhat outdated) copy of this library with a
> >>little bit of wrapper code:
> >>
> >>FatFs - Generic FAT Filesystem Module
> >>http://elm-chan.org/fsw/ff/00index_e.html
> >>http://elm-chan.org/fsw/ff/arc/ff13c.zip
> >>
> >>The same library is also used for Arduinos:
> >>https://github.com/stm32duino/FatFs
> >>
> >>Shouldn't we try just the same?
> >>
> >>Best regards
> >>
> >>Heinrich
> >
> 


More information about the U-Boot mailing list