[U-Boot] [U-Boot,v3] fs: fat: read: fix fat16 ls/read issue

Tom Rini trini at ti.com
Wed Jan 7 16:12:43 CET 2015


On Thu, Dec 18, 2014 at 05:14:17PM +0100, Przemyslaw Marczak wrote:

> The present fat implementation ignores FAT16 long name
> directory entries which aren't placed in a single sector.
> 
> This was becouse of the buffer was always filled by the
> two sectors, and the loop was made also for two sectors.
> 
> If some file long name entries are stored in two sectors,
> the we have two cases:
> 
> Case 1:
> Both of sectors are in the buffer - all required data
> for long file name is in the buffer.
> - Read OK!
> 
> Case 2:
> The current directory entry is placed at the end of the
> second buffered sector. And the next entries are placed
> in a sector which is not buffered yet. Then two next
> sectors are buffered and the mentioned entry is ignored.
> - Read fail!
> 
> This commit fixes this issue by:
> - read two sectors after loop on each single is done
> - keep the last used sector as a first in the buffer
>   before the read of two next
> 
> The commit doesn't affects the fat32 imlementation,
> which works good as previous.
> 
> Signed-off-by: Przemyslaw Marczak <p.marczak at samsung.com>
> Cc: Mikhail Zolotaryov <lebon at lebon.org.ua>
> Cc: Tom Rini <trini at ti.com>
> Cc: Stephen Warren <swarren at nvidia.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Suriyan Ramasami <suriyan.r at gmail.com>
> Cc: Lukasz Majewski <l.majewski at samsung.com>
> Cc: Wolfgang Denk <wd at denx.de>
> Tested-by: Simon Glass <sjg at chomium.org>

Applied to u-boot/master, thanks!

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


More information about the U-Boot mailing list