]> 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, 28 Apr 2019 03:49:30 +0000 (03:49 +0000)
commit37b47b8e47d9d5ad878244ba79cbd4401921f15d
treed3fed2fed635bccad9a428ec47608f178c71ffbe
parent3f7cc13ed723feccad455f64d605ffa873907384
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