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

It appears that spiffs is not safe if power is lost at a bad time #1868

Closed
pjsg opened this issue Mar 17, 2017 · 4 comments
Closed

It appears that spiffs is not safe if power is lost at a bad time #1868

pjsg opened this issue Mar 17, 2017 · 4 comments
Labels

Comments

@pjsg
Copy link
Member

pjsg commented Mar 17, 2017

See pellepl/spiffs#137

It appears that the solution is to runs SPIFFS_check after restarting. My concern is that this could be slow. In particular, this might cause problems in systems which go into deep sleep and are then woken up (when, presumably, the filesystem is actually in a good state). The issue is that we need to read from the filesystem to get the init.lua.

@pjsg
Copy link
Member Author

pjsg commented Mar 22, 2017

However, it appears that the naive solution of running spiffs_check can make things worse....

@stale
Copy link

stale bot commented Jun 7, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 7, 2019
@stale stale bot closed this as completed Jun 21, 2019
@eastmoutain
Copy link

any solution for power loss issue?

@TerryE
Copy link
Collaborator

TerryE commented Nov 10, 2019

any solution for power loss issue?

Nope. SPIFFS is not a journaling FS, so there is no transactional integrity around writes to the FS. The read, write and erase primitives simply call the SDK API calls for these operations. Power failure during write or erase can leave the FS in an unknown and potentially corrupt state, though the logical design attempts to mitigate these issues. See How does SPIFFS handle powerlosses?.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants