Skip to content

Change request : SPIFFS autoformat on mount failure #4185

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

Closed
vdeconinck opened this issue Jan 17, 2018 · 4 comments
Closed

Change request : SPIFFS autoformat on mount failure #4185

vdeconinck opened this issue Jan 17, 2018 · 4 comments

Comments

@vdeconinck
Copy link
Contributor

This issue to discuss the opportunity to change the default behaviour of SPIFFS mount() and begin().

In the current implementation, if the mounting filesystem fails, the API silently formats the filesystem and mounts it - empty.

Pro: after mount, the programmer is guaranteed to have a mounted filesystem

Con: if the chip is defective, or the API has a bug, or the FS has been formated with incompatible configuration, data gets lost without a warning. This is also contrary to the default behaviour chosen for ESP32

I would suggest to adopt the same convention as the ESP32: SPIFFS.begin() should accept an optional "formatOnFail" parameter, defaulting to false.

This would be breaking change (albeit in the direction of safety), so I guess it would have to be targeted to the next major version,

References:
#2581 (comment)
#4111 (comment)
espressif/arduino-esp32#411 (comment)

@devyte
Copy link
Collaborator

devyte commented Jan 24, 2018

@igrr do we want to change this to match the esp32 behavior? If yes, then this should likely be targetd for 3.0.0 release.

@devyte devyte added the waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. label Jan 24, 2018
@devyte devyte added this to the 3.0.0 milestone Jan 25, 2018
@devyte devyte added type: enhancement component: core and removed waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. labels Jan 25, 2018
@igrr igrr self-assigned this Mar 9, 2018
@earlephilhower
Copy link
Collaborator

#5525 will fix this, adding to tracking here.

@earlephilhower earlephilhower modified the milestones: 3.0.0, 2.6.0 Jan 22, 2019
@earlephilhower
Copy link
Collaborator

Removing @igrr since this should be in the next revision (with the changes already in a PR).

@earlephilhower
Copy link
Collaborator

Fixed in #5525 , there are now config helpers to setAutoFormat(bool) for filesystems.

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

No branches or pull requests

4 participants