forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Milestone
Description
In #8952 (comment) it was pointed out that this code looked funny:
circuitpython/ports/espressif/supervisor/internal_flash.c
Lines 154 to 157 in 499cc01
if (_cache_lba != block_address) { | |
supervisor_flash_read_blocks(_cache, sector_offset / FILESYSTEM_BLOCK_SIZE, blocks_per_sector); | |
_cache_lba = sector_offset; | |
} |
Specifically the value _cache_lba
is set to sector_offset
doesn't match the comparison value block_address
. This likely causes excess sector reads when writing to the file system. I think the data written is still write. The cache just doesn't work right.