[U-Boot] [PATCH 2/2] fs/fat: Optimizes memory size with single global variable instead of 3

Tom Rini trini at konsulko.com
Wed Aug 17 17:04:38 CEST 2016


On Mon, Aug 15, 2016 at 10:08:37AM -0600, Stephen Warren wrote:
> On 08/13/2016 04:57 PM, Benoît Thébaudeau wrote:
> >Hi,
> >
> >On Tue, Aug 2, 2016 at 9:35 PM, Benoît Thébaudeau
> ><benoit.thebaudeau.dev at gmail.com> wrote:
> >>On Tue, Aug 2, 2016 at 8:53 PM, Stephen Warren <swarren at wwwdotorg.org> wrote:
> >>>On 07/28/2016 12:11 AM, Tien Fong Chee wrote:
> >>>>
> >>>>Single 64KB get_contents_vfatname_block global variable would be used for
> >>>>all FAT implementation instead of allocating additional two global
> >>>>variables
> >>>>which are get_denfromdir_block and do_fat_read_at_block. This
> >>>>implementation
> >>>>can help in saving up 128KB memory space.
> >>>
> >>>
> >>>The series,
> >>>
> >>>Tested-by: Stephen Warren <swarren at nvidia.com>
> >>>(via DFU's FAT reading/writing on various Tegra; likely primarily FAT rather
> >>>than VFAT though)
> >>>
> >>>Reviewed-by: Stephen Warren <swarren at nvidia.com>
> >>
> >>I suspect that reading a filename with VFAT entries crossing a cluster
> >>boundary in a FAT32 root directory will be broken by this series. I do
> >>not have time to test this and other corner cases right now though,
> >>but it will be possible in the next few weeks.
> >
> >I have tested VFAT long filenames with the current implementation on
> >Sandbox. It's completely broken:
> > - There is a length limit somewhere between 111 and 120 characters,
> >instead of 256 characters. Beyond this limit, the files are invisible
> >with ls.
> > - Some filenames are truncated or mixed up between files. I have
> >tested 111-character random filenames for 1000 empty files in the root
> >directory. Most filenames had the expected length, but a few were
> >shorter or longer.
> > - If there are too many files in the root directory, ls hangs.
> >
> >I am pretty sure that this series introduces some regressions, but
> >they seem to be in corner cases that cannot even be used or tested
> >because of other bugs, so this series might not make this
> >implementation much more broken than it currently is. It's risky,
> >though.
> >
> >I've quickly looked into TianoCore EDK II. It is so deeply tied to the
> >EFI driver model and APIs that it would be a pain to port to U-Boot.
> >Its FAT module is not designed to be portable beyond EFI. Its build
> >system would complicate things too.
> >
> >Stephen, according to what you say in test/fs/fat-noncontig-test.sh,
> >your solution to accelerate FatFs seems to be working, even if the
> >author is not interested in it, so maybe it would still be worth
> >maintaining locally in order to have a reliable FAT support, also with
> >a small memory footprint. barebox uses FatFs.
> 
> Tom, any thoughts here re: the FF FAT implementation again?
> 
> BTW, I had some user of FF FAT about the "contiguous read" patch
> claiming that it caused issues in some cases. I didn't investigate
> since we'd dropped the idea of using FF FAT. Hopefully I could find
> the email (or maybe it was a post of the FF forums) again.

So it seems like we don't have a lot of good options here.  Maybe part
of the answer here needs to first be, of these various corner case bad
FAT filesystems, can we get test images?  I'm assuming that these aren't
things that can be easily constructed and thus fit into the current
test/fs script. We probably don't want to store these in the main U-Boot
repository as they'll take up a lot of space I imagine but we could
always put them somewhere and document in the testcases that we write
that you need to clone $X and point at it in order to use these tests.

As for using FF FAT or not, yes, I see barebox is using it too, but they
also aren't (or, haven't, I forget how often FF FAT updates) re-synced
with upstream, but they might have a few useful bugfixes we'd like.

I suppose at the end of the day a benefit of trying FF FAT again would
be another community we can engage with wrt "corner case" images.  And
it would be good to know where FF FAT is wrt the various problems we've
had.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160817/d059b7fd/attachment.sig>


More information about the U-Boot mailing list