Skip to content

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