Closed dl-dl closed 6 years ago
Duplicate of: littlefs: Fix issue updating dir struct when extended dir chain #6338
Ah! Thanks for raising an issue. Sorry I didn't see this earlier.
Glad to see the issue was fixed. https://github.com/ARMmbed/mbed-os/pull/6338 should be on mbed-os release 5.8.1.
Now that littlefs has been merged into mbed-os, it's probably better to make these issues against mbed-os in the future.
The following code demonstrates a bug in LittleFS. A file is created, written, closed with no errors, but seems to be empty (lfs_stat() shows zero size, lfs_file_read() returns zero). In the sample below errorCnt increments every 5th iteration. The bug recurrence actually depends on the block_size. The problem occurs when LFS allocates new block to extend the directory. Reproduced on both HeapBlockDevice and lfs_emubd.