Skip to content

Only update LittleFS timestamp when opened write#6956

Merged
earlephilhower merged 2 commits intoesp8266:masterfrom
earlephilhower:fixtime
Dec 30, 2019
Merged

Only update LittleFS timestamp when opened write#6956
earlephilhower merged 2 commits intoesp8266:masterfrom
earlephilhower:fixtime

Conversation

@earlephilhower
Copy link
Collaborator

Fixes #6955

LittleFS was updating the timestamp on any close, not only for files
when they were opened for writing. This could lead to excessive writes
to the flash.

Preserve the LFS flags, and only update the timestamp if the file was
opened for writing.

@earlephilhower earlephilhower added this to the 2.7.0 milestone Dec 28, 2019
Fixes esp8266#6955

LittleFS was updating the timestamp on any close, not only for files
when they were opened for writing.  This could lead to excessive writes
to the flash.

Preserve the LFS flags, and only update the timestamp if the file was
opened for writing.
@earlephilhower earlephilhower merged commit fa5040d into esp8266:master Dec 30, 2019
@earlephilhower earlephilhower deleted the fixtime branch December 30, 2019 23:43
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.

LittleFS timestamp last write is also changed after a file is only read.

1 participant