26b7de0f34
Fix the issue where fat driver is not using the last two clusters in the file system. The fat parameter fs->fs_nclusters is the maximum number of data clusters; this doesn't include the two in the beginning. Many checks in the fat driver treat the fs->fs_nclusters-1 as being the last accessible cluster, which is not right, the last accessible one is actually this number + 2 when the cluster count includes the two first ones. Normally this is not an issue when writes are being done through the same driver, the last two clusters are just never used. But if the filesystem is modified by external driver, for example with a populated fat created with PC, or modifying the FS via USB-MSC, this leads to the fat driver not being able to read anything that uses the last two clusters. Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae> |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
fs_fat32.c | ||
fs_fat32.h | ||
fs_fat32attrib.c | ||
fs_fat32dirent.c | ||
fs_fat32util.c | ||
Kconfig | ||
Make.defs |