littlefs icon indicating copy to clipboard operation
littlefs copied to clipboard

lfs_fs_forceconsistency may not run upon file creation

Open amgross opened this issue 2 weeks ago • 1 comments

Hi @geky , From what I see in code, lfs_fs_forceconsistency always run before operation that change the disk. The only exception is when open is called on non-existing file with LFS_O_CREAT flag but without LFS_O_WRONLY (for example, if someone wants to create empty file). Is it in purpose? (or bug that can corrupt the filesystem after powerdown...?) Another interesting point is that attributes won't be written to file in this case, even after closing.

amgross avatar Nov 24 '25 07:11 amgross