Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When are file attributes finally written to "disk"? #956

Open
RalfEsy opened this issue Mar 8, 2024 · 2 comments
Open

When are file attributes finally written to "disk"? #956

RalfEsy opened this issue Mar 8, 2024 · 2 comments
Labels
needs investigation no idea what is wrong

Comments

@RalfEsy
Copy link

RalfEsy commented Mar 8, 2024

When using lfs_setattr() it seems the attribute data are not immediately written to "disk" (the corresponding file was not open).

During the call of lfs_setattr() there was no call to the "program" function (lfs_config::prog) and after a restart of the system the file attribute is not available.

I wonder how I can enforce littlefs to perform the write to "disk"?

@RalfEsy
Copy link
Author

RalfEsy commented Mar 8, 2024

I'm not sure if this is an issue on my side - I'll have to investigate this further...

@geky geky added question needs investigation no idea what is wrong and removed question labels Mar 8, 2024
@geky
Copy link
Member

geky commented Mar 8, 2024

During the call of lfs_setattr() there was no call to the "program" function

This certainly shouldn't happen. Progs in littlefs may be cached sometimes, but not when metadata changes are involved. lfs_setattr is a small wrapper over lfs_dir_commit, which flushes and syncs the new metadata to disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation no idea what is wrong
Projects
None yet
Development

No branches or pull requests

2 participants