1
0
Fork 0
remarkable-uboot/fs
Wu, Josh dd6d7967df fs/fat: correct FAT16/12 file finding in root dir
When write a file into FAT file system, it will search a match file in
root dir. So the find_directory_entry() will get the first cluster of
root dir content and search the directory item one by one. If the file
is not found, we will call get_fatent_value() to get next cluster of root
dir via lookup the FAT table and continue the search.

The issue is in FAT16/12 system, we cannot get root dir's next clust
from FAT table. The FAT table only be use to find the clust of data
aera in FAT16/12.

In FAT16/12 if the clust is in root dir, the clust number is a negative
number or 0, 1. Since root dir is located in front of the data area.
Data area start clust #2. So the root dir clust number should < 2.

This patch will check above situation before call get_fatenv_value().
If curclust is < 2, include minus number, we just increase one on the
curclust since root dir is in continous cluster.

The patch also add a sanity check for entry in get_fatenv_value().

Signed-off-by: Josh Wu <josh.wu@atmel.com>
2014-05-12 16:31:51 -04:00
..
cbfs fs: descend into sub directories when it is necessary 2013-11-17 14:11:34 -05:00
cramfs fs: descend into sub directories when it is necessary 2013-11-17 14:11:34 -05:00
ext4 fs:ext4:write:fix: Reinitialize global variables after updating a file 2014-05-12 16:31:50 -04:00
fat fs/fat: correct FAT16/12 file finding in root dir 2014-05-12 16:31:51 -04:00
jffs2 JFFS2: Correct jffs2_1pass_build_lists to use lldiv 2013-12-13 09:16:20 -05:00
reiserfs fs: descend into sub directories when it is necessary 2013-11-17 14:11:34 -05:00
sandbox sandbox: implement exists() function 2014-02-19 09:47:34 -05:00
ubifs fs: ubifs: drop __DATE__ and __TIME__ 2014-05-12 15:19:46 -04:00
yaffs2 yaffs: Remove private list implementation 2014-03-04 12:15:29 -05:00
zfs fs: descend into sub directories when it is necessary 2013-11-17 14:11:34 -05:00
Makefile fs/fdos: Remove 2014-02-21 08:42:47 -05:00
fs.c fat: implement exists() for FAT fs 2014-02-19 09:47:34 -05:00