nuttx/fs
Jukka Laitinen 26b7de0f34 fs/fat: Fix number of data clusters usable for fat driver
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>
2023-12-22 11:09:12 +01:00
..
aio fs/inode: remove all unnecessary check for filep/inode 2023-08-29 09:47:11 +08:00
binfs Fix the wrong comment banner 2023-12-03 17:50:35 +01:00
cromfs Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
driver rpmsgblk: bind block inode to ept when create ept 2023-11-22 08:08:12 -08:00
fat fs/fat: Fix number of data clusters usable for fat driver 2023-12-22 11:09:12 +01:00
hostfs cmake:complete missing changes during cmake reforming for fs 2023-09-08 21:20:16 +03:00
inode fs/proc: Fix groupfd to get fd by group instead of current tcb 2023-12-04 21:37:28 -08:00
littlefs cmake:complete missing changes during cmake reforming for fs 2023-09-08 21:20:16 +03:00
mmap Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
mount fs_gettype:add zipfs magic 2023-12-08 21:45:45 -03:00
mqueue poll: pollsetup should notify only one fd passd by caller 2023-11-21 09:07:17 +01:00
nfs Fix the wrong comment banner 2023-12-03 17:50:35 +01:00
nxffs Fix the wrong comment banner 2023-12-03 17:50:35 +01:00
partition nxstyle: cleanup UTF-8 Unicode to ASCII 2023-09-18 11:54:17 -04:00
procfs sched/procfs:use instrument to statistics run time max stack 2023-12-11 02:06:51 -08:00
romfs Fix the wrong comment banner 2023-12-03 17:50:35 +01:00
rpmsgfs Kconfigs: rename {Rpmsg|rpmsg} to RPMGS 2023-10-28 13:58:56 +08:00
semaphore sched/semaphore: Move named semaphores to user space 2023-11-27 04:52:54 -08:00
shm cmake:complete missing changes during cmake reforming for fs 2023-09-08 21:20:16 +03:00
smartfs Fix the wrong comment banner 2023-12-03 17:50:35 +01:00
socket build: add initial cmake build system 2023-07-08 13:50:48 +08:00
spiffs Fix the wrong comment banner 2023-12-03 17:50:35 +01:00
tmpfs Fix the wrong comment banner 2023-12-03 17:50:35 +01:00
unionfs Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
userfs fs/inode: remove all unnecessary check for filep/inode 2023-08-29 09:47:11 +08:00
vfs poll: pollsetup should notify only one fd passd by caller 2023-11-21 09:07:17 +01:00
zipfs fs:support zipfs,can mount zipfile 2023-09-27 01:06:04 +08:00
CMakeLists.txt build: add initial cmake build system 2023-07-08 13:50:48 +08:00
fs_initialize.c add the startup process tracepoint 2023-08-19 21:50:08 +08:00
Kconfig fs:support zipfs,can mount zipfile 2023-09-27 01:06:04 +08:00
Makefile fs:support zipfs,can mount zipfile 2023-09-27 01:06:04 +08:00