getenv: treat a read error like eof by jepler · Pull Request #7810 · adafruit/circuitpython · GitHub
Skip to content

getenv: treat a read error like eof#7810

Merged
dhalbert merged 2 commits into
adafruit:8.0.xfrom
jepler:read-error-getenv
Mar 29, 2023
Merged

getenv: treat a read error like eof#7810
dhalbert merged 2 commits into
adafruit:8.0.xfrom
jepler:read-error-getenv

Conversation

@jepler

@jepler jepler commented Mar 29, 2023

Copy link
Copy Markdown

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
Comment thread shared-module/os/getenv.c Outdated
Co-authored-by: Dan Halbert <halbert@adafruit.com>
@jepler jepler requested a review from dhalbert March 29, 2023 15:09

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

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