]> granicus.if.org Git - esp-idf/commit
nvs_flash: Multi-page blob erased using nvs_erase_key should be cleaned properly
authornegativekelvin <negativekelvin@github.com>
Wed, 27 Mar 2019 14:44:56 +0000 (20:14 +0530)
committerbot <bot@espressif.com>
Tue, 7 May 2019 05:53:19 +0000 (05:53 +0000)
commit553725df84e25135761c5387305526d44edba134
tree57d97d4fa2d06135d48377b69f95a5357f25ba68
parent038f51ffa66f03f0a38ea8e2f29e9ab03117ec41
nvs_flash: Multi-page blob erased using nvs_erase_key should be cleaned properly

Earlier eraseItem function in Storage class would do lazy cleanup of
multi-page blobs if called using type "ANY" instead of "BLOB". It used to
just delete BLOB data and index would remain as is. Any subsequent read
would delete index entry as well. This however would return a valid
length without error if nvs_get_blob API was just used for finding
length and not reading the complete blob. This change fixes this issue.

Closes https://github.com/espressif/esp-idf/issues/3255
components/nvs_flash/src/nvs_storage.cpp
components/nvs_flash/test_nvs_host/test_nvs.cpp