]> 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>
Sun, 14 Apr 2019 06:23:38 +0000 (06:23 +0000)
commitef8341b5bc1781030be33ef171324461930764f3
treec7ca299e452a8368602821c6c863fd40d333018a
parent16a56e2e7aab86cc0d7aaf9245b75bf465f94c0b
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