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

getenv: treat a read error like eof #7810

Merged
merged 2 commits into from
Mar 29, 2023
Merged

Conversation

jepler
Copy link
Member

@jepler jepler commented Mar 29, 2023

Otherwise, the following would occur:

  • settings.toml is in the process of being written by host computer
  • soft-reset begins
  • web workflow tries to grab CIRCUITPY_WIFI_SSID, but loops forever because FAT filesystem is in inconsistent state and file reads error
  • settings.toml write by host computer never completes and the filesystem remains corrupt
  • restarting yields a soft-bricked device, because startup reads CIRCUITPY_WIFI_SSID again

Otherwise, the following would occur:
 * settings.toml is in the process of being written by host computer
 * soft-reset begins
 * web workflow tries to grab CIRCUITPY_WIFI_SSID, but loops forever
   because FAT filesystem is in inconsistent state and file reads error
 * settings.toml write by host computer never completes and the filesystem
   remains corrupt
 * restarting yields a soft-bricked device, because startup reads
   CIRCUITPY_WIFI_SSID again
shared-module/os/getenv.c Outdated Show resolved Hide resolved
Co-authored-by: Dan Halbert <halbert@adafruit.com>
@jepler jepler requested a review from dhalbert March 29, 2023 15:09
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Great sleuthing!

@dhalbert dhalbert merged commit 6a4830b into adafruit:8.0.x Mar 29, 2023
jepler added a commit that referenced this pull request Mar 29, 2023
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.

2 participants