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

Make multiple FS begin calls noops() SDFS/LittleFS #8235

Merged
merged 2 commits into from
Jul 26, 2021

Conversation

earlephilhower
Copy link
Collaborator

When LittleFS.begin() or SDFS.begin() is called after the filesystem is
already mounted, don't unmount/remount. When an unmount happens, all old
Files become invalid (but the core doesn't know this), so you would end
up with random crashes in FS code.

Now, check for _mounted, and if so just return immediately from begin().
This mimics the original SPIFFS code.

Fixes earlephilhower/ESP8266Audio#407

When LittleFS.begin() or SDFS.begin() is called after the filesystem is
already mounted, don't unmount/remount.  When an unmount happens, all old
Files become invalid (but the core doesn't know this), so you would end
up with random crashes in FS code.

Now, check for _mounted, and if so just return immediately from begin().
This mimics the original SPIFFS code.

Fixes earlephilhower/ESP8266Audio#407
@earlephilhower earlephilhower added this to the 3.0.2 milestone Jul 23, 2021
Copy link
Collaborator

@d-a-v d-a-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and coherent even with spiffs

@d-a-v d-a-v merged commit f908460 into esp8266:master Jul 26, 2021
@earlephilhower earlephilhower deleted the mounties branch July 28, 2021 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MIDI LittleFS
2 participants