summaryrefslogtreecommitdiff
path: root/fs/yaffs2/yaffs_bitmap.h
diff options
context:
space:
mode:
authorWu, Josh <Josh.wu@atmel.com>2014-05-08 16:14:07 +0800
committerTom Rini <trini@ti.com>2014-05-12 16:31:51 -0400
commitdd6d7967dfa88bd51062a8afb004962d16006ecd (patch)
treeecfe8eb5205642f8eb65d6d623575f5769f1469a /fs/yaffs2/yaffs_bitmap.h
parent2e98f70882f8c1a09b662137884c1435a97c9a1c (diff)
downloadu-boot-dd6d7967dfa88bd51062a8afb004962d16006ecd.tar.gz
u-boot-dd6d7967dfa88bd51062a8afb004962d16006ecd.tar.bz2
u-boot-dd6d7967dfa88bd51062a8afb004962d16006ecd.zip
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>
Diffstat (limited to 'fs/yaffs2/yaffs_bitmap.h')
0 files changed, 0 insertions, 0 deletions