Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2019-05-28 19:35:22 +0300
committerChristopher Haster <chaster@utexas.edu>2019-07-01 23:11:38 +0300
commit36973d8fd56c3bf6bc0002060a45ff2c3c2b48d5 (patch)
tree2fb6c429a081c290f69d71660c30329a73916a2e
parentf06dc5737fd359de43d79bf32a66156ce26ff6fa (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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lfs.c b/lfs.c
index a12fdcf..7bd63e5 100644
--- a/lfs.c
+++ b/lfs.c
@@ -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!