diff options
author | Christopher Haster <chaster@utexas.edu> | 2019-05-28 19:35:22 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2019-07-01 23:11:38 +0300 |
commit | 36973d8fd56c3bf6bc0002060a45ff2c3c2b48d5 (patch) | |
tree | 2fb6c429a081c290f69d71660c30329a73916a2e | |
parent | f06dc5737fd359de43d79bf32a66156ce26ff6fa (diff) |
Fixed missing cache flush in lfs_migrate
The data written to the prog cache would make littlefs internally
consistent, but because this was never written to disk, the filesystem
would become unmountable.
Unfortunately, this wasn't found during testing because caches automatically
flush if data is written up to a program boundary (maybe this was a mistake?).
Found by rojer
-rw-r--r-- | lfs.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -4399,6 +4399,11 @@ int lfs_migrate(lfs_t *lfs, const struct lfs_config *cfg) { goto cleanup; } } + + err = lfs_bd_flush(lfs, &lfs->pcache, &lfs->rcache, true); + if (err) { + goto cleanup; + } } // Create new superblock. This marks a successful migration! |