|
|
@@ -3616,12 +3616,6 @@ static int lfs_rawformat(lfs_t *lfs, const struct lfs_config *cfg) {
|
|
|
goto cleanup;
|
|
|
}
|
|
|
|
|
|
- // sanity check that fetch works
|
|
|
- err = lfs_dir_fetch(lfs, &root, (const lfs_block_t[2]){0, 1});
|
|
|
- if (err) {
|
|
|
- goto cleanup;
|
|
|
- }
|
|
|
-
|
|
|
// force compaction to prevent accidentally mounting any
|
|
|
// older version of littlefs that may live on disk
|
|
|
root.erased = false;
|
|
|
@@ -3629,6 +3623,12 @@ static int lfs_rawformat(lfs_t *lfs, const struct lfs_config *cfg) {
|
|
|
if (err) {
|
|
|
goto cleanup;
|
|
|
}
|
|
|
+
|
|
|
+ // sanity check that fetch works
|
|
|
+ err = lfs_dir_fetch(lfs, &root, (const lfs_block_t[2]){0, 1});
|
|
|
+ if (err) {
|
|
|
+ goto cleanup;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
cleanup:
|