1
0
Fork 0
remarkable-uboot/fs
Przemyslaw Marczak 64f65e1e36 fs: fat: read: fix fat16 ls/read issue
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@samsung.com>
Cc: Mikhail Zolotaryov <lebon@lebon.org.ua>
Cc: Tom Rini <trini@ti.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Suriyan Ramasami <suriyan.r@gmail.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Wolfgang Denk <wd@denx.de>
Tested-by: Simon Glass <sjg@chomium.org>
2015-01-05 15:13:46 -05:00
..
cbfs fs: descend into sub directories when it is necessary 2013-11-17 14:11:34 -05:00
cramfs kconfig: add blank Kconfig files 2014-09-24 18:30:28 -04:00
ext4 fs/ext4/ext4fs.c, fs/fs.c fs/fat/fat_write.c: Adjust 64bit math methods 2014-12-01 15:21:57 -05:00
fat fs: fat: read: fix fat16 ls/read issue 2015-01-05 15:13:46 -05:00
jffs2 kconfig: add blank Kconfig files 2014-09-24 18:30:28 -04:00
reiserfs kconfig: add blank Kconfig files 2014-09-24 18:30:28 -04:00
sandbox fs: API changes enabling extra parameter to return size of type loff_t 2014-11-23 06:49:04 -05:00
ubifs include: move various macros to include/linux/kernel.h 2014-11-20 11:28:25 -05:00
yaffs2 lib, linux: move linux specific defines to linux/compat.h 2014-08-25 19:25:03 -04:00
zfs ZFS: Clean up cppcheck warnings where relevant, leaked memory etc 2014-11-10 16:25:27 -05:00
Kconfig kconfig: add blank Kconfig files 2014-09-24 18:30:28 -04:00
Makefile spl: Add EXT support to SPL 2014-10-27 17:54:03 -04:00
fs.c fs/ext4/ext4fs.c, fs/fs.c fs/fat/fat_write.c: Adjust 64bit math methods 2014-12-01 15:21:57 -05:00