Skip to content

Commit b7c2b3f

Browse files
jdascenziocarlescufi
authored andcommitted
nvs: NVS cache always rebuild on successful NVS initialization
During the NVS initialization, if gc had to be done, the NVS cache rebuild wasn't called. Signed-off-by: Julien D'Ascenzio <[email protected]>
1 parent a003b72 commit b7c2b3f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

subsys/fs/nvs/nvs.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,11 +887,13 @@ static int nvs_startup(struct nvs_fs *fs)
887887
fs->data_wra = fs->ate_wra & ADDR_SECT_MASK;
888888
}
889889

890+
end:
891+
890892
#ifdef CONFIG_NVS_LOOKUP_CACHE
891-
rc = nvs_lookup_cache_rebuild(fs);
893+
if (!rc) {
894+
rc = nvs_lookup_cache_rebuild(fs);
895+
}
892896
#endif
893-
894-
end:
895897
/* If the sector is empty add a gc done ate to avoid having insufficient
896898
* space when doing gc.
897899
*/

0 commit comments

Comments
 (0)